Ana içeriğe atla
POST
/
kling
/
v1
/
audio
/
tts
TTS
curl --request POST \
  --url https://api.cometapi.com/kling/v1/audio/tts \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "text": "Welcome to CometAPI!",
  "voice_id": "genshin_vindi2",
  "voice_language": "zh"
}
'
{}

TTS

Kling TTS (Text-to-Speech) API, birden fazla dili ve ses seçeneğini destekleyen yüksek kaliteli metinden konuşmaya dönüştürme hizmetleri sunar.

Referans Dokümantasyonu


Yaygın Sorunlar

⚠️ Voice id not found Hatası

Sorun Açıklaması: voice_id, voice_language ile eşleşmediğinde API aşağıdaki hatayı döndürür:
{
  "message": "Voice id not found",
  "data": {
    "data": {
      "code": 1201,
      "message": "Voice id not found",
      "request_id": "ed47a82c-804b-45f3-bde9-926039cd25c0"
    },
    "message": "Voice id not found"
  }
}
Çözüm: Seçilen voice_id değerinin belirttiğiniz voice_language değerini desteklediğinden emin olun. Her voice ID’nin hangi dilleri desteklediğini kontrol etmek için Voice ID Listesi bağlantısına bakın.

Yetkilendirmeler

Authorization
string
header
gerekli

Bearer token authentication. Use your CometAPI key.

Başlıklar

Content-Type
string

Content type of the request body.

Gövde

application/json
text
string
varsayılan:Hello
gerekli

Text to synthesize into speech. Max 1000 characters.

voice_id
string
varsayılan:example
gerekli

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
varsayılan:example
gerekli

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.

Yanıt

200 - application/json

Success

The response is of type object.