Skip to main content
POST
cURL

TTS

A API Kling TTS (Text-to-Speech) fornece serviços de conversão de texto em fala de alta qualidade, com suporte a vários idiomas e opções de voz.

Documentação de referência


Problemas comuns

Erro de Voice id not found

Descrição do problema: Quando voice_id não corresponde a voice_language, a API retornará o seguinte erro:
Solução: Certifique-se de que o voice_id selecionado oferece suporte ao voice_language especificado. Consulte a Lista de Voice ID para verificar quais idiomas cada Voice ID suporta.

Autorizações

Authorization
string
header
obrigatório

Bearer token authentication. Use your CometAPI key.

Cabeçalhos

Content-Type
string

Content type of the request body.

Corpo

application/json
text
string
obrigatório

Text to synthesize into speech. Max 1000 characters.

voice_id
string
obrigatório

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
obrigatório

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.

Resposta

200 - application/json

Success

code
integer
obrigatório

Response code. 0 means the task request was accepted.

message
string
obrigatório

Response message.

data
object
obrigatório
request_id
string

Request identifier returned by CometAPI when present.