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.

SentenceFirst timeproviderSaid againcache
  1. Hi, this is Priya calling from City Hospital.450
  2. Your appointment with Doctor Sharma is on Thursday at ten in the morning.730
  3. Please carry your previous reports and arrive fifteen minutes early.680
  4. Does that time work for you?280
Total characters2140
Latency (TTFB, ms)19122

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.

Latency (TTFB), ElevenLabs Flash v2.5
  1. ElevenLabs, called directlyIts own WebSocket175ms
  2. Through us, the first timeElevenLabs’ time plus up to 16 ms191ms
  3. 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-router
from 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",)

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.