Esc to close · ⌘K / Ctrl-K opens search anywhere
Short, task-focused recipes — each solves one problem with copy-paste code. New here? Start with the quickstart, then come back to wire up cost routing, failover, residency and agents. Agents get the same recipes viallms.txt and MCP. Prefer to run them locally? Clone the cookbook on GitHub.
Spend less per token without babysitting routes.
The tiered playbook: cheapest India route by default, optimize:price, delegate routine work to smaller models, fall back cheap-first, and reserve quality spend for the calls that earn it.
optimize:price + delegation + BYOEIntermediate12 min
Open recipe →
Pull a live, FX-converted INR price comparison for any model straight from the gateway.
/v1/pricing/compareBeginner3 min
Open recipe →
Set monthly ₹ budgets at every level — org, team, workspace, member and key — plus per-provider caps, so runaway usage stops itself instead of surprising you.
Hierarchical budgets (budgets, not seats)Intermediate10 min
Open recipe →
Stay up when a provider has a bad day.
Keep data in India and stay DPDP-aligned.
Pin data residency so requests fail closed rather than silently routing offshore.
data_policy: "india_only"Beginner5 min
Open recipe →
Combine residency, zero-retention and client-side redaction to process personal data responsibly.
india_only + zero-retention + redactionIntermediate15 min
Open recipe →
Serve Hindi and Indian-language chat on India-resident Krutrim and Sarvam models.
Krutrim + Sarvam, India routesBeginner8 min
Open recipe →
Unlock more models on your own terms.
Bring your own provider key to ride your account and rates, with BharatRouter routing on top.
upstream_key (BYOK)Intermediate8 min
Open recipe →
One OpenAI-compatible audio API for transcription and voice — first-party India-resident ASR/TTS by default, ElevenLabs / Sarvam / OpenAI on BYOK, with failover across all of them.
/v1/audio/transcriptions + /v1/audio/speechIntermediate10 min
Open recipe →
One /v1/embeddings endpoint — first-party bge-m3 at ₹1/Mtok stays in India, or bring your own key for OpenAI, Gemini and Cohere embeddings.
/v1/embeddingsBeginner6 min
Open recipe →
Give tool-calling agents a single, governed endpoint.
Reach Anthropic's Claude over the gateway — on the platform key or your own Anthropic key — and wire Claude Code in as an agent over MCP, with your routing, residency and budgets on every call.
BYOK (Anthropic) + MCP serverBeginner6 min
Open recipe →
Run Claude Code on your Claude Max plan, but never hard-stop at the monthly limit — BharatRouter uses your subscription first and automatically spills overflow to the Anthropic API, while metering, budgeting and residency-checking every call.
Max-subscription overflow → Anthropic APIIntermediate8 min
Open recipe →
Expose BharatRouter to MCP clients so an agent can route through one governed endpoint.
MCP serverIntermediate10 min
Open recipe →
Drive an open-source coding agent (OpenCode) with an open GLM model as the brain — metered, budgeted and residency-checked through BharatRouter, with no provider lock-in.
GLM (BYOK) over the OpenAI-compatible APIIntermediate8 min
Open recipe →
Point Claude Code’s base URL at BharatRouter and drive it with an open GLM model. The gateway translates the Anthropic Messages wire to GLM and back — so your client holds only a br- key, and GLM is set once as BYOK on the platform.
Anthropic /v1/messages → GLM translationIntermediate8 min
Open recipe →
Streaming, ensembles, and the sharp edges.
Read server-sent events and capture the final usage chunk so every request is costed.
SSE + usage chunkIntermediate8 min
Open recipe →
Call one model id and get a reconciled answer from a panel of models — and decide when the extra tokens are worth it.
Sangam ensembleAdvanced12 min
Open recipe →
Append :online to any chat model and BharatRouter searches the web first, then answers with cited sources — OpenRouter-compatible, on your own Exa / Brave / Tavily key.
:online web search (BYOK engine)Intermediate8 min
Open recipe →
Migrating from another platform? See the migration guides — one per platform, each a near one-line swap.