Skip to main content
POST
cURL

TTS

API Kling TTS (Text-to-Speech) menyediakan layanan text-to-speech berkualitas tinggi, dengan dukungan untuk berbagai bahasa dan opsi suara.

Dokumentasi referensi


Masalah umum

Error Voice id not found

Deskripsi masalah: Saat voice_id tidak cocok dengan voice_language, API akan mengembalikan error berikut:
Solusi: Pastikan voice_id yang dipilih mendukung voice_language yang Anda tentukan. Lihat Daftar Voice ID untuk memeriksa bahasa apa saja yang didukung oleh setiap voice ID.

Otorisasi

Authorization
string
header
wajib

Bearer token authentication. Use your CometAPI key.

Header

Content-Type
string

Content type of the request body.

Body

application/json
text
string
wajib

Text to synthesize into speech. Max 1000 characters.

voice_id
string
wajib

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
wajib

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.

Respons

200 - application/json

Success

code
integer
wajib

Response code. 0 means the task request was accepted.

message
string
wajib

Response message.

data
object
wajib
request_id
string

Request identifier returned by CometAPI when present.