Skip to main content
POST /v1/audio/speech Send JSON with model, input, and voice. The usual result is binary audio; Content-Type and encoding follow response_format. Do not parse successful audio as JSON; errors may still be JSON. Voices, speed, and style instructions depend on the model. stream_format: sse requires channel support. HTTP chunked transfer alone does not mean SSE. Integration guide and runnable example 简体中文

Authorizations

Authorization
string
header
required

模型调用 API Key,不是控制台登录凭据 / Model API key, not console login credentials

Body

application/json
model
string
required

当前密钥可用且支持此接口的模型 ID / Model ID available to the key and supporting this endpoint

Example:

"YOUR_MODEL_ID"

input
string
required

待合成文本 / Text to speak

voice
string
required

模型支持的音色标识 / Voice ID supported by the model

response_format
string

常见 mp3、wav、opus、aac、flac、pcm;支持情况由模型决定 / Common formats include mp3, wav, opus, aac, flac, pcm; support depends on model

instructions
string

可选风格指令,非所有模型支持 / Optional style instructions; not supported by every model

speed
number

语速;范围由模型决定 / Speed; accepted range depends on the model

stream_format
string

audio 或 sse 需渠道支持;本指南使用音频字节 / audio or sse requires channel support; this guide uses audio bytes

Response

音频字节;不能按 JSON 解析 / Audio bytes; do not parse as JSON

The response is of type file.