Skip to main content
POST
cURL

TTS

Interfejs API Kling TTS (Text-to-Speech) zapewnia wysokiej jakości usługi zamiany tekstu na mowę, obsługując wiele języków i opcji głosowych.

Dokumentacja referencyjna


Typowe problemy

Błąd voice id not found

Opis problemu: Gdy voice_id nie pasuje do voice_language, API zwróci następujący błąd:
Rozwiązanie: Upewnij się, że wybrany voice_id obsługuje określony przez Ciebie voice_language. Sprawdź listę Voice ID, aby zobaczyć, które języki obsługuje każdy identyfikator głosu.

Autoryzacje

Authorization
string
header
wymagane

Bearer token authentication. Use your CometAPI key.

Nagłówki

Content-Type
string

Content type of the request body.

Treść

application/json
text
string
wymagane

Text to synthesize into speech. Max 1000 characters.

voice_id
string
wymagane

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
wymagane

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.

Odpowiedź

200 - application/json

Success

code
integer
wymagane

Response code. 0 means the task request was accepted.

message
string
wymagane

Response message.

data
object
wymagane
request_id
string

Request identifier returned by CometAPI when present.