メインコンテンツへスキップ
デプロイメントが稼働したら、以下のコマンドを使ってテストできます。ポートフォワーディングまたは Ingress を介してサービスへのネットワークアクセスがあることを確認してください。

ボイスの一覧

curl "http://<your-host>:<port>/voices" \
  -H "Cartesia-Version: 2025-04-16" \
  -H "X-API-Key: $CARTESIA_API_KEY" | jq '.'

テキスト読み上げ

curl -X POST "http://<your-host>:<port>/tts/bytes" \
  -H "Cartesia-Version: 2025-04-16" \
  -H "X-API-Key: $CARTESIA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model_id": "sonic-2",
    "transcript": "Hello, this is a test of the Cartesia text-to-speech API.",
    "voice": {
      "mode": "id",
      "id": "bf0a246a-8642-498a-9950-80c35e9276b5"
    },
    "output_format": {
      "container": "wav",
      "encoding": "pcm_f32le",
      "sample_rate": 44100
    },
    "language": "en"
  }' > output.wav

ベンチマーク

TTFA やレイテンシーなどの TTS パフォーマンスメトリクスを測定するためのベンチマークツールを、cartesia-kube リポジトリで提供しています。
cd cartesia-kube/benchmarking

export CARTESIA_API_KEY="your-api-key"
export CARTESIA_API_URL="wss://your-ingress-host"

# Run with default concurrency (4)
uv run tts_benchmark.py

# Run with custom concurrency
uv run tts_benchmark.py --concurrency 8
詳細な使い方と出力フォーマットは benchmarking の README を参照してください。