> ## Documentation Index
> Fetch the complete documentation index at: https://platform.stepfun.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# StepAudio 2.5 Chat

StepAudio 2.5 Chat is an end-to-end speech-understanding model served through an OpenAI-compatible Chat Completion API. It accepts audio or text input, understands both the words and the tone behind them, such as hesitation, a slight laugh, or frustration, and returns a text response. For spoken replies, pair the text output with a text-to-speech model such as [StepAudio 2.5 TTS](/docs/en/guides/models/stepaudio-2.5-tts).

## Specifications

<Columns cols={2}>
  <Card title="Model ID">`stepaudio-2.5-chat`</Card>
  <Card title="Endpoint">`POST /v1/chat/completions`</Card>
  <Card title="Input">Audio or text</Card>
  <Card title="Output">Text only</Card>
  <Card title="Audio formats">mp3, wav</Card>
  <Card title="Languages">English</Card>
</Columns>

<Note>
  StepAudio 2.5 Chat returns text only. Requests that include `audio` in `modalities` are rejected with a `400` error. To give your assistant a voice, pass the text output to a text-to-speech model.
</Note>

## Capabilities

* **Paralinguistic understanding**: For audio input, the model interprets vocal cues such as intonation, pacing, hesitation, and laughter in addition to the spoken words, capturing a speaker's emotional state and intent that a text transcript does not represent.
* **Contextual, emotionally aware dialogue**: The model resolves complex or implicit meaning across turns and factors the inferred tone and context into its replies, rather than responding only to the literal words.
* **Persona and style control**: System instructions define the assistant's personality, speaking style, and behavioral boundaries at a fine-grained level, maintaining a consistent voice throughout a conversation without preset templates.
* **Unified text and audio input**: Text and audio are handled through the same Chat Completion endpoint, so an application can combine typed and spoken turns within a single conversation.

### Common use cases

* **Voice assistants and conversational agents**: Accept spoken input and return text that the application displays or passes to a text-to-speech model for a spoken reply.
* **Call and meeting analysis**: Summarize recordings, extract action items, and answer questions about what was discussed.
* **Voice message triage**: Classify incoming audio by intent and urgency and route it to the appropriate team or workflow without manual review.

## Quick Start

This section walks you through your first request to StepAudio 2.5 Chat, from creating an API key to sending text and audio input.

### Set up your environment

<Steps>
  <Step title="Create an API key">
    Create a key on the [StepFun platform](https://platform.stepfun.ai/interface-key).
  </Step>

  <Step title="Set your API key as an environment variable">
    ```bash theme={null}
    export STEPFUN_API_KEY="your-api-key"
    ```
  </Step>
</Steps>

All requests use the base URL `https://api.stepfun.ai/v1`.

### Text in, text out

Send a text message and receive a text reply.

<Tabs>
  <Tab title="curl">
    ```bash theme={null}
    curl https://api.stepfun.ai/v1/chat/completions \
      -H "Authorization: Bearer $STEPFUN_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "stepaudio-2.5-chat",
        "modalities": ["text"],
        "messages": [
          {"role": "system", "content": "You are a friendly, empathetic customer-support assistant for an online store. Acknowledge how the customer feels, then help. Keep replies under three sentences."},
          {"role": "user", "content": "I ordered a jacket two weeks ago and it still has not arrived. This is really frustrating."}
        ]
      }'
    ```
  </Tab>

  <Tab title="Python (OpenAI SDK)">
    1. Install the OpenAI SDK if you do not already have it:

       ```bash theme={null}
       pip install openai
       ```

    2. Run the script:

       ```python theme={null}
       import os
       from openai import OpenAI

       client = OpenAI(
           api_key=os.environ["STEPFUN_API_KEY"],
           base_url="https://api.stepfun.ai/v1",
       )

       response = client.chat.completions.create(
           model="stepaudio-2.5-chat",
           modalities=["text"],
           messages=[
               {"role": "system", "content": "You are a friendly, empathetic customer-support assistant for an online store. Acknowledge how the customer feels, then help. Keep replies under three sentences."},
               {"role": "user", "content": "I ordered a jacket two weeks ago and it still has not arrived. This is really frustrating."},
           ],
       )

       print(response.choices[0].message.content)
       ```
  </Tab>
</Tabs>

### Audio in, text out

Send a voice message by passing a local audio file (mp3 or wav) as a base64-encoded `input_audio` part. The model interprets the spoken content and replies in text.

```python theme={null}
import os
import base64
from openai import OpenAI

client = OpenAI(api_key=os.environ["STEPFUN_API_KEY"], base_url="https://api.stepfun.ai/v1")

with open("customer-message.wav", "rb") as f:
    audio_b64 = base64.b64encode(f.read()).decode()

response = client.chat.completions.create(
    model="stepaudio-2.5-chat",
    modalities=["text"],
    messages=[
        {"role": "system", "content": "You are a friendly, empathetic customer-support assistant for an online store. Acknowledge how the customer feels, then help. Keep replies under three sentences."},
        {"role": "user", "content": [
            {"type": "text", "text": "Here is a voice message from a customer. Please reply."},
            {"type": "input_audio", "input_audio": {"data": f"data:audio/wav;base64,{audio_b64}"}},
        ]},
    ],
)

print(response.choices[0].message.content)
```

## Pricing

See the [pricing page](/docs/en/guides/pricing/details) for current rates.

## Related Resources

<Columns cols={2}>
  <Card title="Chat Completion API" icon="file-lines" href="/docs/en/api-reference/chat/chat-completion-create">
    Look up every request parameter and response field in detail.
  </Card>

  <Card title="Audio Models Overview" icon="layer-group" href="/docs/en/guides/models/audio">
    Compare all speech models and choose the right one.
  </Card>
</Columns>
