Skip to main content
POST
cURL

TTS

API Kling TTS (Text-to-Speech) надає високоякісні сервіси перетворення тексту на мовлення з підтримкою кількох мов і варіантів голосу.

Довідкова документація


Поширені проблеми

Помилка Voice id not found

Опис проблеми: Коли voice_id не відповідає voice_language, API поверне таку помилку:
Рішення: Переконайтеся, що вибраний voice_id підтримує вказаний вами voice_language. Перегляньте список Voice ID, щоб перевірити, які мови підтримує кожен Voice ID.

Авторизації

Authorization
string
header
обов'язково

Bearer token authentication. Use your CometAPI key.

Заголовки

Content-Type
string

Content type of the request body.

Тіло

application/json
text
string
обов'язково

Text to synthesize into speech. Max 1000 characters.

voice_id
string
обов'язково

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
обов'язково

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.

Відповідь

200 - application/json

Success

code
integer
обов'язково

Response code. 0 means the task request was accepted.

message
string
обов'язково

Response message.

data
object
обов'язково
request_id
string

Request identifier returned by CometAPI when present.