メインコンテンツへスキップ
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 は、高品質なテキスト読み上げサービスを提供し、複数言語と音声オプションをサポートしています。

リファレンスドキュメント


よくある問題

⚠️ Voice id not found エラー

問題の説明: voice_idvoice_language と一致しない場合、API は次のエラーを返します。
{
  "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"
  }
}
解決方法: 選択した 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
デフォルト:Hello
必須

Text to synthesize into speech. Max 1000 characters.

voice_id
string
デフォルト:example
必須

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
デフォルト:example
必須

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

The response is of type object.