Reference
REST API
Every endpoint of the REST API, with its parameters, request and response bodies and errors, from the router's OpenAPI document.
Provider keys#
Set, list and delete your org’s provider keys with an API key, as the dashboard does. Write-only: a stored key is never returned.
get/v1/provider-keysList your provider keys
GET https://api.ttscacherouter.dev/v1/provider-keys
Which providers have a key stored, with each key's last four characters.
Responses
200Successful Response
An array of ProviderKey:
provider"vaakini" | "sarvam" | "raya" | "elevenlabs" | "openai" | "deepgram" | "xai" | "soniox" | "smallestai" | "cartesia" | "gemini" | "60db"Requiredlast4stringRequired- The key's last four characters. The key itself is never returned.
updated_atstring (date-time)Required
401Not signed in, or the session expired
422Validation Error
put/v1/provider-keys/{provider}Set or replace a provider key
PUT https://api.ttscacherouter.dev/v1/provider-keys/{provider}
Stored encrypted and never returned. The router uses a new or replaced key within seconds.
Parameters
providerpath, "vaakini" | "sarvam" | "raya" | "elevenlabs" | "openai" | "deepgram" | "xai" | "soniox" | "smallestai" | "cartesia" | "gemini" | "60db"Required
Request body
api_keystring, min length 1, max length 512Required- Your key for the provider. Stored encrypted; it can't be read back.
{ "api_key": "sk_…"}Responses
200Successful Response
provider"vaakini" | "sarvam" | "raya" | "elevenlabs" | "openai" | "deepgram" | "xai" | "soniox" | "smallestai" | "cartesia" | "gemini" | "60db"Requiredlast4stringRequired- The key's last four characters. The key itself is never returned.
updated_atstring (date-time)Required
Example { "last4": "x9Qa", "provider": "sarvam", "updated_at": "2026-10-10T09:32:00Z"}401Not signed in, or the session expired
422The request failed validation
delete/v1/provider-keys/{provider}Delete a provider key
DELETE https://api.ttscacherouter.dev/v1/provider-keys/{provider}
Requests for this provider fail with provider_key_missing within seconds.
Parameters
providerpath, "vaakini" | "sarvam" | "raya" | "elevenlabs" | "openai" | "deepgram" | "xai" | "soniox" | "smallestai" | "cartesia" | "gemini" | "60db"Required
Responses
204Successful Response
401Not signed in, or the session expired
404Not found, or not visible to the signed-in user
422Validation Error
Custom voices#
Your org’s own voices on Maya Open-Source, enabled per org on request. The guide is Custom voices.
get/v1/custom-voicesList your custom voices
GET https://api.ttscacherouter.dev/v1/custom-voices
Your org's custom voices, oldest first, whether they're enabled for it, and how many it can hold.
Responses
200Successful Response
enabledbooleanRequired- Whether custom voices are enabled for your org. Until they are, creating one is refused (
custom_voices_not_enabled); write to [email protected] to get them enabled. limitintegerRequired- How many custom voices your org can hold.
voicesCustomVoice[]Required
401No API key, or an invalid one
post/v1/custom-voicesCreate a custom voice
POST https://api.ttscacherouter.dev/v1/custom-voices
Creates a custom voice from one reference recording and registers it on Maya Open-Source before answering: it can be spoken as soon as this returns, by your org alone, with its id as voice. Creating and keeping voices is free; their characters cost what Maya Open-Source's do.
Responses
201Created: ready to speak
idstringRequired- What
voicetakes on/v1/stream,/v1/audio/speech, the LiveKit plugin and the Pipecat service, withprovidermaya. Only your org can speak it. namestring, min length 1, max length 100Requiredgender"female" | "male" | nullRequired- Your label for the voice, shown in
GET /v1/voices; null when you set none. It doesn't change how the voice sounds. language"as" | "bn" | "en" | "gu" | "hi" | "kn" | "ml" | "mr" | "or" | "pa" | "ta" | "te"Required- The recording's language. The voice speaks every language Maya does.
modelsCustomVoiceModel[]Requiredrevisioninteger, ≥ 1Required- Which recording the voice speaks: 1 when created, one more each time its recording is replaced (
PUT /v1/custom-voices/{voice_id}/recording). Audio cached for an earlier revision is never served for a later one. created_atstring (date-time)Required
Example { "id": "cv_t76u7a3um3xayk4b", "name": "Priya (support)", "gender": "female", "language": "hi", "models": [ { "model": "maya/maya-2-native", "mode": "icl_spk" } ], "revision": 1, "created_at": "2026-11-10T01:52:33Z"}401No API key, or an invalid one
403Custom voices aren't enabled for your org (`custom_voices_not_enabled`)
409Your org holds as many custom voices as it can (`custom_voice_limit`)
422The request failed validation, or Maya Open-Source couldn't use the recording (`bad_request`, naming the field)
503Maya Open-Source or the voice store is unavailable (`provider_unavailable`); nothing was kept, try again
get/v1/custom-voices/{voice_id}Get a custom voice
GET https://api.ttscacherouter.dev/v1/custom-voices/{voice_id}
Parameters
voice_idpath, stringRequired
Responses
200Successful Response
idstringRequired- What
voicetakes on/v1/stream,/v1/audio/speech, the LiveKit plugin and the Pipecat service, withprovidermaya. Only your org can speak it. namestring, min length 1, max length 100Requiredgender"female" | "male" | nullRequired- Your label for the voice, shown in
GET /v1/voices; null when you set none. It doesn't change how the voice sounds. language"as" | "bn" | "en" | "gu" | "hi" | "kn" | "ml" | "mr" | "or" | "pa" | "ta" | "te"Required- The recording's language. The voice speaks every language Maya does.
modelsCustomVoiceModel[]Requiredrevisioninteger, ≥ 1Required- Which recording the voice speaks: 1 when created, one more each time its recording is replaced (
PUT /v1/custom-voices/{voice_id}/recording). Audio cached for an earlier revision is never served for a later one. created_atstring (date-time)Required
Example { "id": "cv_t76u7a3um3xayk4b", "name": "Priya (support)", "gender": "female", "language": "hi", "models": [ { "model": "maya/maya-2-native", "mode": "icl_spk" } ], "revision": 1, "created_at": "2026-11-10T01:52:33Z"}401No API key, or an invalid one
403Custom voices aren't enabled for your org (`custom_voices_not_enabled`)
404No such custom voice in your org
patch/v1/custom-voices/{voice_id}Update a custom voice
PATCH https://api.ttscacherouter.dev/v1/custom-voices/{voice_id}
Only the name and gender change here. A gender of null clears it. To change the recording, transcript, language or mode, replace the recording (PUT …/recording).
Parameters
voice_idpath, stringRequired
Request body
namestring, min length 1, max length 100gender"female" | "male" | null- Null clears it.
Responses
200Successful Response
idstringRequired- What
voicetakes on/v1/stream,/v1/audio/speech, the LiveKit plugin and the Pipecat service, withprovidermaya. Only your org can speak it. namestring, min length 1, max length 100Requiredgender"female" | "male" | nullRequired- Your label for the voice, shown in
GET /v1/voices; null when you set none. It doesn't change how the voice sounds. language"as" | "bn" | "en" | "gu" | "hi" | "kn" | "ml" | "mr" | "or" | "pa" | "ta" | "te"Required- The recording's language. The voice speaks every language Maya does.
modelsCustomVoiceModel[]Requiredrevisioninteger, ≥ 1Required- Which recording the voice speaks: 1 when created, one more each time its recording is replaced (
PUT /v1/custom-voices/{voice_id}/recording). Audio cached for an earlier revision is never served for a later one. created_atstring (date-time)Required
Example { "id": "cv_t76u7a3um3xayk4b", "name": "Priya (support)", "gender": "female", "language": "hi", "models": [ { "model": "maya/maya-2-native", "mode": "icl_spk" } ], "revision": 1, "created_at": "2026-11-10T01:52:33Z"}401No API key, or an invalid one
403Custom voices aren't enabled for your org (`custom_voices_not_enabled`)
404No such custom voice in your org
422The request failed validation
delete/v1/custom-voices/{voice_id}Delete a custom voice
DELETE https://api.ttscacherouter.dev/v1/custom-voices/{voice_id}
Deletes the voice at once: requests naming it are refused from then on, and its recording and transcript are deleted. Audio cached from it can no longer be reached and expires with your org's cache retention (at most 30 days).
Parameters
voice_idpath, stringRequired
Responses
204Deleted
401No API key, or an invalid one
403Custom voices aren't enabled for your org (`custom_voices_not_enabled`)
404No such custom voice in your org
put/v1/custom-voices/{voice_id}/recordingReplace a custom voice's recording
PUT https://api.ttscacherouter.dev/v1/custom-voices/{voice_id}/recording
Replaces the voice's recording, transcript, language and mode together, under the same id, and registers the new recording on Maya Open-Source before answering: every request from then on speaks it (within a few seconds), and a reply already being spoken finishes in the old recording. The voice's revision goes up by one. Audio cached for the old recording is never served for the new one, so each sentence is synthesized again once. The name and gender don't change. If Maya Open-Source refuses the new recording, the voice keeps its old one.
Parameters
voice_idpath, stringRequired
Responses
200Replaced: the new recording is ready to speak
idstringRequired- What
voicetakes on/v1/stream,/v1/audio/speech, the LiveKit plugin and the Pipecat service, withprovidermaya. Only your org can speak it. namestring, min length 1, max length 100Requiredgender"female" | "male" | nullRequired- Your label for the voice, shown in
GET /v1/voices; null when you set none. It doesn't change how the voice sounds. language"as" | "bn" | "en" | "gu" | "hi" | "kn" | "ml" | "mr" | "or" | "pa" | "ta" | "te"Required- The recording's language. The voice speaks every language Maya does.
modelsCustomVoiceModel[]Requiredrevisioninteger, ≥ 1Required- Which recording the voice speaks: 1 when created, one more each time its recording is replaced (
PUT /v1/custom-voices/{voice_id}/recording). Audio cached for an earlier revision is never served for a later one. created_atstring (date-time)Required
Example { "id": "cv_t76u7a3um3xayk4b", "name": "Priya (support)", "gender": "female", "language": "hi", "models": [ { "model": "maya/maya-2-native", "mode": "icl_spk" } ], "revision": 1, "created_at": "2026-11-10T01:52:33Z"}401No API key, or an invalid one
403Custom voices aren't enabled for your org (`custom_voices_not_enabled`)
404No such custom voice in your org
422The request failed validation, or Maya Open-Source couldn't use the recording (`bad_request`, naming the field)
503Maya Open-Source or the voice store is unavailable (`provider_unavailable`); the voice keeps its old recording, try again
Models#
What the router accepts, per provider. No authentication.
get/v1/modelsList providers and models
GET https://api.ttscacherouter.dev/v1/models
Every provider and model the router accepts, with the voices, languages, speed range, sample rates, formats and options each one takes. No authentication. Maya Open-Source's voices include voices we add over time, so its list can grow (or lose one) between releases.
Responses
200Successful Response
providersProvider[]Required
Example { "providers": [ { "docs_url": "https://docs.sarvam.ai/api-reference/text-to-speech/stream", "formats": [ "pcm", "wav", "mp3", "aac", "mulaw", "alaw" ], "id": "sarvam", "models": [ { "id": "bulbul:v3", "languages": [ "hi-IN", "en-IN" ], "voices": [ "shubh", "aditya", "ritu" ], "voices_url": "https://docs.sarvam.ai/api/getting-started/models/bulbul" } ], "name": "Sarvam", "options": [ { "default": 0.6, "description": "Sampling temperature.", "max": 1, "min": 0.01, "name": "temperature", "nullable": false, "type": "number", "models": null }, { "default": 0, "description": "Pitch: lower is deeper, higher is sharper.", "max": 0.5, "min": -0.5, "models": [ "bulbul:v4-flash" ], "name": "pitch", "nullable": false, "type": "number", "values": null } ], "sample_rates": [ 8000, 16000, 22050, 24000 ], "speech_sample_rates": [ 8000, 16000, 22050, 24000, 32000, 44100, 48000 ], "speed": { "max": 2, "min": 0.5 } } ]}
Voices#
The voices your org can speak with at each provider. The guide is Voices.
get/v1/voicesList voices
GET https://api.media.ttscacherouter.dev/v1/voices
The voices your org can speak with at one provider, in one shape: the provider's built-in voices and your provider account's own (cloned, designed, added from a library), read live from the provider with your stored provider key (for Vaakini, its voices, then your Vaakini org's custom voices); Sarvam's and OpenAI's, which no provider API lists, and Maya Open-Source's (which needs no key), from the router's catalog, with your org's custom voices (category cloned). Only voices the router can speak with are listed. Never cached: a voice you add at the provider is listed on the next request. A provider that paginates is read to its last page, so the answer is the whole list.
Each voice's id is what voice takes on /v1/stream, /v1/audio/speech and the LiveKit plugin. Provider errors (a rejected key, a rate limit) pass through with the provider's status in provider_status and its body in message.
Parameters
providerquery, "maya" | "vaakini" | "sarvam" | "raya" | "elevenlabs" | "openai" | "deepgram" | "xai" | "soniox" | "smallestai" | "cartesia" | "gemini" | "60db"Required- The provider whose voices to list.
modelquery, string- Only voices this model takes, by the router's model id (as
GET /v1/modelslists them, without the provider prefix), e.g.bulbul:v4-flash,aura-2,m1.
Responses
200Successful Response
voicesVoice[]Required
400`bad_request` (a missing or unknown provider or model, an unknown query parameter), `provider_key_missing` (no key stored for the provider) or `provider_rejected` (the provider refused the request, e.g. a wrong provider key)
401A missing or invalid API key (`unauthorized`)
402The org is out of credit (`insufficient_credits`)
429The provider rate-limited your provider key (`provider_rate_limited`)
502The provider failed or answered something unexpected (`provider_unavailable`)
504The provider didn't answer in time (`provider_timeout`)
Speech#
Shaped like OpenAI’s. The guide is /v1/audio/speech.
post/v1/audio/speechCreate speech
POST https://api.media.ttscacherouter.dev/v1/audio/speech
Synthesizes input, shaped like OpenAI's audio/speech, so the OpenAI SDK works with base_url set to https://api.media.ttscacherouter.dev/v1 and your tcr_ key. Provider-specific fields go in the body (extra_body in the OpenAI SDK).
The input is split into sentences; each one your org has synthesized before with the same settings is served from the cache, the rest by the provider with your stored provider key (Maya Open-Source on our own GPU, with no key). Audio streams back as each sentence resolves. The status is sent with the first audio, so an error after audio has started can only abort the body: the response ends without its final chunk, which HTTP clients raise as an error (httpx.RemoteProtocolError, requests.exceptions.ChunkedEncodingError, …). Treat it as a failed request.
Request body
modelstringRequired<provider>/<model>:maya/maya-2-native(Maya Open-Source, no key needed),vaakini/vaakini-tts-1,sarvam/bulbul:v3,sarvam/bulbul:v4-flash,raya/standard,raya/m1, an ElevenLabs model such aselevenlabs/eleven_flash_v2_5, an OpenAI model such asopenai/gpt-4o-mini-tts,deepgram/aura-2,deepgram/aura-1ordeepgram/flux,xai/xai-tts,soniox/tts-rt-v2(Soniox's deprecatedtts-rt-v1aliases are refused),smallestai/lightning_v3.1orsmallestai/lightning_v3.1_pro, orcartesia/sonic-3.6,cartesia/sonic-3.5orcartesia/sonic-3(or a dated snapshot of one, e.g.cartesia/sonic-3.6-2026-08-27), orgemini/gemini-3.8-flash-tts,gemini/gemini-3.8-flash-lite-tts,gemini/gemini-3.1-flash-tts-preview,gemini/gemini-2.5-flash-preview-ttsorgemini/gemini-2.5-pro-preview-tts, or60db/60db-fast-v01or60db/60db-quality-v01(60db's tiers: the voice must be one of the tier's); seeGET /v1/models.inputstring, min length 1Required- The text to speak.
voicestring, min length 1- The provider's voice id, required except with Gemini's
speakers: one of Maya Open-Source's voices (e.g.Monika; any case) or one of your org's custom voices (cv_…), one of Vaakini's voices by name (e.g.Monika; any case) or a custom voice of your Vaakini org (cv_…), a Sarvam speaker, a Raya voice id, an ElevenLabs voice id, an OpenAI voice (e.g.ash), a Deepgram voice with its language (e.g.thalia-en: withdeepgram/aura-2, Deepgram'saura-2-thalia-en) an xAI voice (e.g.ara, or a custom voice id), a Soniox voice (e.g.Adrian, or a cloned voice's id), a Cartesia voice id (e.g.f786b574-daa5-4673-aa0c-cbe3e8534c02) a Gemini voice (e.g.Kore; with the 3.8 models also a library voice such asen-us-tutor-1; left out with Gemini'sspeakers), a Smallest AI voice of the model (e.g.meherwithlightning_v3.1_pro,sophiawithlightning_v3.1, or a cloned voice's id, with the model it was cloned for), or a 60db voice id of the model's tier (e.g.fbb75ed2-975a-40c7-9e06-38e30524a9a1with60db-fast-v01). languagestring | null, min length 1- The provider's language code, e.g.
hi-IN(Sarvam),hi(Raya),en(ElevenLabs),enorauto(xAI),en(Soniox),en,hiorauto(Smallest AI),enorhi(Cartesia). Required for Sarvam, Raya and Soniox (which reads the text through that language's phonetics); optional for ElevenLabs, which otherwise detects the language, for xAI (defaultauto: xAI detects it) for Smallest AI (defaulten;auto: Smallest AI detects it) for Cartesia (defaulten) for Maya Open-Source (as,bn,en,gu,hi,kn,ml,mr,or,pa,taorte; left out, Maya guesses it from the text's script) and for Vaakini (as,bn,en,gu,hi,kn,ml,mr,or,pa,taorte; left out, Vaakini picks it from the text's script); not accepted for OpenAI, Gemini and 60db, which speak the language of the text, nor for Deepgram, whose voice names its language. response_format"pcm" | "wav" | "mp3" | "aac" | "mulaw" | "alaw"pcm(s16le mono),wav,mp3,aac,mulaworalaw. Raya supportspcm,wav,mulawand (m1only)mp3; ElevenLabspcm,wav,mp3,mulawandalaw; OpenAIpcm,wav,mp3andaac; Deepgrampcm,wav,mulaw,alawand (Aura only)mp3; xAI, Soniox, Smallest AI and Cartesiapcm,wav,mp3,mulawandalaw; Geminipcmandwav, and with its 3.8 modelsmulawandalaw; 60dbpcm,wavandmulaw; Maya Open-Sourcepcm,wavandmp3; Vaakinipcm,wavandmp3.speednumber- Sarvam 0.5–2.0, Raya 0.5–1.5, OpenAI 0.25–4.0, Deepgram 0.7–1.5 (
aura-2only; left out, Deepgram's default), xAI 0.7–1.5 (left out, xAI's default, 1.0), Soniox 0.7–1.3, Smallest AI 0.5–2.0, Cartesia 0.6–1.5 (left out, Cartesia's default, 1.0), 60db 0.5–2.0 (left out, 60db's default, 1.0). Not for ElevenLabs, whose speed isvoice_settings.speed, nor for Gemini (ask for a pace ininstructions), nor for Maya Open-Source or Vaakini. sample_rate8000 | 16000 | 22050 | 24000 | 32000 | 44100 | 48000- 32000, 44100 and 48000 are Sarvam's over its REST API (one request per sentence), where
bitrateis fixed at 128k, and ElevenLabs'pcm. ElevenLabs'mp3is 22050, 24000 or 44100 Hz; itsmulawandalaw8000 Hz (their default). OpenAI is 24000 Hz only. Deepgram'spcmis 8000, 16000, 24000, 32000, 44100 or 48000 Hz, itsmulawandalaw8000 (default) or 16000, itsmp322050 (default). xAI is 8000, 16000, 22050, 24000, 44100 or 48000 Hz for every format. Soniox'spcmis 8000, 16000, 24000, 44100 or 48000 Hz, itsmp316000, 24000, 32000, 44100 or 48000, itsmulawandalaw8000 (their default). Smallest AI is 8000, 16000, 24000 or 44100 Hz for every format. Cartesia is 8000, 16000, 22050, 24000, 44100 or 48000 Hz for every format. Gemini'spcmis 24000 Hz only, itsmulawandalaw8000 (their default). 60db'spcmis 8000, 16000, 24000 or 48000 Hz, itsmulaw8000 (its default). Maya Open-Source is 24000 Hz only. Vaakini is 24000 Hz only. stream_format"audio"- Only
audio: the body is the audio itself. instructionsstring | null, min length 1- OpenAI and Gemini: how to speak (tone, accent, emotion, pace). OpenAI's
gpt-4o-mini-ttsfollows them;tts-1andtts-1-hdignore them. Gemini's 2.5 and 3.1 models take them in the prompt (left out, LiveKit's Gemini plugin's default: "Say the text with a proper tone, don't omit or add any words"), its 3.8 models as the delivery style (left out, none). temperaturenumber | null- Sarvam: 0.01–1.0, default 0.6. Maya Open-Source: 0.1–1.5; left out, Maya's default. Vaakini: 0.1–1.5; left out, Vaakini's default.
dict_idstring | null- Sarvam only: a pronunciation dictionary.
bitrate"32k" | "48k" | "64k" | "96k" | "128k" | "192k" | 32000 | 64000 | 96000 | 128000 | 192000 | 256000 | 320000 | nullmp3(and Sarvam'saac). Sarvam: 32k–192k, default128k. ElevenLabs: 32k at 22050 Hz, 48k at 24000 Hz, 32k–192k at 44100 Hz (default 128k). Soniox (mp3only): an integer in bits per second, 32000, 64000, 96000, 128000, 192000, 256000 or 320000 (left out, Soniox's default, 128000).pitchnumber | null- Sarvam
bulbul:v4-flashonly: -0.5 (deeper) to 0.5 (higher), default 0. loudnessnumber | null- Sarvam
bulbul:v4-flashonly: 0.1–2.5, default 1.0. enable_preprocessingboolean | null- Sarvam
bulbul:v4-flashonly: normalize numbers and English words in the text before synthesis. Default false. min_buffer_sizeinteger | null, ≥ 30, ≤ 200- Sarvam only: characters Sarvam buffers before it starts synthesizing, 30–200. Default: the router's choice, the least Sarvam allows.
max_chunk_lengthinteger | null, ≥ 50, ≤ 500- Sarvam only: the longest text Sarvam synthesizes in one piece, 50–500; it splits longer sentences. Default: the router's choice, the most Sarvam allows, so each sentence is synthesized whole.
voice_settingsobject | null- ElevenLabs only: any of the voice's settings; one left out keeps its stored setting, and null keeps them all. Dialogue models (
eleven_v3,eleven_v4) usestabilityonly. apply_text_normalization"auto" | "on" | "off" | null- ElevenLabs only:
auto(default),onoroff. apply_language_text_normalizationboolean | null- ElevenLabs only: language-specific normalization (Japanese).
enable_ssml_parsingboolean | null- ElevenLabs only: parse SSML tags. Default false.
enable_loggingboolean | null- ElevenLabs only: false for ElevenLabs' zero-retention mode (enterprise accounts). Default true.
pronunciation_dictionary_locatorsobject[] | null- ElevenLabs only: up to 3 pronunciation dictionary versions.
mip_opt_outboolean- Deepgram only: opt out of Deepgram's Model Improvement Program.
bit_rate32000 | 48000 | 64000 | 96000 | 128000 | 192000 | nullmp3only: the bit rate in bits per second. Deepgram: 32000 or 48000 (left out, Deepgram's default, 48000). xAI: 32000, 64000, 96000, 128000 or 192000 (left out, xAI's default, 128000). Cartesia: MP3's bit rate, 32000, 64000, 96000, 128000 (default) or 192000.optimize_streaming_latency0 | 1 | 2 | null- xAI only: 0 for the best quality (xAI's default), 1 or 2 for a smaller first chunk and lower time to first audio, with a quality tradeoff at chunk boundaries. Left out, xAI's default.
text_normalizationboolean | null- xAI only: normalize written forms (numbers, abbreviations, symbols) into spoken forms before synthesis. Left out, xAI's default (false).
reduce_silenceboolean | null- Soniox only: shorten the pauses between words. Left out, Soniox's default (false).
volumenumber, ≥ 0.5, ≤ 2- Cartesia: loudness relative to the voice's own. Left out, Cartesia's default (1.0).
emotionstring- Cartesia: guide the delivery (English), e.g.
calm,sadorangry; Cartesia lists the rest. Left out, Cartesia reads the emotion from the text. pronunciation_dict_idstring- Cartesia: a pronunciation dictionary's id, part of the cache key: a dictionary edited in place reaches cached entries only when they expire.
speakersobject- Gemini's 3.8 models: two speakers' names, each with a voice (a multi-speaker voice config); replaces
voice. Requiresspeaker. speakerstring, min length 1- Gemini: which of
speakersvoices this request. wpminteger, ≥ 60, ≤ 300- 60db: the target pace in words per minute. Left out, the voice's own pace.
stabilityinteger, ≥ 0, ≤ 100- 60db: 0 (expressive) to 100 (consistent). Left out, 60db's default (50).
similarityinteger, ≥ 0, ≤ 100- 60db: how closely the voice matches its source, 0 (loose) to 100 (exact). Left out, 60db's default (75).
normalizeboolean | null- Maya Open-Source, Vaakini: speak numbers, currency, dates, times, OTPs, phone numbers, URLs and emails as words in the request's language. Left out, the provider's default (on).
top_kinteger, ≥ 1, ≤ 2048- Maya Open-Source, Vaakini: sample from the k likeliest codes. Left out, the provider's default.
top_pnumber, ≤ 1- Maya Open-Source, Vaakini: nucleus sampling. Left out, the provider's default.
repetition_penaltynumber, ≥ 0, ≤ 5- Maya Open-Source, Vaakini: penalty on recently repeated codes. Left out, the provider's default.
seedinteger, ≥ 0, ≤ 9223372036854776000- Maya Open-Source: the sampling seed. The same seed repeats a take only when Maya runs the request alone. Left out, a seed of Maya's.
{ "input": "नमस्ते, मैं सिटी हॉस्पिटल से प्रिया बोल रही हूँ।", "language": "hi-IN", "model": "sarvam/bulbul:v3", "response_format": "mp3", "voice": "shubh"}Responses
200The audio, streamed.
400Invalid request, or the provider refused it
401Missing or invalid API key
402The org is out of credit (`insufficient_credits`): buy credit in the dashboard
429Your provider quota is exhausted
502The provider failed
504The provider timed out
Provider drop-ins#
Mirrors of each provider's own endpoints. The WebSockets aren't in OpenAPI; each provider's page lists them.
Vaakini drop-in
post/vaakini/v1/audio/speechVaakini: create speech
POST https://api.media.ttscacherouter.dev/vaakini/v1/audio/speech
Mirrors POST https://api.vaakini.com/v1/audio/speech ([Vaakini's reference](https://docs.vaakini.com/reference)): the same body, response and errors. Set the Vaakini SDK's base_url to https://api.media.ttscacherouter.dev/vaakini and its API key to your tcr_ key (Authorization: Bearer); your stored Vaakini key is used. The router splits input into sentences, serves each one your org has synthesized before from the cache and sends the rest to Vaakini with your settings, one sentence at a time, each its own cache entry (shared with /v1/stream and /v1/audio/speech for the same request). The audio streams back in order as one stream of response_format (one WAV header for wav). A body the router doesn't read as a request Vaakini accepts goes to Vaakini verbatim, uncached. An org out of credit is refused with HTTP 402 in the provider's error shape, code insufficient_credits.
Request body
Responses
200Successful Response
get/vaakini/v1/voicesVaakini: list voices
GET https://api.media.ttscacherouter.dev/vaakini/v1/voices
Mirrors GET https://api.vaakini.com/v1/voices ([Vaakini's reference](https://docs.vaakini.com/reference)): the same query, response and errors. Send your tcr_ key as the API key (Authorization: Bearer); the request goes to Vaakini verbatim with your stored Vaakini key. Not cached. An org out of credit is refused with HTTP 402 in the provider's error shape, code insufficient_credits.
Responses
200Successful Response
get/vaakini/v1/modelsVaakini: list models
GET https://api.media.ttscacherouter.dev/vaakini/v1/models
Mirrors GET https://api.vaakini.com/v1/models ([Vaakini's reference](https://docs.vaakini.com/reference)): the same query, response and errors. Send your tcr_ key as the API key (Authorization: Bearer); the request goes to Vaakini verbatim with your stored Vaakini key. Not cached. An org out of credit is refused with HTTP 402 in the provider's error shape, code insufficient_credits.
Responses
200Successful Response
get/vaakini/v1/custom-voicesVaakini: list custom voices
GET https://api.media.ttscacherouter.dev/vaakini/v1/custom-voices
Mirrors GET https://api.vaakini.com/v1/custom-voices ([Vaakini's reference](https://docs.vaakini.com/reference)): the same query, response and errors. Send your tcr_ key as the API key (Authorization: Bearer); the request goes to Vaakini verbatim with your stored Vaakini key. Not cached. The voices are your Vaakini org's, the one your stored Vaakini key belongs to. An org out of credit is refused with HTTP 402 in the provider's error shape, code insufficient_credits.
Responses
200Successful Response
post/vaakini/v1/custom-voicesVaakini: create a custom voice
POST https://api.media.ttscacherouter.dev/vaakini/v1/custom-voices
Mirrors POST https://api.vaakini.com/v1/custom-voices ([Vaakini's reference](https://docs.vaakini.com/reference)): the same multipart body, response and errors. Send your tcr_ key as the API key (Authorization: Bearer); the request goes to Vaakini verbatim with your stored Vaakini key. Not cached. The voice is created in your Vaakini org and can be spoken through the router at once, with its cv_… id as voice. An org out of credit is refused with HTTP 402 in the provider's error shape, code insufficient_credits.
Responses
200Successful Response
get/vaakini/v1/custom-voices/{voice_id}Vaakini: get a custom voice
GET https://api.media.ttscacherouter.dev/vaakini/v1/custom-voices/{voice_id}
Mirrors GET https://api.vaakini.com/v1/custom-voices/{voice_id} ([Vaakini's reference](https://docs.vaakini.com/reference)): the same path, response and errors. Send your tcr_ key as the API key (Authorization: Bearer); the request goes to Vaakini verbatim with your stored Vaakini key. Not cached. An org out of credit is refused with HTTP 402 in the provider's error shape, code insufficient_credits.
Parameters
voice_idpath, stringRequired
Responses
200Successful Response
patch/vaakini/v1/custom-voices/{voice_id}Vaakini: update a custom voice
PATCH https://api.media.ttscacherouter.dev/vaakini/v1/custom-voices/{voice_id}
Mirrors PATCH https://api.vaakini.com/v1/custom-voices/{voice_id} ([Vaakini's reference](https://docs.vaakini.com/reference)): the same body, response and errors. Send your tcr_ key as the API key (Authorization: Bearer); the request goes to Vaakini verbatim with your stored Vaakini key. Not cached. An org out of credit is refused with HTTP 402 in the provider's error shape, code insufficient_credits.
Parameters
voice_idpath, stringRequired
Request body
Responses
200Successful Response
delete/vaakini/v1/custom-voices/{voice_id}Vaakini: delete a custom voice
DELETE https://api.media.ttscacherouter.dev/vaakini/v1/custom-voices/{voice_id}
Mirrors DELETE https://api.vaakini.com/v1/custom-voices/{voice_id} ([Vaakini's reference](https://docs.vaakini.com/reference)): the same path, response and errors. Send your tcr_ key as the API key (Authorization: Bearer); the request goes to Vaakini verbatim with your stored Vaakini key. Not cached. An org out of credit is refused with HTTP 402 in the provider's error shape, code insufficient_credits.
Parameters
voice_idpath, stringRequired
Responses
200Successful Response
put/vaakini/v1/custom-voices/{voice_id}/recordingVaakini: replace a custom voice's recording
PUT https://api.media.ttscacherouter.dev/vaakini/v1/custom-voices/{voice_id}/recording
Mirrors PUT https://api.vaakini.com/v1/custom-voices/{voice_id}/recording ([Vaakini's reference](https://docs.vaakini.com/reference)): the same multipart body, response and errors. Send your tcr_ key as the API key (Authorization: Bearer); the request goes to Vaakini verbatim with your stored Vaakini key. Not cached. Sentences spoken with the voice afterwards are synthesized afresh: the cache never serves the old recording's audio for the new one. An org out of credit is refused with HTTP 402 in the provider's error shape, code insufficient_credits.
Parameters
voice_idpath, stringRequired
Responses
200Successful Response
Sarvam drop-in
post/sarvam/text-to-speech/streamSarvam: text to speech (HTTP stream)
POST https://api.media.ttscacherouter.dev/sarvam/text-to-speech/stream
Mirrors POST https://api.sarvam.ai/text-to-speech/stream ([Sarvam's reference](https://docs.sarvam.ai/api-reference/text-to-speech/convert-stream)): the same body, response and errors. Send your tcr_ key in api-subscription-key; your stored Sarvam key is used. The text is split into sentences, each its own request to Sarvam's HTTP stream with your settings and its own cache entry, and their audio streams back in order as one stream (one WAV header for wav). In flac or opus, whose takes don't join into one stream, the whole text is one request and one cache entry. A body the router doesn't read as a request Sarvam accepts goes to Sarvam verbatim, uncached. An org out of credit is refused with HTTP 402 in the provider's error shape, code insufficient_credits.
Request body
Responses
200Successful Response
post/sarvam/text-to-speechSarvam: text to speech (REST)
POST https://api.media.ttscacherouter.dev/sarvam/text-to-speech
Mirrors POST https://api.sarvam.ai/text-to-speech ([Sarvam's reference](https://docs.sarvam.ai/api-reference/text-to-speech/convert)): the same body, response and errors. Send your tcr_ key in api-subscription-key; your stored Sarvam key is used. The text is split into sentences, each its own request to Sarvam's REST API with your settings and its own cache entry (shared with /v1/audio/speech at 32000, 44100 and 48000 Hz); once every sentence is ready, the reply is {"request_id": null, "audios": [...]} with one take. In flac or opus, whose takes don't join into one stream, the whole text is one request and one cache entry. A body the router doesn't read as a request Sarvam accepts goes to Sarvam verbatim, uncached. An org out of credit is refused with HTTP 402 in the provider's error shape, code insufficient_credits.
Request body
Responses
200Successful Response
Raya drop-in
post/raya/v1/text-to-speechRaya: text to speech (REST)
POST https://api.media.ttscacherouter.dev/raya/v1/text-to-speech
Mirrors POST https://hub.getraya.app/v1/text-to-speech ([Raya's reference](https://docs.litwizlabs.com/api-reference/text-to-speech/text-to-speech)): the same body, response and errors. Send your tcr_ key in X-API-Key. The router splits text into sentences, serves each one your org has synthesized before from the cache and sends the rest to Raya with your stored Raya key, one sentence at a time, then answers with one file in the requested codec with Raya's Content-Type and Content-Disposition. A body that isn't a request Raya accepts goes to Raya as sent, uncached. An org out of credit is refused with HTTP 402 in the provider's error shape, code insufficient_credits.
Request body
Responses
200Successful Response
post/raya/v1/text-to-speech/streamRaya: text to speech (SSE stream)
POST https://api.media.ttscacherouter.dev/raya/v1/text-to-speech/stream
Mirrors POST https://hub.getraya.app/v1/text-to-speech/stream ([Raya's reference](https://docs.litwizlabs.com/api-reference/text-to-speech/text-to-speech-stream)): the same body, response and errors. Send your tcr_ key in X-API-Key. The router splits text into sentences, serves each one your org has synthesized before from the cache and sends the rest to Raya with your stored Raya key, streaming each sentence's samples as chunk events (without step_time) as it is ready, then done; a sentence that fails after the first ends the stream with an error event. A body that isn't a request Raya accepts goes to Raya as sent, uncached. An org out of credit is refused with HTTP 402 in the provider's error shape, code insufficient_credits.
Request body
Responses
200Successful Response
get/raya/v1/voicesRaya: list voices
GET https://api.media.ttscacherouter.dev/raya/v1/voices
Mirrors GET https://hub.getraya.app/v1/voices ([Raya's reference](https://docs.litwizlabs.com/api-reference/voices/list-voices)): the same query, response and errors. Send your tcr_ key in X-API-Key; the request goes to Raya verbatim with your stored Raya key. Not cached. An org out of credit is refused with HTTP 402 in the provider's error shape, code insufficient_credits.
Responses
200Successful Response
ElevenLabs drop-in
post/elevenlabs/v1/text-to-speech/{voice_id}ElevenLabs: text to speech
POST https://api.media.ttscacherouter.dev/elevenlabs/v1/text-to-speech/{voice_id}
Mirrors POST https://api.elevenlabs.io/v1/text-to-speech/{voice_id} ([ElevenLabs' reference](https://elevenlabs.io/docs/api-reference/text-to-speech/convert)): the same query, body, response and errors. Send your tcr_ key in xi-api-key; your stored ElevenLabs key is used. The router splits text into sentences, serves each one your org has synthesized before from the cache and sends the rest to this endpoint with the query and body's settings, one sentence at a time, each its own cache entry: a field left out or null counts as ElevenLabs' default (output_format mp3_44100_128, enable_logging true, model_id eleven_multilingual_v2, apply_text_normalization auto, apply_language_text_normalization false), previous_text goes with the first sentence and next_text with the last. A body with pronunciation_dictionary_locators is cached by the dictionaries' ids and versions: a dictionary edited in place reaches entries cached before only when they expire. In opus, with audio_effects or with an audio tag such as [whispers], the whole text is one request and one cache entry. A body the router doesn't read as one ElevenLabs accepts (a field or query parameter ElevenLabs' reference doesn't list, a value of the wrong type, a codec ElevenLabs doesn't make), or one with previous_request_ids or next_request_ids, goes to ElevenLabs verbatim, uncached, with ElevenLabs' own answer and headers. A split response carries only Content-Type: no one ElevenLabs request produced it, so no request-id or character-cost. The answer comes once every sentence is ready, as one file of the format: raw samples one after another, MP3 under the first sentence's ID3 tag and Info frame, WAV under one header. An org out of credit is refused with HTTP 402 in the provider's error shape, code insufficient_credits.
Parameters
voice_idpath, stringRequired
Request body
Responses
200Successful Response
post/elevenlabs/v1/text-to-speech/{voice_id}/streamElevenLabs: text to speech (stream)
POST https://api.media.ttscacherouter.dev/elevenlabs/v1/text-to-speech/{voice_id}/stream
Mirrors POST https://api.elevenlabs.io/v1/text-to-speech/{voice_id}/stream ([ElevenLabs' reference](https://elevenlabs.io/docs/api-reference/text-to-speech/stream)): the same query, body, response and errors. Send your tcr_ key in xi-api-key; your stored ElevenLabs key is used. The router splits text into sentences, serves each one your org has synthesized before from the cache and sends the rest to this endpoint with the query and body's settings, one sentence at a time, each its own cache entry: a field left out or null counts as ElevenLabs' default (output_format mp3_44100_128, enable_logging true, model_id eleven_multilingual_v2, apply_text_normalization auto, apply_language_text_normalization false), previous_text goes with the first sentence and next_text with the last. A body with pronunciation_dictionary_locators is cached by the dictionaries' ids and versions: a dictionary edited in place reaches entries cached before only when they expire. In opus, with audio_effects or with an audio tag such as [whispers], the whole text is one request and one cache entry. A body the router doesn't read as one ElevenLabs accepts (a field or query parameter ElevenLabs' reference doesn't list, a value of the wrong type, a codec ElevenLabs doesn't make), or one with previous_request_ids or next_request_ids, goes to ElevenLabs verbatim, uncached, with ElevenLabs' own answer and headers. A split response carries only Content-Type: no one ElevenLabs request produced it, so no request-id or character-cost. The sentences' audio streams back as each is ready, as one stream of the format (one MP3 tag); a later sentence that fails breaks the body off. ElevenLabs makes no WAV on a stream, and its refusal comes back as it sent it. An org out of credit is refused with HTTP 402 in the provider's error shape, code insufficient_credits.
Parameters
voice_idpath, stringRequired
Request body
Responses
200Successful Response
post/elevenlabs/v1/text-to-speech/{voice_id}/with-timestampsElevenLabs: text to speech with timestamps
POST https://api.media.ttscacherouter.dev/elevenlabs/v1/text-to-speech/{voice_id}/with-timestamps
Mirrors POST https://api.elevenlabs.io/v1/text-to-speech/{voice_id}/with-timestamps ([ElevenLabs' reference](https://elevenlabs.io/docs/api-reference/text-to-speech/convert-with-timestamps)): the same query, body, response and errors. Send your tcr_ key in xi-api-key; your stored ElevenLabs key is used. The router splits text into sentences, serves each one your org has synthesized before from the cache and sends the rest to this endpoint with the query and body's settings, one sentence at a time, each its own cache entry: a field left out or null counts as ElevenLabs' default (output_format mp3_44100_128, enable_logging true, model_id eleven_multilingual_v2, apply_text_normalization auto, apply_language_text_normalization false), previous_text goes with the first sentence and next_text with the last. A body with pronunciation_dictionary_locators is cached by the dictionaries' ids and versions: a dictionary edited in place reaches entries cached before only when they expire. In opus, with audio_effects or with an audio tag such as [whispers], the whole text is one request and one cache entry. A body the router doesn't read as one ElevenLabs accepts (a field or query parameter ElevenLabs' reference doesn't list, a value of the wrong type, a codec ElevenLabs doesn't make), or one with previous_request_ids or next_request_ids, goes to ElevenLabs verbatim, uncached, with ElevenLabs' own answer and headers. A split response carries only Content-Type: no one ElevenLabs request produced it, so no request-id or character-cost. The answer comes once every sentence is ready, as one object: the sentences' audio as one file of the format, and their character timings one after another, each sentence's moved on by the audio before it, with a space between sentences where the text has one. An org out of credit is refused with HTTP 402 in the provider's error shape, code insufficient_credits.
Parameters
voice_idpath, stringRequired
Request body
Responses
200Successful Response
post/elevenlabs/v1/text-to-speech/{voice_id}/stream/with-timestampsElevenLabs: text to speech with timestamps (stream)
POST https://api.media.ttscacherouter.dev/elevenlabs/v1/text-to-speech/{voice_id}/stream/with-timestamps
Mirrors POST https://api.elevenlabs.io/v1/text-to-speech/{voice_id}/stream/with-timestamps ([ElevenLabs' reference](https://elevenlabs.io/docs/api-reference/text-to-speech/stream-with-timestamps)): the same query, body, response and errors. Send your tcr_ key in xi-api-key; your stored ElevenLabs key is used. The router splits text into sentences, serves each one your org has synthesized before from the cache and sends the rest to this endpoint with the query and body's settings, one sentence at a time, each its own cache entry: a field left out or null counts as ElevenLabs' default (output_format mp3_44100_128, enable_logging true, model_id eleven_multilingual_v2, apply_text_normalization auto, apply_language_text_normalization false), previous_text goes with the first sentence and next_text with the last. A body with pronunciation_dictionary_locators is cached by the dictionaries' ids and versions: a dictionary edited in place reaches entries cached before only when they expire. In opus, with audio_effects or with an audio tag such as [whispers], the whole text is one request and one cache entry. A body the router doesn't read as one ElevenLabs accepts (a field or query parameter ElevenLabs' reference doesn't list, a value of the wrong type, a codec ElevenLabs doesn't make), or one with previous_request_ids or next_request_ids, goes to ElevenLabs verbatim, uncached, with ElevenLabs' own answer and headers. A split response carries only Content-Type: no one ElevenLabs request produced it, so no request-id or character-cost. ElevenLabs' objects stream back sentence by sentence, each sentence's character timings moved on by the audio before it (a space before its characters where the text has one); a later sentence that fails breaks the body off. An org out of credit is refused with HTTP 402 in the provider's error shape, code insufficient_credits.
Parameters
voice_idpath, stringRequired
Request body
Responses
200Successful Response
post/elevenlabs/v1/text-to-dialogue/streamElevenLabs: text to dialogue (stream)
POST https://api.media.ttscacherouter.dev/elevenlabs/v1/text-to-dialogue/stream
Mirrors POST https://api.elevenlabs.io/v1/text-to-dialogue/stream ([ElevenLabs' reference](https://elevenlabs.io/docs/api-reference/text-to-dialogue/stream)): the same query, body, response and errors. Send your tcr_ key in xi-api-key; your stored ElevenLabs key is used. With one input, the router splits its text into sentences, serves each one your org has synthesized before from the cache and sends the rest to this endpoint as one input each, with the query and body's settings, one sentence at a time, each its own cache entry; a field left out or null counts as ElevenLabs' default (output_format mp3_44100_128, enable_logging true, model_id eleven_v3, apply_text_normalization auto), previous_text goes with the first sentence and future_text with the last; the audio streams back as each sentence is ready. Several inputs (a dialogue's turns are made together), opus, audio_effects or an audio tag such as [laughs] make the request one request and one cache entry. A body the router doesn't read as one ElevenLabs accepts, or one with previous_request_ids or next_request_ids, goes to ElevenLabs verbatim, uncached, with ElevenLabs' own answer and headers. A split response carries only Content-Type. An org out of credit is refused with HTTP 402 in the provider's error shape, code insufficient_credits.
Request body
Responses
200Successful Response
get/elevenlabs/v1/voicesElevenLabs: list voices
GET https://api.media.ttscacherouter.dev/elevenlabs/v1/voices
Mirrors GET https://api.elevenlabs.io/v1/voices ([ElevenLabs' reference](https://elevenlabs.io/docs/api-reference/voices/search)): the same query, response and errors. Send your tcr_ key in xi-api-key; the request goes to ElevenLabs verbatim with your stored ElevenLabs key. Not cached. An org out of credit is refused with HTTP 402 in the provider's error shape, code insufficient_credits.
Responses
200Successful Response
get/elevenlabs/v2/voicesElevenLabs: list voices (v2)
GET https://api.media.ttscacherouter.dev/elevenlabs/v2/voices
Mirrors GET https://api.elevenlabs.io/v2/voices ([ElevenLabs' reference](https://elevenlabs.io/docs/api-reference/voices/search)): the same query (page_size, next_page_token, search, category, voice_type, …), response and errors. Send your tcr_ key in xi-api-key; the request goes to ElevenLabs verbatim (path, query and body) with your stored ElevenLabs key. Not cached. An org out of credit is refused with HTTP 402 in the provider's error shape, code insufficient_credits.
Responses
200The provider's response
get/elevenlabs/v1/voices/{voice_id}/settingsElevenLabs: get a voice's settings
GET https://api.media.ttscacherouter.dev/elevenlabs/v1/voices/{voice_id}/settings
Mirrors GET https://api.elevenlabs.io/v1/voices/{voice_id}/settings ([ElevenLabs' reference](https://elevenlabs.io/docs/api-reference/voices/settings/get)): the voice's stored stability, similarity_boost, style, speed and use_speaker_boost, which a request without voice_settings uses. ElevenLabs answers an unknown voice with 400 voice_not_found. Send your tcr_ key in xi-api-key; the request goes to ElevenLabs verbatim (path, query and body) with your stored ElevenLabs key. Not cached. An org out of credit is refused with HTTP 402 in the provider's error shape, code insufficient_credits.
Parameters
voice_idpath, stringRequired
Responses
200The provider's response
get/elevenlabs/v1/shared-voicesElevenLabs: list library voices
GET https://api.media.ttscacherouter.dev/elevenlabs/v1/shared-voices
Mirrors GET https://api.elevenlabs.io/v1/shared-voices ([ElevenLabs' reference](https://elevenlabs.io/docs/api-reference/voices/voice-library/get-shared)): the voice library, with the same query (page, page_size, search, language, gender, accent, sort, …), response and errors. Add one to your ElevenLabs account with POST /elevenlabs/v1/voices/add/{public_user_id}/{voice_id}. Send your tcr_ key in xi-api-key; the request goes to ElevenLabs verbatim (path, query and body) with your stored ElevenLabs key. Not cached. An org out of credit is refused with HTTP 402 in the provider's error shape, code insufficient_credits.
Responses
200The provider's response
post/elevenlabs/v1/voices/add/{public_user_id}/{voice_id}ElevenLabs: add a library voice
POST https://api.media.ttscacherouter.dev/elevenlabs/v1/voices/add/{public_user_id}/{voice_id}
Mirrors POST https://api.elevenlabs.io/v1/voices/add/{public_user_id}/{voice_id} ([ElevenLabs' reference](https://elevenlabs.io/docs/api-reference/voices/voice-library/share)): adds a voice from the library (GET /elevenlabs/v1/shared-voices: its public_owner_id and voice_id) to your ElevenLabs account, with the same body (new_name, required; bookmarked), response ({"voice_id"}) and errors. It then appears in GET /v1/voices as library. Send your tcr_ key in xi-api-key; the request goes to ElevenLabs verbatim (path, query and body) with your stored ElevenLabs key. Not cached. An org out of credit is refused with HTTP 402 in the provider's error shape, code insufficient_credits.
Parameters
public_user_idpath, stringRequiredvoice_idpath, stringRequired
Request body
new_namestringRequiredbookmarkedboolean
Responses
200The provider's response
OpenAI drop-in
post/openai/v1/audio/speechOpenAI: create speech
POST https://api.media.ttscacherouter.dev/openai/v1/audio/speech
Mirrors POST https://api.openai.com/v1/audio/speech ([OpenAI's reference](https://developers.openai.com/api/reference/resources/audio/subresources/speech/methods/create)): the same body, response and errors. Set the OpenAI SDK's (or LiveKit's OpenAI plugin's) base_url to https://api.media.ttscacherouter.dev/openai/v1 and its API key to your tcr_ key (Authorization: Bearer); your stored OpenAI key is used. The router splits input into sentences, serves each one your org has synthesized before from the cache and sends the rest to OpenAI with your settings, one sentence at a time, each its own cache entry (shared with /v1/stream and /v1/audio/speech for the same request). The audio streams back in order as one stream of response_format (one WAV header for wav), or with stream_format: "sse" as each sentence's speech.audio.delta events, then one speech.audio.done whose usage sums the tokens OpenAI spent on this request (none for a sentence from the cache), then [DONE]. In opus or flac, whose takes don't join into one stream, the whole input is one request and one cache entry. A body the router doesn't read as a request OpenAI accepts goes to OpenAI verbatim, uncached. An org out of credit is refused with HTTP 402 in the provider's error shape, code insufficient_credits.
Request body
inputstringRequired- The text to speak.
modelstringRequiredgpt-4o-mini-tts,gpt-4o-mini-tts-2025-12-15,tts-1ortts-1-hd.voicestringRequired- An OpenAI voice, e.g.
ash. instructionsstring- How to speak;
gpt-4o-mini-ttsonly. response_format"mp3" | "opus" | "aac" | "flac" | "wav" | "pcm"speednumber, ≥ 0.25, ≤ 4stream_format"audio" | "sse"ssestreamsspeech.audio.deltaevents;tts-1andtts-1-hdanswer with the audio instead.
Responses
200The audio, or with `stream_format: "sse"` an event stream.
400OpenAI refused the request
401Missing or invalid API key, or no OpenAI key stored for the org (`invalid_api_key`)
402The org is out of credit (`insufficient_credits`)
429Your OpenAI quota is exhausted
502OpenAI failed
504OpenAI timed out
Deepgram drop-in
post/deepgram/v1/speakDeepgram: Aura text to speech (REST)
POST https://api.media.ttscacherouter.dev/deepgram/v1/speak
Mirrors POST https://api.deepgram.com/v1/speak ([Deepgram's reference](https://developers.deepgram.com/reference/text-to-speech/speak-request)): the same query, body, response and errors. Set the Deepgram SDK's base URL (or LiveKit's Deepgram plugin's base_url) to https://api.media.ttscacherouter.dev/deepgram/v1/speak and its API key to your tcr_ key (Authorization: Token); your stored Deepgram key is used. The router splits text into sentences, serves each one your org has synthesized before from the cache and sends the rest to Deepgram with your query, one sentence at a time, each its own cache entry (Aura's shared with /v1/stream and /v1/audio/speech for the same request: raw audio or MP3); a parameter left out counts as Deepgram's default. The audio streams back in order as one stream of the query's encoding (one WAV header for a wav container), with only Content-Type: no one Deepgram request produced it, so no dg-* headers. In opus, flac or (Flux) aac, whose takes don't join into one stream, or with inline pronunciation or pause controls, the whole text is one request and one cache entry. A request the router doesn't read as one Deepgram accepts (a parameter Deepgram's reference doesn't list, a repeated parameter, a callback, a body with fields besides text, text over 2,000 characters, Aura's aac) goes to Deepgram verbatim, uncached, with Deepgram's own headers. An org out of credit is refused with HTTP 402 in Deepgram's error shape, err_code insufficient_credits. The WebSocket at the same path is a drop-in for Deepgram's streaming API; see the docs.
Parameters
modelquery, string- Deepgram's model id with its voice, e.g.
aura-2-thalia-en(/v1/speak) orflux-alexis-en(/v2/speak). encodingquery, "linear16" | "mulaw" | "alaw" | "mp3" | "opus" | "flac" | "aac"- Deepgram's default is
mp3. containerquery, "none" | "wav" | "ogg"sample_ratequery, integerbit_ratequery, integerspeedquery, numbermip_opt_outquery, boolean
Request body
textstringRequired- The text to speak.
Responses
200The audio, in the encoding and container the query asks for, streamed sentence by sentence.
400Deepgram refused the request
401A wrong or missing `tcr_` key (`INVALID_AUTH`), or no Deepgram key stored for the org
402The org is out of credit (`insufficient_credits`)
403Your Deepgram project has no access to the model
429Your Deepgram quota is exhausted
502Deepgram failed
504Deepgram timed out
post/deepgram/v2/speakDeepgram: Flux text to speech (batch) (REST)
POST https://api.media.ttscacherouter.dev/deepgram/v2/speak
Mirrors POST https://api.deepgram.com/v2/speak ([Deepgram's reference](https://developers.deepgram.com/reference/speak/v-2/audio/generate)): the same query, body, response and errors. Set the Deepgram SDK's base URL (or LiveKit's Deepgram plugin's base_url) to https://api.media.ttscacherouter.dev/deepgram/v2/speak and its API key to your tcr_ key (Authorization: Token); your stored Deepgram key is used. The router splits text into sentences, serves each one your org has synthesized before from the cache and sends the rest to Deepgram with your query, one sentence at a time, each its own cache entry; a parameter left out counts as Deepgram's default. The audio streams back in order as one stream of the query's encoding (one WAV header for a wav container), with only Content-Type: no one Deepgram request produced it, so no dg-* headers. In opus, flac or (Flux) aac, whose takes don't join into one stream, or with inline pronunciation or pause controls, the whole text is one request and one cache entry. A request the router doesn't read as one Deepgram accepts (a parameter Deepgram's reference doesn't list, a repeated parameter, a callback, a body with fields besides text, text over 2,000 characters, Aura's aac) goes to Deepgram verbatim, uncached, with Deepgram's own headers. An org out of credit is refused with HTTP 402 in Deepgram's error shape, err_code insufficient_credits. The WebSocket at the same path is a drop-in for Deepgram's streaming API; see the docs.
Parameters
modelquery, string- Deepgram's model id with its voice, e.g.
aura-2-thalia-en(/v1/speak) orflux-alexis-en(/v2/speak). encodingquery, "linear16" | "mulaw" | "alaw" | "mp3" | "opus" | "flac" | "aac"- Deepgram's default is
mp3. containerquery, "none" | "wav" | "ogg"sample_ratequery, integerbit_ratequery, integerspeedquery, numbermip_opt_outquery, boolean
Request body
textstringRequired- The text to speak.
Responses
200The audio, in the encoding and container the query asks for, streamed sentence by sentence.
400Deepgram refused the request
401A wrong or missing `tcr_` key (`INVALID_AUTH`), or no Deepgram key stored for the org
402The org is out of credit (`insufficient_credits`)
403Your Deepgram project has no access to the model
429Your Deepgram quota is exhausted
502Deepgram failed
504Deepgram timed out
get/deepgram/v1/modelsDeepgram: list models (Aura)
GET https://api.media.ttscacherouter.dev/deepgram/v1/models
Mirrors GET https://api.deepgram.com/v1/models ([Deepgram's reference](https://developers.deepgram.com/reference/manage/models/list)): its tts lists the Aura and Aura-2 voices (canonical_name aura-2-thalia-en is the router's model aura-2 and voice thalia-en). Send your tcr_ key as Authorization: Token (or Bearer); the request goes to Deepgram with your query and your stored Deepgram key. Not cached.
Responses
200The provider's response
get/deepgram/v2/modelsDeepgram: list models (Flux)
GET https://api.media.ttscacherouter.dev/deepgram/v2/models
Mirrors GET https://api.deepgram.com/v2/models, which Deepgram doesn't document: its tts lists the Flux voices (flux-alexis-en is the router's model flux and voice alexis-en). Send your tcr_ key as Authorization: Token (or Bearer); the request goes to Deepgram with your query and your stored Deepgram key. Not cached.
Responses
200The provider's response
xAI drop-in
post/xai/v1/ttsxAI: text to speech (REST)
POST https://api.media.ttscacherouter.dev/xai/v1/tts
Mirrors POST https://api.x.ai/v1/tts ([xAI's reference](https://docs.x.ai/developers/rest-api-reference/inference/voice)): the same body, response and errors. Send your tcr_ key as Authorization: Bearer; your stored xAI key is used. The router splits text into sentences, serves each one your org has synthesized before from the cache and sends the rest to xAI with the body's settings, one sentence at a time, each its own cache entry; a field left out counts as xAI's default. MP3, PCM, μ-law and A-law stream back in order as one stream of the codec, as xAI streams them; WAV, which xAI answers whole, comes once every sentence is ready, as one file with one header. The response carries only Content-Type: no one xAI request produced it, so no x-trace-id. In opus (an Ogg stream per request), with with_timestamps, or with a wrapping speech tag such as <whisper>, the whole text is one request and one cache entry. A body the router doesn't read as one xAI accepts (a field xAI's reference doesn't list, a value of the wrong type, a codec, sample rate or MP3 bit rate xAI doesn't make, text over 60,000 characters) goes to xAI verbatim, uncached, with xAI's own answer and x-trace-id. An org out of credit is refused with HTTP 402 in xAI's error shape, code insufficient_credits. The WebSocket at the same path is a drop-in for xAI's streaming API; see the docs.
Request body
textstringRequired- The text to speak.
voice_idstring- An xAI voice, e.g.
eve(xAI's default) orara, or a custom voice id. languagestringRequired- A BCP-47 code, e.g.
en, orauto. output_formatobject- Left out, MP3 at 24 kHz and 128 kbps.
speednumber, ≥ 0.7, ≤ 1.5optimize_streaming_latency0 | 1 | 2text_normalizationbooleanwith_timestampsboolean- Answer JSON with base64 audio and character timings.
replaceobject- Pronunciation replacements, phrase to spoken substitution.
Responses
200The audio in the requested codec, or with `with_timestamps` a JSON envelope.
400xAI refused the request, a wrong `tcr_` key (`Incorrect API key provided.`), or no xAI key stored for the org
401No API key
402The org is out of credit (`insufficient_credits`)
404Unknown voice
429Your xAI quota is exhausted
get/xai/v1/tts/voicesxAI: list voices
GET https://api.media.ttscacherouter.dev/xai/v1/tts/voices
Mirrors GET https://api.x.ai/v1/tts/voices ([xAI's reference](https://docs.x.ai/developers/rest-api-reference/inference/voice)): the same response and errors. Send your tcr_ key as Authorization: Bearer; the request goes to xAI with your stored xAI key. Not cached. An org out of credit is refused with HTTP 402 in xAI's error shape, code insufficient_credits.
Responses
200xAI's response
400A wrong `tcr_` key, or no xAI key stored for the org
401No API key
402The org is out of credit (`insufficient_credits`)
get/xai/v1/tts/voices/{voice_id}xAI: get a voice
GET https://api.media.ttscacherouter.dev/xai/v1/tts/voices/{voice_id}
Mirrors GET https://api.x.ai/v1/tts/voices/{voice_id} ([xAI's reference](https://docs.x.ai/developers/rest-api-reference/inference/voice)): the same response and errors. Send your tcr_ key as Authorization: Bearer; the request goes to xAI with your stored xAI key. Not cached.
Parameters
voice_idpath, stringRequired
Responses
200xAI's response
400A wrong `tcr_` key, or no xAI key stored for the org
401No API key
402The org is out of credit (`insufficient_credits`)
Soniox drop-in
post/soniox/ttsSoniox: generate speech (REST)
POST https://api.media.ttscacherouter.dev/soniox/tts
Mirrors POST https://tts-rt.soniox.com/tts ([Soniox's reference](https://soniox.com/docs/api-reference/tts/generate_tts)): the same body, response and errors. Send your tcr_ key as Authorization: Bearer; your stored Soniox key is used. The router splits text into sentences, serves each one your org has synthesized before from the cache and sends the rest to Soniox with the body's settings, one sentence at a time, each its own cache entry; a field left out counts as Soniox's default. Every format streams back in order as Soniox streams it, with the Content-Type Soniox answers that audio_format with: raw samples and MP3 frames one after another, under one WAV header for wav and one ID3 tag for mp3. The response carries only Content-Type. In flac, opus and aac, whose every Soniox response is a file of its own, the whole text is one request and one cache entry. A body the router doesn't read as one Soniox accepts (a missing required field, a field Soniox's reference doesn't list, a value of the wrong type, an unknown audio_format, text over 5,000 bytes) goes to Soniox verbatim, uncached, with Soniox's own answer. An org out of credit is refused with HTTP 402 in Soniox's error shape, error_type insufficient_credits. The real-time WebSocket, /soniox/tts-websocket, is a drop-in for Soniox's; see the docs.
Request body
modelstringRequired- A Soniox model, e.g.
tts-rt-v2. languagestringRequired- The language the text is read in, e.g.
en. voicestringRequired- A Soniox voice, e.g.
Adrian, or a cloned voice's id. audio_format"pcm_s16le" | "pcm_f32le" | "pcm_mulaw" | "pcm_alaw" | "wav" | "mp3" | "aac" | "opus" | "flac"RequiredtextstringRequired- The text to speak.
sample_rateinteger | null- Left out, the format's default (24000; 8000 for
pcm_mulawandpcm_alaw). bitrateinteger | nullmp3,aacandopusonly, in bits per second. Left out, the format's default (128000; 64000 foropus).speednumber | null, ≥ 0.7, ≤ 1.3reduce_silenceboolean | nullclient_reference_idstring | null, max length 256
Responses
200The audio in the requested format, chunked.
400Soniox refused the request (e.g. an unknown voice or language)
401A missing or wrong `tcr_` key, or no Soniox key stored for the org (`unauthenticated`)
402The org is out of credit (`insufficient_credits`), or your Soniox balance is exhausted
429Your Soniox rate or concurrency limit
get/soniox/v1/voicesSoniox: list cloned voices
GET https://api.media.ttscacherouter.dev/soniox/v1/voices
Mirrors GET https://api.soniox.com/v1/voices ([Soniox's reference](https://soniox.com/docs/api-reference/tts/voices/get_voices)): your Soniox project's cloned voices, with the same query (limit, cursor), response and errors. Send your tcr_ key as Authorization: Bearer; the request goes to Soniox (api.soniox.com) with your query and your stored Soniox key. Not cached.
Responses
200The provider's response
get/soniox/v1/tts-modelsSoniox: list models
GET https://api.media.ttscacherouter.dev/soniox/v1/tts-models
Mirrors GET https://api.soniox.com/v1/tts-models ([Soniox's reference](https://soniox.com/docs/api-reference/tts/get_tts_models)): the text-to-speech models with their languages and built-in voices. Send your tcr_ key as Authorization: Bearer; the request goes to Soniox (api.soniox.com) with your query and your stored Soniox key. Not cached.
Responses
200The provider's response
Smallest AI drop-in
post/smallestai/waves/v1/ttsSmallest AI: synthesize speech (REST)
POST https://api.media.ttscacherouter.dev/smallestai/waves/v1/tts
Mirrors POST https://api.smallest.ai/waves/v1/tts ([Smallest AI's reference](https://docs.smallest.ai/api-reference/models/text-to-speech/synthesize-speech)): the same body, response and errors. Send your tcr_ key as Authorization: Bearer; your stored Smallest AI key is used. The router splits text into sentences, serves each one your org has synthesized before from the cache and sends the rest to Smallest AI with the body's settings, one sentence at a time, each its own cache entry; a sample_rate, speed, output_format or math_notation left out counts as Smallest AI's default (a model or language left out is its own setting). session_id, request_id and word_timestamps aren't sent and aren't part of the key; your session_id and request_id come back in X-External-Session-Id and X-External-Request-Id. With a content_filter that rejects, the whole text is one request and one cache entry. A body with pronunciation_dicts is cached by the dictionaries' ids: a dictionary edited in place reaches entries cached before only when they expire. A body the router doesn't read as one Smallest AI accepts (a field Smallest AI's reference doesn't list, a null or a value of the wrong type, an unknown output_format, text over 8,000 characters) goes to Smallest AI verbatim, uncached, with Smallest AI's own answer. An org out of credit is refused with HTTP 402 in Smallest AI's error shape, error insufficient_credits. The response comes once every sentence is ready, as one file with the Content-Type Smallest AI answers that output_format with (application/octet-stream for pcm, audio/mpeg, audio/wav, audio/basic for ulaw and alaw): raw samples one after another, one WAV header, MP3 frames under the first sentence's Info frame. Its MP3 sentences share the cache with /v1/audio/speech and /v1/stream at the same settings.
Request body
textstringRequired- The text to speak.
voice_idstringRequired- A Smallest AI voice of the model, e.g.
meher(lightning_v3.1_pro) orsophia(lightning_v3.1), or a cloned voice's id, with the model it was cloned for. modelstringlightning_v3.1orlightning_v3.1_pro. Left out, Smallest AI picks the model by the voice.sample_rate8000 | 16000 | 24000 | 44100- Left out, Smallest AI's default (44100).
speednumber, ≥ 0.5, ≤ 2languagestring- A language code of the model, e.g.
enorhi, orauto. Left out, Smallest AI's default. output_format"pcm" | "mp3" | "wav" | "ulaw" | "alaw"pronunciation_dictsstring[]- Pronunciation dictionary ids, part of the cache key: a dictionary edited in place reaches cached entries only when they expire.
Responses
200The audio in the requested format.
400Smallest AI refused the request (e.g. a voice of another model, or an unsupported language or sample rate)
401A missing or wrong `tcr_` key (`unauthorized`), or no Smallest AI key stored for the org (with a `message` that links to the dashboard)
402The org is out of credit (`insufficient_credits`)
post/smallestai/waves/v1/tts/liveSmallest AI: synthesize speech (SSE)
POST https://api.media.ttscacherouter.dev/smallestai/waves/v1/tts/live
Mirrors POST https://api.smallest.ai/waves/v1/tts/live ([Smallest AI's reference](https://docs.smallest.ai/api-reference/models/text-to-speech/synthesize-speech-sse)): the same body, server-sent events (audio events with base64 audio, then done) and errors. Send your tcr_ key as Authorization: Bearer; your stored Smallest AI key is used. The router splits text into sentences, serves each one your org has synthesized before from the cache and sends the rest to Smallest AI with the body's settings, one sentence at a time, each its own cache entry; a sample_rate, speed, output_format or math_notation left out counts as Smallest AI's default (a model or language left out is its own setting). session_id, request_id and word_timestamps aren't sent and aren't part of the key; your session_id and request_id come back in X-External-Session-Id and X-External-Request-Id. With a content_filter that rejects, the whole text is one request and one cache entry. A body with pronunciation_dicts is cached by the dictionaries' ids: a dictionary edited in place reaches entries cached before only when they expire. A body the router doesn't read as one Smallest AI accepts (a field Smallest AI's reference doesn't list, a null or a value of the wrong type, an unknown output_format, text over 8,000 characters) goes to Smallest AI verbatim, uncached, with Smallest AI's own answer. An org out of credit is refused with HTTP 402 in Smallest AI's error shape, error insufficient_credits. The sentences' audio streams back as Smallest AI's audio events as each is ready, then done; a later sentence that fails breaks the stream off. Its pcm, ulaw and alaw sentences share the cache with /v1/audio/speech and /v1/stream at the same settings. The WebSocket at the same path, wss://api.media.ttscacherouter.dev/smallestai/waves/v1/tts/live, is a drop-in for Smallest AI's; see the docs.
Request body
textstringRequired- The text to speak.
voice_idstringRequired- A Smallest AI voice of the model, e.g.
meher(lightning_v3.1_pro) orsophia(lightning_v3.1), or a cloned voice's id, with the model it was cloned for. modelstringlightning_v3.1orlightning_v3.1_pro. Left out, Smallest AI picks the model by the voice.sample_rate8000 | 16000 | 24000 | 44100- Left out, Smallest AI's default (44100).
speednumber, ≥ 0.5, ≤ 2languagestring- A language code of the model, e.g.
enorhi, orauto. Left out, Smallest AI's default. output_format"pcm" | "mp3" | "wav" | "ulaw" | "alaw"pronunciation_dictsstring[]- Pronunciation dictionary ids, part of the cache key: a dictionary edited in place reaches cached entries only when they expire.
Responses
200Server-sent events: `audio` events, each `{"audio": <base64>, "done": false}`, then `{"done": true}`.
400Smallest AI refused the request (e.g. a voice of another model, or an unsupported language or sample rate)
401A missing or wrong `tcr_` key (`unauthorized`), or no Smallest AI key stored for the org (with a `message` that links to the dashboard)
402The org is out of credit (`insufficient_credits`)
get/smallestai/waves/v1/{model}/get_voicesSmallest AI: list voices
GET https://api.media.ttscacherouter.dev/smallestai/waves/v1/{model}/get_voices
Mirrors GET https://api.smallest.ai/waves/v1/{model}/get_voices ([Smallest AI's reference](https://docs.smallest.ai/api-reference/models/text-to-speech/get-waves-voices)): a model's voices, with the same response and errors. Send your tcr_ key as Authorization: Bearer; the request goes to Smallest AI. Not cached.
Parameters
modelpath, stringRequired- The model's id in Smallest AI's voice paths:
lightning-v3.1orlightning-v3.1-pro.
Responses
200Smallest AI's response
get/smallestai/waves/v1/voice-cloningSmallest AI: list cloned voices
GET https://api.media.ttscacherouter.dev/smallestai/waves/v1/voice-cloning
Mirrors GET https://api.smallest.ai/waves/v1/voice-cloning ([Smallest AI's reference](https://docs.smallest.ai/api-reference/models/text-to-speech/list-voice-clones)): your Smallest AI account's voice clones, with the same response and errors. Send your tcr_ key as Authorization: Bearer; the request goes to Smallest AI with your stored Smallest AI key. Not cached.
Responses
200Smallest AI's response
Cartesia drop-in
post/cartesia/tts/bytesCartesia: synthesize speech (bytes)
POST https://api.media.ttscacherouter.dev/cartesia/tts/bytes
Mirrors POST https://api.cartesia.ai/tts/bytes ([Cartesia's reference](https://docs.cartesia.ai/api-reference/tts/bytes)): the same body, response and errors. Send your tcr_ key as X-API-Key or Authorization: Bearer; your stored Cartesia key is used. The router splits transcript into sentences, serves each one your org has synthesized before from the cache and sends the rest to Cartesia with the body's settings and API version, one sentence at a time, each its own cache entry (the API version is part of the key); a field left out or null counts as Cartesia's default (normalization auto, a generation_config speed or volume of 1, save off), and a voice is the same however it is named (a string, {"id"}, {"mode": "id", "id"}); a language left out is its own setting. A transcript with a speed, volume, emotion or spell tag, which reaches past where it stands, is one request and one cache entry. A body with pronunciation_dict_id is cached by the dictionary's id: a dictionary edited in place reaches entries cached before only when they expire. A body the router doesn't read as one Cartesia accepts (no Cartesia-Version, a field Cartesia's reference doesn't list, a value of the wrong type, an output_format missing a field Cartesia requires, save: true) goes to Cartesia verbatim, uncached, with Cartesia's own answer. An org out of credit is refused with HTTP 402 in Cartesia's error shape. The sentences' audio streams back as each is ready, as one stream with the Content-Type Cartesia answers that container with (audio/pcm, audio/wav, audio/mpeg): raw samples one after another, one WAV header, one MP3 tag; a later sentence that fails breaks the body off. Its mp3 sentences under API version 2025-04-16 share the cache with /v1/audio/speech and /v1/stream at the same settings.
Parameters
Cartesia-Versionheader, stringRequired- Cartesia's API version, as Cartesia takes it. Errors are plain
Title: Messagetext before 2026-03-01 and JSON from it on, as Cartesia's.
Request body
transcriptstringRequired- The text to speak.
model_idstringRequired- A Cartesia model, e.g.
sonic-3.6,sonic-3or a dated snapshot. voiceanyRequired- A voice id, or
{"mode": "id", "id": …}as older API versions take it. output_formatobjectRequired{"container": "raw" | "wav" | "mp3", "encoding", "sample_rate", "bit_rate"}, as Cartesia takes it.languagestringgeneration_configobjectspeed,volumeandemotion, as Cartesia takes them.pronunciation_dict_idstring- Part of the cache key: a dictionary edited in place reaches cached entries only when they expire.
Responses
200The audio in the requested format.
400Cartesia refused the request (e.g. an unsupported model, voice or format)
401A missing or wrong `tcr_` key, or no Cartesia key stored for the org
402The org is out of credit
post/cartesia/tts/sseCartesia: synthesize speech (SSE)
POST https://api.media.ttscacherouter.dev/cartesia/tts/sse
Mirrors POST https://api.cartesia.ai/tts/sse ([Cartesia's reference](https://docs.cartesia.ai/api-reference/tts/sse)): the same body, events and errors. Send your tcr_ key as X-API-Key or Authorization: Bearer; your stored Cartesia key is used. The router splits transcript into sentences, serves each one your org has synthesized before from the cache and sends the rest to Cartesia with the body's settings and API version, one sentence at a time, each its own cache entry (the API version is part of the key); a field left out or null counts as Cartesia's default (normalization auto, a generation_config speed or volume of 1, add_timestamps and add_phoneme_timestamps off), and a voice is the same however it is named (a string, {"id"}, {"mode": "id", "id"}); a language left out is its own setting. A transcript with a speed, volume, emotion or spell tag, which reaches past where it stands, is one request and one cache entry. A body with pronunciation_dict_id is cached by the dictionary's id: a dictionary edited in place reaches entries cached before only when they expire. A body the router doesn't read as one Cartesia accepts (no Cartesia-Version, a field Cartesia's reference doesn't list, a value of the wrong type, an output_format missing a field Cartesia requires) goes to Cartesia verbatim, uncached, with Cartesia's own answer. An org out of credit is refused with HTTP 402 in Cartesia's error shape. context_id isn't sent and isn't part of the key; every event carries yours. The sentences' events stream back as each is ready (chunk, timestamps, phoneme_timestamps), word and phoneme timestamps running on across the response as one request's do, then one done; a later sentence that fails ends the stream with an error event.
Parameters
Cartesia-Versionheader, stringRequired- Cartesia's API version, as Cartesia takes it. Errors are plain
Title: Messagetext before 2026-03-01 and JSON from it on, as Cartesia's.
Request body
transcriptstringRequired- The text to speak.
model_idstringRequired- A Cartesia model, e.g.
sonic-3.6,sonic-3or a dated snapshot. voiceanyRequired- A voice id, or
{"mode": "id", "id": …}as older API versions take it. output_formatobjectRequired{"container": "raw", "encoding", "sample_rate"}, as Cartesia takes it: the SSE makes raw audio only.languagestringgeneration_configobjectspeed,volumeandemotion, as Cartesia takes them.pronunciation_dict_idstring- Part of the cache key: a dictionary edited in place reaches cached entries only when they expire.
add_timestampsboolean- Word timestamps as
timestampsevents. context_idstring- Echoed in the events; not part of the cache key.
Responses
200Cartesia's events.
400Cartesia refused the request
401A missing or wrong `tcr_` key, or no Cartesia key stored for the org
402The org is out of credit
get/cartesia/voicesCartesia: list voices
GET https://api.media.ttscacherouter.dev/cartesia/voices
Mirrors GET https://api.cartesia.ai/voices ([Cartesia's reference](https://docs.cartesia.ai/api-reference/voices/list)): the same query, response and errors, with your stored Cartesia key. Not cached.
Responses
200Cartesia's response
get/cartesia/voices/{id}Cartesia: get a voice
GET https://api.media.ttscacherouter.dev/cartesia/voices/{id}
Mirrors GET https://api.cartesia.ai/voices/{id} ([Cartesia's reference](https://docs.cartesia.ai/api-reference/voices/get)), with your stored Cartesia key. Not cached.
Parameters
idpath, stringRequired- The voice's id.
Responses
200Cartesia's response
Gemini drop-in
post/gemini/v1beta/models/{model}:streamGenerateContentGemini: generate speech (streamed)
POST https://api.media.ttscacherouter.dev/gemini/v1beta/models/{model}:streamGenerateContent
Mirrors POST https://generativelanguage.googleapis.com/v1beta/models/{model}:streamGenerateContent ([Gemini's reference](https://ai.google.dev/api/generate-content#method:-models.streamgeneratecontent)): the same body, events and errors. Send your tcr_ key as x-goog-api-key or ?key=; Gemini gets your stored Gemini key. With alt=sse, the router splits the text into sentences and serves each from the cache or synthesizes it at Gemini with the body's settings, one at a time, streaming each sentence's audio as Gemini's events (inlineData parts) as it comes, then a last event with finishReason: STOP and the usageMetadata Gemini spent on this request (a sentence from the cache spends none). A 2.5 or 3.1 request whose text isn't in LiveKit's plugin's prompt form (<instructions>:\n"<text>"), or names speakers, is one cache entry, unsplit. A body the router doesn't read as a speech request, and a stream without alt=sse, go to Gemini as sent and aren't cached.
Parameters
modelpath, stringRequired- A Gemini model, passed through (any model Gemini serves).
altquery, "sse"sse, as Google's SDK sends it.
Request body
contentsobject[]Required- As Gemini takes them. A request is split and cached when it has one content of one text part (what Google's SDK sends for a string), with an optional
speech_metadata(style,speaker); anything else goes to Gemini as sent. generationConfigobjectresponseModalities: ["AUDIO"],speechConfigand, for the 3.8 models,response_format, as Gemini takes them.
Responses
200Gemini's events: each `data:` line a response whose parts carry base64 audio.
400Gemini refused the request (e.g. an unknown voice or format), or a wrong `tcr_` key or no Gemini key stored for the org (`API_KEY_INVALID`)
402The org is out of credit
403No `tcr_` key (`PERMISSION_DENIED`)
post/gemini/v1beta/models/{model}:generateContentGemini: generate speech
POST https://api.media.ttscacherouter.dev/gemini/v1beta/models/{model}:generateContent
Mirrors POST https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent ([Gemini's reference](https://ai.google.dev/api/generate-content#method:-models.generatecontent)): the same body, response and errors, with your stored Gemini key. The router splits the text into sentences as on streamGenerateContent and answers with one response once every sentence is ready: their audio in one part, and the usageMetadata Gemini spent on this request. A 3.8 request in its default WAV is one cache entry, unsplit: ask for AUDIO_L16, AUDIO_MULAW or AUDIO_ALAW in generationConfig.response_format.
Parameters
modelpath, stringRequired- A Gemini model, passed through (any model Gemini serves).
Request body
contentsobject[]Required- As Gemini takes them. A request is split and cached when it has one content of one text part (what Google's SDK sends for a string), with an optional
speech_metadata(style,speaker); anything else goes to Gemini as sent. generationConfigobjectresponseModalities: ["AUDIO"],speechConfigand, for the 3.8 models,response_format, as Gemini takes them.
Responses
200Gemini's response: its part carries the base64 audio.
400Gemini refused the request (e.g. an unknown voice or format), or a wrong `tcr_` key or no Gemini key stored for the org (`API_KEY_INVALID`)
402The org is out of credit
403No `tcr_` key (`PERMISSION_DENIED`)
get/gemini/v1beta/voicesGemini: list voices
GET https://api.media.ttscacherouter.dev/gemini/v1beta/voices
Mirrors GET https://generativelanguage.googleapis.com/v1beta/voices ([Gemini's reference](https://ai.google.dev/gemini-api/docs/speech-generation#voices)): the same query, response and errors, with your stored Gemini key. Not cached.
Responses
200Gemini's response
get/gemini/v1beta/modelsGemini: list models
GET https://api.media.ttscacherouter.dev/gemini/v1beta/models
Mirrors GET https://generativelanguage.googleapis.com/v1beta/models ([Gemini's reference](https://ai.google.dev/api/models#method:-models.list)): the same query, response and errors, with your stored Gemini key. Not cached.
Responses
200Gemini's response
get/gemini/v1beta/models/{model}Gemini: get a model
GET https://api.media.ttscacherouter.dev/gemini/v1beta/models/{model}
Mirrors GET https://generativelanguage.googleapis.com/v1beta/models/{model} ([Gemini's reference](https://ai.google.dev/api/models#method:-models.get)): the same query, response and errors, with your stored Gemini key. Not cached.
Parameters
modelpath, stringRequired- A Gemini model, passed through (any model Gemini serves).
Responses
200Gemini's response
OpenAPI document#
The whole HTTP API as OpenAPI 3.1, for code generators and API clients. The WebSocket protocol has its own page.
curl https://api.ttscacherouter.dev/openapi.jsonIt also lists the dashboard’s session endpoints (/api/…), which take the dashboard’s sign-in cookie rather than an API key and aren’t meant for your code.