텍스트 음성 변환

보이스 클론

립싱크

기타

텍스트 음성 변환 (HTTP)

HTTP로 TTS API를 테스트합니다.

텍스트 음성 변환 API

엔드포인트

POST /api/open/tts

요청 헤더

// JSON Format
Content-Type: application/json
Authorization: Bearer YOUR_API_TOKEN  // API 키

// MessagePack Format
Content-Type: application/msgpack
Authorization: Bearer YOUR_API_TOKEN  // API 키

요청 파라미터

예시 요청 파라미터

Version Notes:

  • Legacy Versions: v1, v2, s1 (basic text-to-speech functionality)
  • V3 Versions: v3-turbo, v3-hd (advanced features including emotion control and language boost)
  • The system will automatically select the corresponding version based on model configuration, no manual specification needed

응답 데이터

// Success Response (cache=false) - 200
Content-Type: audio/mpeg
<Binary audio data>

// Success Response (cache=true) - 200
Content-Type: application/json
{
  "success": boolean,        // Whether successful
  "audio_url": string,       // Audio file URL
  "format": string,          // Audio format
  "characters_used": number, // Characters used
  "quota_remaining": number  // Remaining API credits
}

// Error Response
{
  "error": string     // Error message
}

CURL 예시

# JSON Format - Traditional version (using s1 version, recommended)
curl -X POST https://kittaai.com/api/open/tts \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
    "reference_id": "your_model_id",
    "text": "Text content to convert",
    "speed": 1.0,
    "volume": 0,
    "version": "s1",
    "format": "mp3",
    "cache": false
  }' \
  --output output.mp3

# JSON Format - V3 model (using HD version, supports emotion control and language enhancement)
curl -X POST https://kittaai.com/api/open/tts \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
    "reference_id": "your_model_id",
    "text": "Text content to convert",
    "speed": 1.0,
    "volume": 0,
    "version": "v3-hd",
    "emotion": "calm",
    "language": "zh",
    "format": "mp3",
    "cache": false
  }' \
  --output output.mp3

# MessagePack Format (undefined)

온라인 디버그

상태 코드

200: Success
400: Bad Request
401: Unauthorized
403: Forbidden
404: Not Found
429: Too Many Requests
500: Internal Server Error