메인 콘텐츠로 건너뛰기
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.