Skip to main content
POST
cURL

TTS

L’API Kling TTS (Text-to-Speech) fornisce servizi di sintesi vocale di alta qualità, supportando più lingue e opzioni vocali.

Documentazione di riferimento


Problemi comuni

Errore voice id not found

Descrizione del problema: Quando voice_id non corrisponde a voice_language, l’API restituirà il seguente errore:
Soluzione: Assicurati che il voice_id selezionato supporti il voice_language specificato. Fai riferimento all’Elenco Voice ID per verificare quali lingue supporta ciascun Voice ID.

Autorizzazioni

Authorization
string
header
obbligatorio

Bearer token authentication. Use your CometAPI key.

Intestazioni

Content-Type
string

Content type of the request body.

Corpo

application/json
text
string
obbligatorio

Text to synthesize into speech. Max 1000 characters.

voice_id
string
obbligatorio

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
obbligatorio

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.

Risposta

200 - application/json

Success

code
integer
obbligatorio

Response code. 0 means the task request was accepted.

message
string
obbligatorio

Response message.

data
object
obbligatorio
request_id
string

Request identifier returned by CometAPI when present.