Theme
Text-to-Speech
POST
https://www.kkiai.com/kling/v1/audio/tts
Request Parameters
Authorization
Add the Authorization parameter to the Header. Its value is the Token concatenated after Bearer.
Example: Authorization: Bearer ********************
Header Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
Content-Type | string | Optional | application/json | |
Authorization | string | Optional | Bearer {{YOUR_API_KEY}} |
Body Parameters (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | Required | Text content for audio synthesis; maximum text length is 1000 characters. Exceeding this length will return an error code. The system validates text content and will return an error code if there are issues. |
voice_id | string | Required | Voice ID. The system provides multiple voice options to choose from. Refer to the voice effect, voice ID, and voice language correspondence. Voice preview does not support custom text. Voice preview file naming convention: voice name#voice ID#voice language. Text-to-speech currently only supports official voices and does not support custom voices. |
voice_language | string | Required | Language of the synthesized audio text; maximum text length is 1000 characters. Exceeding this length will return an error code. The system validates text content and will return an error code if there are issues. |
voice_speed | integer | Optional | Speech speed valid range: 0.8~2.0, precise to one decimal place. Values outside this range will be automatically rounded. |
Request Example
json
{
"text": "Describe what you see in the image.",
"voice_id": "genshin_vindi2",
"voice_language": "zh",
"voice_speed": "1.0"
}cURL Example
bash
curl --location --request POST 'https://www.kkiai.com/kling/v1/audio/tts' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"text": "Describe what you see in the image.",
"voice_id": "genshin_vindi2",
"voice_language": "zh",
"voice_speed": "1.0"
}'Response
🟢 200 Success
Response Example
json
{}