Skip to main content
POST
cURL

TTS

Kling TTS(文本转语音)API 提供高质量的文本转语音服务,支持多种语言和语音选项。

参考文档


常见问题

Voice id not found 错误

问题描述:当 voice_idvoice_language 不匹配时,API 会返回以下错误:
解决方案:请确保所选的 voice_id 支持你指定的 voice_language。请参考 Voice ID 列表,查看每个 voice ID 支持哪些语言。

授权

Authorization
string
header
必填

Bearer token authentication. Use your CometAPI key.

请求头

Content-Type
string

Content type of the request body.

请求体

application/json
text
string
必填

Text to synthesize into speech. Max 1000 characters.

voice_id
string
必填

Voice preset ID. Determines the speaker voice used for synthesis. See the Kling documentation for available voice IDs and their supported languages.

voice_language
string
必填

Language of the selected voice. Must match the language supported by the chosen voice_id. Values: zh (Chinese) or en (English).

voice_speed
number

Speech rate multiplier. Range 0.8–2.0 (one decimal place). Values outside this range are clamped automatically.

响应

200 - application/json

Success

code
integer
必填

Response code. 0 means the task request was accepted.

message
string
必填

Response message.

data
object
必填
request_id
string

Request identifier returned by CometAPI when present.