> ## 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](https://platform.stepfun.ai/docs/en/guides/models/stepaudio-2.5-tts).

## Specifications

> [card] Model ID
>
> `stepaudio-2.5-chat`

> [card] Endpoint
>
> `POST /v1/chat/completions`

> [card] Input
>
> Audio or text

> [card] Output
>
> Text only

> [card] Audio formats
>
> mp3, wav

> [card] Languages
>
> English

> [!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.

## 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

**1. Create an API key**

Create a key on the [StepFun platform](https://platform.stepfun.ai/interface-key).

**2. Set your API key as an environment variable**

```bash theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
export STEPFUN_API_KEY="YOUR_STEP_API_KEY"
```

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

### Text in, text out

Send a text message and receive a text reply.

> [tab] curl
>
> ```bash theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
> 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] Python (OpenAI SDK)
>
> 1. Install the OpenAI SDK if you do not already have it:
>
>    ```bash theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
>    pip install openai
>    ```
>
> 2. Run the script:
>
>    ```python theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
>    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)
>    ```

### 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={"theme":{"light":"light-plus","dark":"dark-plus"}}
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](https://platform.stepfun.ai/docs/en/guides/pricing/details.md) for current rates.

## Related Resources

> [card] [Chat Completion API](https://platform.stepfun.ai/docs/en/api-reference/chat/chat-completion-create.md)
>
> Look up every request parameter and response field in detail.

> [card] [Audio Models Overview](https://platform.stepfun.ai/docs/en/guides/models/audio.md)
>
> Compare all speech models and choose the right one.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.