Skip to navigation

Submit a text-to-speech batch

View as Markdown

Queues up to 50 texts to be voiced, one clip per text, with one provider, model and voice. Returns as soon as the batch is accepted and its exact charge is held — poll GET /v1/tts/batch/{job_id} for the audio. Billed per 1,000 characters at your workspace’s text-to-speech rate; clips that fail to render are refunded.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
textslist of stringsRequired

Texts to voice, one clip each, in order. Each is up to 5,000 characters; a longer one is rejected with 400 naming its index.

tts_providerenumRequired

Provider that voices every clip. Resolved to your own workspace’s connection server-side; a provider your workspace has no connection to is rejected with 400.

Allowed values:
voice_idstringRequired<=200 characters

Voice of the chosen provider, passed through unchanged: an ElevenLabs voice id (21m00Tcm4TlvDq8ikWAM), a Sarvam bulbul:v3 speaker (priya) or bulbul:v4-flash persona (ritu_hi_customer) matching tts_model, a Smallest lightning_v3.1_pro voice (mandar) or a Vakyam voice name (Archana). Not checked at submit — a wrong voice fails each clip with the provider’s message.

tts_modelenumOptional

Must be selectable for tts_provider: eleven_multilingual_v2 (default), eleven_flash_v2_5, eleven_turbo_v2_5, eleven_v4 or eleven_v4_turbo for elevenlabs; bulbul:v3 (default) or bulbul:v4-flash for sarvam; lightning_v3.1_pro for smallest; raaga-v1 for vakyam. Omit it for the provider’s default.

languagestring or nullOptional<=200 characters

Language name (Hindi, english) or locale code (hi-IN, en-IN), any case, normalized to a locale code. Omitted, Sarvam speaks en-IN, Smallest en and Vakyam hi-IN; ElevenLabs is not sent a language and speaks the language the text is written in. Text is spoken as written, not translated.

Response

Batch accepted and rendering
idstring
Batch id, 32 lowercase hex characters. Poll it to collect the audio.
statusenum

Always pending on submit — rendering runs asynchronously.

Allowed values:

Errors

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
422
Unprocessable Entity Error
429
Too Many Requests Error
503
Service Unavailable Error