跳转到主要内容

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.

Step Plan 除推理大模型外,还支持 语音合成 (TTS)语音识别 (ASR) 两类语音模型通过专属路径接入。所有请求统一使用 /step_plan/v1/... 路径前缀,域名固定为 https://api.stepfun.com

前置条件

  1. 已订阅 Step Plan 套餐
  2. 已获取 API Key

支持的模型

类别模型说明
实时语音对话stepaudio-2.5-realtime端到端实时语音对话模型,承接 StepAudio 2.5 TTS 表现力,支持音色复刻、人设定制与极低延迟交互
语音对话stepaudio-2.5-chat端到端对话大模型,文本输入、文本返回,支持千万人设完全自定义与高情商副语言感知
语音合成stepaudio-2.5-tts基于语境理解的新一代 Contextual TTS,支持全局语境 + 文中语境双档控制,生成具有呼吸感、轻重主次、情绪弧线的真人级表达
语音识别stepaudio-2.5-asr新一代流式 ASR 模型,4B MTP 架构,面向准实时转写场景,在低延迟下保持高识别准确率

实时语音对话

WebSocket 双向实时语音

语音对话

端到端对话补全(文本返回)

语音合成 (TTS)

非流式 / WebSocket 流式 / 音色试听 / 音色复刻

语音识别 (ASR)

HTTP + SSE 流式返回识别文本

实时语音对话

接口路径

能力请求方式Step Plan 路径
双向实时语音WebSocketwss://api.stepfun.com/step_plan/v1/realtime
接口参数与开放平台完全一致,详见 双向实时语音 接口文档。

计费说明

计费逻辑与开放平台一致,最终按开放平台实际计费金额折算为 Step Plan 总额度消耗。具体单价请参考 定价与限速

示例

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"
        }
    }))

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

if __name__ == "__main__":
    ws = websocket.WebSocketApp(
        # Step Plan 使用 /step_plan/v1 路径
        "wss://api.stepfun.com/step_plan/v1/realtime?model=stepaudio-2.5-realtime",
        header=headers,
        on_open=on_open,
        on_message=on_message,
    )
    ws.run_forever()

语音对话

接口路径

能力请求方式Step Plan 路径
文本对话补全POSThttps://api.stepfun.com/step_plan/v1/chat/completions
接口参数与开放平台完全一致,详见 对话补全(Chat Completion) 接口文档。stepaudio-2.5-chat 仅支持 text 模态,modalities 不应包含 audio

计费说明

计费逻辑与开放平台一致,最终按开放平台实际计费金额折算为 Step Plan 总额度消耗。具体单价请参考 定价与限速

示例

curl -X POST 'https://api.stepfun.com/step_plan/v1/chat/completions' \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $STEP_API_KEY" \
-d '{
    "model": "stepaudio-2.5-chat",
    "modalities": ["text"],
    "messages": [
      {"role": "user", "content": "今天心情有点闷,陪我聊聊"}
    ]
}'

语音合成

接口路径

能力请求方式Step Plan 路径
非流式语音合成POSThttps://api.stepfun.com/step_plan/v1/audio/speech
流式语音合成WebSocketwss://api.stepfun.com/step_plan/v1/realtime/audio
音色试听POSThttps://api.stepfun.com/step_plan/v1/audio/voices/preview
音色复刻POSThttps://api.stepfun.com/step_plan/v1/audio/voices
接口参数与开放平台完全一致,详见各接口的 API 文档:语音合成流式语音合成复刻试听复刻音色

计费说明

计费逻辑与开放平台一致,最终按开放平台实际计费金额折算为 Step Plan 总额度消耗。具体单价请参考 定价与限速

示例

curl -X POST 'https://api.stepfun.com/step_plan/v1/audio/speech' \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $STEP_API_KEY" \
-d '{
    "model": "stepaudio-2.5-tts",
    "input": "今天天气不错,适合出去走走。",
    "voice": "cixingnansheng",
    "instruction": "语气温柔,语速偏慢",
    "response_format": "mp3"
}' \
--output speech.mp3

语音识别

接口路径

能力请求方式Step Plan 路径
语音识别(流式返回文本)POSThttps://api.stepfun.com/step_plan/v1/audio/asr/sse
接口参数与开放平台完全一致,详见 语音识别(流式返回文本) 接口文档。

能力限制

当前 stepaudio-2.5-asr 在 Step Plan 下仅支持 HTTP + SSE 调用方式,与开放平台一致——该模型本身不提供 WebSocket 接口。

计费说明

计费逻辑与开放平台一致,最终按开放平台实际计费金额折算为 Step Plan 总额度消耗。具体单价请参考 定价与限速

示例

curl -X POST 'https://api.stepfun.com/step_plan/v1/audio/asr/sse' \
-H 'Content-Type: application/json' \
-H 'Accept: text/event-stream' \
-H "Authorization: Bearer $STEP_API_KEY" \
-d '{
    "audio": {
        "data": "base64_encoded_audio",
        "input": {
            "transcription": {
                "model": "stepaudio-2.5-asr",
                "language": "zh",
                "enable_itn": true
            },
            "format": {
                "type": "pcm",
                "codec": "pcm_s16le",
                "rate": 16000,
                "bits": 16,
                "channel": 1
            }
        }
    }
}'