OpenRouter for TTS
with caching
One API for Sarvam, ElevenLabs, OpenAI, Deepgram, xAI, Soniox and Raya, with your own keys. A sentence your agent has said before plays from your cache, as the provider’s own audio, and your provider doesn’t bill you for it again.
Bring your own key from
- Sarvam
- ElevenLabs
- OpenAI
- Deepgram
- xAI
- Soniox
- Raya
Characters billed by your provider
The same reply, said twice. 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
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 provider argument; each keeps its own settings, under its own names.
- OpenAI SDK
POST /v1/audio/speech with a model like sarvam/bulbul:v3, elevenlabs/eleven_flash_v2_5, openai/gpt-4o-mini-tts, deepgram/aura-2, xai/xai-tts or soniox/tts-rt-v2.
- Your provider’s own SDK
Sarvam’s, ElevenLabs’, OpenAI’s, Deepgram’s, xAI’s, Soniox’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( provider=tcr.Sarvam( model="bulbul:v3", speaker="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( provider=tcr.Raya( model="standard", voice_id="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( provider=tcr.ElevenLabs( voice_id="JBFqnCBsd6RMkjVDRZzb", model="eleven_flash_v2_5", ),)from livekit.plugins import tts_cache_router as tcr# The API key comes from TTS_CACHE_ROUTER_API_KEY.tts = tcr.TTS( provider=tcr.OpenAI( model="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( provider=tcr.Deepgram( model="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( provider=tcr.XAI( 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( provider=tcr.Soniox( language="en", voice="Adrian", ),)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.


