IndexTTS 2.0 API
Zero-shot 3–30s WAV cloning & 3 emotion modes · 24 kHz WAV
POST /v1/audios/generations · https://api.callmodels.dev/v1/audios/generations
Pricing & specification tiers
Actual delivered audio duration billing at 0.12 Credits / second ($0.0012/s) rounded up to 0.1s with a 5.0s minimum floor (0.60 Credits = $0.0060). Valid clips shorter than 5s (e.g. 3s) settle at 5.0s; failed calls charge 0 Credits.
| Specification | Price (USD) | Credits ($1 = 100) | Per $10 Est. |
|---|---|---|---|
| Per-second rate · 24 kHz mono WAV (>5.0s billed at 0.1s precision) | $0.0012 / s | 0.120000 Credits / s | ~8,333 sec (~138.9 min) |
| Short clip floor (0.3s–5.0s output, e.g. 3s dialogue = 5.0s min) | $0.0060 | 0.600000 Credits | ~1,666 clips (≤5s) |
| 15s voiceover clip · Speaker + optional emotion reference WAV included | $0.0180 | 1.800000 Credits | ~555 clips (15s) |
| 60s narration (1 full minute of synthesized 24 kHz WAV speech) | $0.0720 | 7.200000 Credits | ~138 minutes |
Request parameters
Local
.wav files (3–30s, ≤15 MB): upload via POST /v1/files/uploads (0 Credits) for a 24h signed URL.| Parameter | Type & Default | Constraints |
|---|---|---|
AuthorizationRequiredHeader | string | Bearer sk-... server-side API key from your account. |
Idempotency-KeyOptionalHeader | stringDefault: recommended | 1 to 255 ASCII chars. Prevents duplicate submissions and charges for 24h. |
modelRequired | "indextts-2.0" | Stable public model ID for IndexTTS 2.0. |
promptRequired | string (1..1000) | 1 to 1,000 non-empty UTF-8 characters of speech text to synthesize (Chinese, English, or mixed bilingual text). |
speaker_audio_urlRequired | string (HTTPS WAV URL) | Publicly reachable HTTPS PCM/float WAV reference voice clip (3.0s–30.0s, ≤15 MB) for zero-shot timbre cloning. Local .wav files can be uploaded at 0 Credits via POST /v1/files/uploads. |
emotionOptional | "natural" | "happy" | "calm" | "sad" | "angry" | "surprised" | "melancholic" | "afraid" | "disgusted"Default: "natural" | Preset emotion vector (mutually exclusive with emotion_audio_url and emotion_text). "natural" preserves the speaker reference prosody. |
emotion_audio_urlOptional | string (HTTPS WAV URL)Default: omitted | Optional HTTPS WAV clip (3.0s–30.0s, ≤15 MB) whose emotional prosody is disentangled and transferred onto speaker_audio_url. |
emotion_textOptional | string (1..200)Default: omitted | Optional natural-language emotion description (1–200 chars, mutually exclusive with emotion_audio_url and non-natural emotion preset). |
emotion_scaleOptional | number (0..1)Default: 1.0 | Emotion intensity weight from 0.0 (subtle) to 1.0 (full expressive strength). |
interval_silence_msOptional | integer (0..2000)Default: 200 | Pause duration in milliseconds inserted between segmented clauses (0–2000 ms). |
max_text_tokens_per_segmentOptional | integer (32..300)Default: 120 | Maximum text tokens per autoregressive synthesis segment (32–300). |
output_formatOptional | "wav"Default: "wav" | 24 kHz mono PCM WAV delivered via a 30-day signed HTTPS URL on files.callmodels.dev. |
Code examples
# Optional: upload a local 3–30s .wav via POST /v1/files/uploads (0 Credits) to get speaker_audio_url.
# Set CALLMODELS_OPERATION_ID once per job and keep it for retries.
: "${CALLMODELS_OPERATION_ID:?Set a stable job ID}"
curl --silent --show-error --fail-with-body --max-time 15 "https://api.callmodels.dev/v1/audios/generations" \
-H "Authorization: Bearer $CALLMODELS_API_KEY" \
-H "Idempotency-Key: $CALLMODELS_OPERATION_ID" \
-H "Content-Type: application/json" \
--data-binary '{
"model": "indextts-2.0",
"prompt": "只有当科技为本地社群创造价值的时候,才真正有意义。",
"speaker_audio_url": "https://example.com/your-speaker-reference.wav",
"emotion": "natural",
"emotion_scale": 1,
"interval_silence_ms": 200
}'
# Set TASK_ID to the id from the response, then poll until terminal.
if [ -n "${TASK_ID:-}" ]; then
curl --silent --show-error --fail-with-body --max-time 15 "https://api.callmodels.dev/v1/tasks/$TASK_ID" \
-H "Authorization: Bearer $CALLMODELS_API_KEY"
fiTask responses
On completed, read results[0].url (30-day signed link, no auth header) and usage.cost_credits.
HTTP/1.1 202 Accepted
X-Request-Id: req_example
Cache-Control: no-store
{
"id": "task_01e561ba-859e-47fe-be79-60bc6f1d6499",
"model": "indextts-2.0",
"object": "audio.generation.task",
"created_at": "2026-11-21T00:00:00.000Z",
"status": "pending"
}Error codes
| HTTP / Error Code | Cause & Handling | Billing |
|---|---|---|
400 invalid_parameter400 model_not_found | Use the model ID and parameters documented for the endpoint. Correct the JSON before sending again. | 0 Credits for this rejection |
| 401 invalid_api_key | Check the server-side Bearer key, expiration and revocation status. | 0 Credits for this rejection |
402 insufficient_balance402 key_quota_exceeded | Check available account credits and the key’s total and daily limits with GET /v1/credits. | 0 Credits for this rejection |
403 model_access_denied403 account_disabled | Check the model allowlist and account status. | 0 Credits for this rejection |
| 404 not_found | Check the task ID or original Idempotency-Key and the account that submitted it. | 0 Credits for this rejection |
| 409 idempotency_key_conflict | Use the original JSON for this job. Assign a fresh key only to a new job. | 0 Credits for this rejection |
413 body_too_large415 unsupported_media_type | Send application/json with a request body no larger than 128 KiB. | 0 Credits for this rejection |
500 internal_error503 service_unavailable503 model_unavailable | On a timeout or transient error, look up the original job and retry only with its original key and body. | Check the task record |
Task: delivery_failedTask: submission_unknownTask: submission_rejectedTask: upstream_failedTask: timeout | The task ended. Its hold was released. Review error.code before creating a separate generation job. | 0 Credits charged |