OpenRouter for TTS
with caching
One API for ElevenLabs, OpenAI, Deepgram, xAI, Soniox, Smallest AI, Cartesia, Sarvam and Raya, with your own keys. A sentence your agent has said before plays from your cache in about 22 ms, as the provider’s own audio, and your provider doesn’t bill you for it again.
Bring your own key from
- ElevenLabs
- OpenAI
- Deepgram
- xAI
- Soniox
- Smallest AI
- Cartesia
- Sarvam
- Raya
The same reply, said twice
Characters billed by your provider, in a real run on ElevenLabs Flash v2.5.
- Hi, this is Priya calling from City Hospital.450
- Your appointment with Doctor Sharma is on Thursday at ten in the morning.730
- Please carry your previous reports and arrive fifteen minutes early.680
- Does that time work for you?280
Median, from San Francisco with connections warm. ElevenLabs called directly: 175 ms; first time through us shown as that plus 16 ms.
Latency
A repeat starts in 22 ms.
The first time a sentence goes through us, it takes your provider’s time plus up to 16 ms. Said again, it plays from your cache, with no provider in the way.
- ElevenLabs, called directlyIts own WebSocket175ms
- Through us, the first timeElevenLabs’ time plus up to 16 ms191ms
- Through us, said againServed from your cache22ms
Medians of 10 sentences, each replayed 3 times, measured against production from San Francisco with connections already open. The first time is shown as the direct time plus 16 ms, the most our cache check and hop add. From farther away, every path adds your network time to San Francisco.
Voice quality
The same audio as calling your provider directly.
- Your text, verbatim
- Each sentence reaches the provider exactly as your agent wrote it.
- Your settings, unchanged
- Model, voice, language, speed and the provider’s own options, passed on as you set them.
- The provider’s own take
- A replay is the complete audio the provider made for that exact request, never spliced or re-encoded.
How to connect
One plugin,
every provider.
Make the plugin your LiveKit agent’s TTS. To switch provider, change the model; the voice and settings use the same names for every provider.
- Pipecat
pip install pipecat-tts-cache-router: the same router as a Pipecat TTS service, for every provider.
- OpenAI SDK
POST /v1/audio/speech with a model like elevenlabs/eleven_flash_v2_5, openai/gpt-4o-mini-tts, deepgram/aura-2, xai/xai-tts, soniox/tts-rt-v2, smallestai/lightning_v3.1, cartesia/sonic-3 or sarvam/bulbul:v3.
- Your provider’s own SDK
ElevenLabs’, OpenAI’s, Deepgram’s, xAI’s, Soniox’s, Smallest AI’s, Cartesia’s, Sarvam’s and Raya’s APIs, mirrored: change only the base URL and the key.
- WebSocket
The router’s streaming protocol, from any language.
pip install livekit-plugins-tts-cache-routerfrom livekit.plugins import tts_cache_router as tcr# The API key comes from TTS_CACHE_ROUTER_API_KEY.tts = tcr.TTS( model="sarvam/bulbul:v3", voice="shubh", language="hi-IN",)from livekit.plugins import tts_cache_router as tcr# The API key comes from TTS_CACHE_ROUTER_API_KEY.tts = tcr.TTS( model="raya/standard", voice="d6a002d0-230c-49b1-a137-b8a7d564b1ae", language="hi",)from livekit.plugins import tts_cache_router as tcr# The API key comes from TTS_CACHE_ROUTER_API_KEY.tts = tcr.TTS( model="elevenlabs/eleven_flash_v2_5", voice="JBFqnCBsd6RMkjVDRZzb",)from livekit.plugins import tts_cache_router as tcr# The API key comes from TTS_CACHE_ROUTER_API_KEY.tts = tcr.TTS( model="openai/gpt-4o-mini-tts", voice="ash",)from livekit.plugins import tts_cache_router as tcr# The API key comes from TTS_CACHE_ROUTER_API_KEY.tts = tcr.TTS( model="deepgram/aura-2", voice="thalia-en",)from livekit.plugins import tts_cache_router as tcr# The API key comes from TTS_CACHE_ROUTER_API_KEY.tts = tcr.TTS( model="xai/xai-tts", voice="ara", language="auto",)from livekit.plugins import tts_cache_router as tcr# The API key comes from TTS_CACHE_ROUTER_API_KEY.tts = tcr.TTS( model="soniox/tts-rt-v2", voice="Adrian", language="en",)from livekit.plugins import tts_cache_router as tcr# The API key comes from TTS_CACHE_ROUTER_API_KEY.tts = tcr.TTS( model="smallestai/lightning_v3.1_pro", voice="meher", language="en",)from livekit.plugins import tts_cache_router as tcr# The API key comes from TTS_CACHE_ROUTER_API_KEY.tts = tcr.TTS( model="cartesia/sonic-3", voice="f786b574-daa5-4673-aa0c-cbe3e8534c02", language="en",)Pricing
Pay for what
the cache serves.
Every new org gets $10 of credit, about 5 million cached characters, with no card. After that, buy prepaid credit from $10. It never expires.
Pricing and billing in the docs- Served from the cache (cache-hit)
- $0.002/ 1k chars
- Synthesized by your provider (cache-miss)
- $0from us
Stop paying your provider
twice for the same sentence.
Start with $10 of credit and no card. Add your provider key, make the plugin your agent’s TTS, and every repeat comes from your cache.




