Skip to main content
POST
cURL

TTS

La API de Kling TTS (Text-to-Speech) proporciona servicios de conversión de texto a voz de alta calidad, compatibles con varios idiomas y opciones de voz.

Documentación de referencia


Problemas comunes

Error de voice id not found

Descripción del problema: Cuando voice_id no coincide con voice_language, la API devolverá el siguiente error:
Solución: Asegúrate de que el voice_id seleccionado sea compatible con el voice_language especificado. Consulta la Lista de Voice ID para verificar qué idiomas admite cada Voice ID.

Autorizaciones

Authorization
string
header
requerido

Bearer token authentication. Use your CometAPI key.

Encabezados

Content-Type
string

Content type of the request body.

Cuerpo

application/json
text
string
requerido

Text to synthesize into speech. Max 1000 characters.

voice_id
string
requerido

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
requerido

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.

Respuesta

200 - application/json

Success

code
integer
requerido

Response code. 0 means the task request was accepted.

message
string
requerido

Response message.

data
object
requerido
request_id
string

Request identifier returned by CometAPI when present.