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

# StepAudio 2.5 Realtime

真正具备"活人感"的实时语音大模型。全维度打造专属人设，连每一次呼吸和轻笑都不掉戏。继承 [StepAudio 2.5 TTS](https://platform.stepfun.com/docs/zh/guides/models/stepaudio-2.5-tts) 表现力，结合行业顶级副语言感知，瞬间读懂语气中的迟疑与轻笑，极速输出契合度拉满的高情商反馈。

> [card] [实时对话体验](https://www.stepfun.com/studio/audio?tab=voice-chat)
>
> 访问体验中心，感受双向语音对话效果。

> [card] [API 快速开始](#快速上手)
>
> 查看最小可运行的 WebSocket 调用示例。

> [card] [Step Plan 接入](https://platform.stepfun.com/docs/zh/step-plan/integrations/audio-api.md#实时语音对话)
>
> Step Plan 订阅用户可直接使用。

## 关键信息

> [card] 模型类型
>
> 端到端实时语音\
> 语音输入 / 语音输出

> [card] 协议
>
> WebSocket

## 核心能力

> [card] 💗 情绪价值
>
> 不再是冰冷的 AI，而是有脾气、有态度、懂接梗的鲜活搭子，为您带来最自然、好玩的陪伴体验。

> [card] 🧠 对话双商领跑
>
> 实现对话智商与情商的双重跃升。深度理解复杂语意、机智抛梗，输出契合度拉满的高情商反馈。

> [card] 👂 副语言感知
>
> 具备行业顶级副语言感知力——瞬间读懂语气中的迟疑与轻笑，无需用户明说就能精准捕捉情绪。

> [card] 🎭 千万人设完全自定义
>
> 真正实现"全维灵魂捏脸"，彻底打破预设模板束缚。支持细颗粒度定义性格特征、专属口癖与情绪边界。

> [card] 🎬 贴合语境神级表现力
>
> 全面继承 StepAudio 2.5 TTS 能力，实现"Global 全局场景定调"与"句内细节雕琢"的双重能力，发声时自然融入轻笑、叹息等真实细节。

> [card] 🎙️ 音色复刻
>
> 支持音色复刻——上传参考音频获取自定义 voiceid，复刻效果与 StepAudio 2.5 TTS 相当，可用 TTS 试听复刻效果。

## 适用场景

情感陪伴、日常交流、百科问答、任务助手等日常实时沟通交互对话全场景。

## API 端点

> [card] [双向实时语音](https://platform.stepfun.com/docs/zh/api-reference/realtime/chat.md)
>
> `WebSocket /v1/realtime`\
> 建立 WebSocket 连接，通过 Client / Server Event 完成双向语音交互。

## 定价

| 计费项 | 单价 |
| :- | :- |
| 输入（缓存未命中） | **10 元 / 1M tokens** |
| 输入（缓存命中） | **2 元 / 1M tokens** |
| 输出 | **70 元 / 1M tokens** |

[查看完整定价详情 →](https://platform.stepfun.com/docs/zh/guides/pricing/details.md)

## 快速上手

```python theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
import json
import websocket

headers = {
    "Authorization": "Bearer YOUR_STEP_API_KEY"
}

def on_open(ws):
    ws.send(json.dumps({
        "event_id": "event_001",
        "type": "session.update",
        "session": {
            "modalities": ["text", "audio"],
            "instructions": "你是有耐心的陪伴搭子，回答自然、温暖、有人情味。允许使用轻笑、叹息等副语言信号。",
            "voice": "linjiajiejie",
            "input_audio_format": "pcm16",
            "output_audio_format": "pcm16",
            "turn_detection": {
                "type": "server_vad",
                "prefix_padding_ms": 500
            }
        }
    }))

def on_message(ws, message):
    print(message)

if __name__ == "__main__":
    ws = websocket.WebSocketApp(
        "wss://api.stepfun.com/v1/realtime?model=stepaudio-2.5-realtime",
        header=headers,
        on_open=on_open,
        on_message=on_message,
    )
    ws.run_forever()
```

建连成功后，发送 `session.update` 配置会话；通过 `input_audio_buffer.append` 持续追加音频帧；ServerVAD 检测到说话结束自动触发推理，模型以 `response.audio.delta` 流式返回语音。

## 相关资源

> [card] [语音大模型概述](https://platform.stepfun.com/docs/zh/guides/models/audio.md)
>
> 返回语音大模型概述页，查看所有 TTS / ASR / 实时语音模型。

> [card] [双向实时语音 API](https://platform.stepfun.com/docs/zh/api-reference/realtime/chat.md)
>
> 查看完整事件协议、参数与响应。

> [card] [StepAudio 2.5 TTS](https://platform.stepfun.com/docs/zh/guides/models/stepaudio-2.5-tts)
>
> 可用 TTS 试听音色复刻效果。

> [card] [Step Plan 接入](https://platform.stepfun.com/docs/zh/step-plan/integrations/audio-api.md#实时语音对话)
>
> Step Plan 订阅下的实时语音对话路径。


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