kRouter is a multimodal AI gateway, not just an LLM router
One local endpoint for chat, speech, transcription, images, video, embeddings, web search and fetch across 95+ providers -- and where each one stops.
Most people still think of kRouter as "the thing that switches between GPT and Claude." It does more than that. One local endpoint serves eight kinds of request across 95+ providers: chat, text-to-speech, speech-to-text, image generation, video generation, embeddings, web search and web fetch.
If your app needs text, speech, images or live web data, you can point it at one base URL, http://localhost:20128/v1, instead of wiring a separate SDK into each service. You still need an account or key with each provider you use. kRouter routes to them; it does not replace them.
This post was updated for v0.5.163. The first version overstated a few things: video works through one provider, combos and the usage view do not cover every endpoint, and the text-to-speech example used a model name kRouter would have misread. Those are corrected below.
The eight modalities
| Modality | Endpoint | Some providers |
|---|---|---|
| Chat and code | /v1/chat/completions, /v1/messages, /v1/responses | Claude, GPT, Gemini, GLM, Kimi, DeepSeek and the rest |
| Text-to-speech | /v1/audio/speech | OpenAI, Gemini, ElevenLabs, NVIDIA, MiniMax, Deepgram, Edge TTS |
| Speech-to-text | /v1/audio/transcriptions | OpenAI Whisper, Groq, Deepgram, AssemblyAI, Gemini |
| Image generation | /v1/images/generations | OpenAI (GPT Image, DALL-E), Gemini, Black Forest Labs (FLUX), Stability AI, Recraft, fal.ai, ComfyUI |
| Video generation | /v1/videos/generations | xAI (Grok Imagine) only |
| Embeddings | /v1/embeddings | OpenAI, Gemini, Voyage AI, Jina, Mistral |
| Web search | /v1/search | Tavily, Exa, Brave, Serper, SearXNG, Google PSE, You.com |
| Web fetch | /v1/web/fetch | Firecrawl, Jina Reader, Tavily, Exa |
GET /v1/models lists chat models and your combos. Each modality has its own list: /v1/models/tts, /v1/models/stt, /v1/models/image, /v1/models/video, /v1/models/embedding and /v1/models/web.
Two things kRouter does not do: there is no music generation, and no separate image-understanding endpoint. To have a model read an image, send it to a vision-capable chat model. Video is a job you start and then poll; the video generation post shows the flow.
One SDK for most of it
Chat, speech, transcription, images and embeddings use OpenAI's request shapes, so the OpenAI SDK covers them. Only the base URL and the model names change:
from openai import OpenAI
# Requests from the same machine need no kRouter key; any placeholder works.
client = OpenAI(base_url="http://localhost:20128/v1", api_key="local")
# Chat
chat = client.chat.completions.create(
model="cc/claude-sonnet-4-6",
messages=[{"role": "user", "content": "Summarize this PR"}],
)
# Text-to-speech. kRouter reads the voice from the model name
# (provider/model/voice); the SDK requires a voice argument as well.
audio = client.audio.speech.create(
model="openai/gpt-4o-mini-tts/nova", voice="nova", input="Deploy complete."
)
audio.write_to_file("done.mp3")
# Embeddings for a RAG pipeline
vec = client.embeddings.create(
model="openai/text-embedding-3-small", input="kRouter is a multimodal gateway"
)The voice detail is the one to watch. For OpenAI speech, kRouter ignores the request's voice field and takes the voice from the model name. openai/tts-1 on its own is read as a voice called "tts-1" and fails; write openai/tts-1/nova.
Search and fetch have no OpenAI equivalent, so they take small bodies of their own. The provider goes in provider (or model):
curl http://localhost:20128/v1/search \
-H "Content-Type: application/json" \
-d '{"provider": "tavily", "query": "kRouter release notes"}'
curl http://localhost:20128/v1/web/fetch \
-H "Content-Type: application/json" \
-d '{"provider": "firecrawl", "url": "https://example.com"}'The full request reference is in the API docs and the multimodal docs.
What carries over to every modality, and what does not
Routing through one gateway means some infrastructure applies everywhere. Not all of it does.
Applies to all eight:
- Access rules. Requests from the same machine need no key unless you set
REQUIRE_API_KEY=true. Requests from anywhere else need a kRouter key, created on the dashboard's Endpoint page. - Several accounts per provider. Every endpoint picks an account with the same strategy -- Zenith scoring by default -- and moves to another account of that provider when one is rate limited or failing.
- No hosted middleman. kRouter runs on your machine, so requests go from it straight to the provider you chose. The provider still sees them.
Applies to some:
- Combos. Chat, speech, image generation, search and fetch accept a combo name, so you can fall back from one provider to another. Embeddings, transcription and video do not; they take a single
provider/model. - Usage view. Chat and embedding requests appear in the dashboard's usage statistics. Speech, transcription, image, video, search and fetch requests are routed the same way but are not counted there.
- Token savers. These work on the chat path only. RTK is on by default; Caveman, Headroom, PXPIPE and the response cache are off until you enable them. See token savers.
- PII redaction. When you turn it on, it covers the chat endpoints. Audio, images, embeddings, search and fetch are not redacted. The redaction post has the setup.
Agents can use it too
kRouter ships skill files: one Markdown file per modality (krouter-tts, krouter-web-search, krouter-image and so on) that tells an agent how to call that endpoint. Give Claude Code the krouter-tts skill and it can produce audio with a curl call; give it krouter-web-search and it can ground an answer in live results. The Skills page in your dashboard lists the URLs. See agent skills explained.
Cost
kRouter itself is MIT-licensed, self-hosted and free. You pay the providers behind it, at their prices, and some of them have free allowances. Combos let you put a free or cheap provider behind a paid one for the endpoints that support them.
Get started
npm install -g @sifxprime/krouter
krouter -tConnect a provider for each modality you need, then point any OpenAI-compatible client at http://localhost:20128/v1. Full setup is at /install.
Common questions
Does kRouter generate video with any provider?
No. Video generation works through xAI's Grok Imagine only, and combos are not accepted for video. Runway is listed with a video kind, but kRouter has no video support for it yet.
Why does my text-to-speech request fail with an OpenAI model?
Most likely the voice is missing from the model name. kRouter takes the OpenAI voice from the model (openai/tts-1/nova) and ignores the request's voice field, so openai/tts-1 alone is read as a voice called "tts-1".
Can I fall back from one speech or image provider to another?
Yes. Speech, image generation, search and fetch accept a combo name as the model, and use the same fallback rules as chat. Embeddings, transcription and video do not support combos.
Is audio or image data redacted before it leaves my machine?
No. PII redaction is off by default, and when enabled it covers the chat endpoints only.
Related
Published by Kodelyth, the team that builds kRouter. Posts are drafted with AI assistance and reviewed by a person before they go out. kRouter is free and MIT licensed.
Install kRouterRelated posts
- How kRouter worksWhat is an LLM gateway, and do you actually need one?Gateway, proxy, router, aggregator: four words for overlapping things. What each one does, the problem they solve, and when not to run one.
- How kRouter worksRedact PII before it reaches the model, not afterkRouter can strip names, emails and keys from a request before it leaves your machine, and rejects the request if redaction fails instead of sending it.
- How kRouter worksThe security checklist for self-hosting an AI routerSelf-hosting kRouter puts your OAuth tokens, API keys and prompts on that machine. What it protects by default, and what is still your job.
Relevant docs
- Core conceptsProviders, combos, account routing, token savers, MITM mode, quota tracking, the response cache and remote access: the eight ideas behind kRouter.
- The Zenith Routing EngineHow kRouter picks which of your accounts serves a request: Zenith scoring, conversation stickiness, cooldowns, and the round-robin, P2C and random options.
- Token savers: RTK, Caveman, Ponytail, Headroom, PXPIPEFive ways kRouter can shrink a request before it reaches the provider. Only RTK is on by default. What each saver does, what it needs, and its limits.