"<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 参考
合成语音
请求格式、响应与能力边界。
"<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
发送 JSON,提供 model、input、voice。通常返回音频二进制,Content-Type 和编码随 response_format 变化。不要把成功响应按 JSON 读取;错误响应仍可能是 JSON。
音色、语速和风格指令由模型决定。stream_format: sse 只有渠道支持时可用,不能因为 HTTP 分块传输就按 SSE 解析。
完整接入指南与可执行示例
Read in English授权
模型调用 API Key,不是控制台登录凭据 / Model API key, not console login credentials
请求体
application/json
当前密钥可用且支持此接口的模型 ID / Model ID available to the key and supporting this endpoint
示例:
"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
响应
音频字节;不能按 JSON 解析 / Audio bytes; do not parse as JSON
The response is of type file.