"<string>"{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}API reference
Generate speech
Request format, responses, and capability boundaries.
"<string>"{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}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
模型调用 API Key,不是控制台登录凭据 / Model API key, not console login credentials
Body
application/json
当前密钥可用且支持此接口的模型 ID / Model ID available to the key and supporting this endpoint
Example:
"YOUR_MODEL_ID"
待合成文本 / Text to speak
模型支持的音色标识 / Voice ID supported by the model
常见 mp3、wav、opus、aac、flac、pcm;支持情况由模型决定 / Common formats include mp3, wav, opus, aac, flac, pcm; support depends on model
可选风格指令,非所有模型支持 / Optional style instructions; not supported by every model
语速;范围由模型决定 / Speed; accepted range depends on the model
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.