テキスト読み上げ

音声クローン

リップシンク

その他

テキスト読み上げ (HTTP)

HTTP 経由で音声合成 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 キー

リクエストパラメータ

サンプルリクエストパラメータ

バージョンの説明

  • 従来版: v1 / v2 / s1
  • V3: v3-turbo / v3-hd(感情制御などに対応)
  • モデル設定により適切なバージョンを自動選択します。

レスポンス

// 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: 成功
400: 不正なリクエスト
401: 未認証
403: アクセス拒否
404: 見つかりません
429: リクエスト過多
500: サーバーエラー