Esc to close · ⌘K / Ctrl-K opens search anywhere
BharatRouter is India's AI gateway: Krutrim, Sarvam, and the world's best open and frontier models behind one API, with INR pricing, enforceable India data-residency, and price/latency/uptime routing with automatic failover. The API speaks the OpenAI wire format, so any standard SDK works — swap the base URL and key, change nothing else.
| Base URL | https://api.bharatrouter.com/v1 |
|---|---|
| Auth | Authorization: Bearer br-… — sign up (GitHub or Google) and mint a key on the dashboard. New orgs get ₹100 free credit. |
| Wire format | OpenAI-compatible chat completions and embeddings, streaming included. |
| Pricing | Prepaid INR credits, per-token rates on the model catalog. No card on file, no surprise bills. |
Three steps: sign in, create a key on the dashboard, make a request.
curl https://api.bharatrouter.com/v1/chat/completions \
-H "Authorization: Bearer br-..." \
-H "Content-Type: application/json" \
-d '{
"model": "qwen2.5-7b-instruct",
"messages": [{"role": "user", "content": "namaste"}],
"stream": true,
"data_policy": "india_only",
"optimize": "latency"
}' from openai import OpenAI
client = OpenAI(base_url="https://api.bharatrouter.com/v1", api_key="br-...")
r = client.chat.completions.create(
model="qwen2.5-7b-instruct",
messages=[{"role": "user", "content": "namaste"}],
extra_body={"data_policy": "india_only", "optimize": "price"},
)
print(r.choices[0].message.content) import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.bharatrouter.com/v1", apiKey: "br-..." });
const r = await client.chat.completions.create({
model: "qwen2.5-7b-instruct",
messages: [{ role: "user", content: "namaste" }],
data_policy: "india_only", // BharatRouter extensions pass straight through the SDK
});
console.log(r.choices[0].message.content); Set "stream": true and read server-sent events, exactly as with any
OpenAI-compatible API. BharatRouter includes a final usage chunk in every stream so you
always see what the request cost.
stream = client.chat.completions.create(
model="qwen2.5-7b-instruct",
messages=[{"role": "user", "content": "Explain UPI in two lines"}],
stream=True,
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="") curl https://api.bharatrouter.com/v1/embeddings \
-H "Authorization: Bearer br-..." \
-H "Content-Type: application/json" \
-d '{ "model": "bge-m3", "input": "namaste duniya" }' India-resident embedding models served on the platform key: bge-m3 (1024-dim, multilingual) — or bring your own via BYOK.
| API reference | Every endpoint — inference, catalog, dashboard, webhooks — with request and response shapes. |
| Client SDKs & frameworks | Drop-in for the OpenAI SDK (Python/Node), Vercel AI SDK, LangChain and LlamaIndex — and where the routing extensions go in each. |
| Agents | Tool-calling loops and MCP, with residency and budgets applied to every agent step. |
| Cookbook | Copy-paste recipes — cutting inference costs, failover, india_only, DPDP/PII, BYOK, agents, streaming costs and Sangam consensus. |
| Migrate to BharatRouter | One-line swap guides per platform: OpenAI, OpenRouter, Together, Fireworks, Groq, Anthropic, Portkey, LiteLLM. |
| Routing & residency | The optimize, provider and data_policy extensions, saved fallback chains, failover, and circuit breakers. |
| Sangam (consensus) | Sovereign consensus routing — a panel of models deliberate and a synthesizer returns one answer; the two variants and custom panels via sangam:{panel,synth}. |
| Collections | Shareable, versioned routing chains — publish, fork and import them into your org. |
| Reliability monitoring | Canary a collection's steps on a schedule; per-step uptime/latency and email/webhook alerts. |
| Bring your own endpoint | Register your own OpenAI-compatible deployment as a ₹0 fallback step. |
| API keys & limits | Trial vs standard keys, rate limits, per-key monthly ₹ budgets. |
| BYOK | Bring your own provider keys — unlock Krutrim Cloud, Sarvam, Mistral and 25+ more. |
| Credits & billing | Prepaid INR credits, top-ups, promo codes, receipts. |
| Usage & activity | Token usage, per-request activity, and public model rankings. |
| Teams & workspaces | Invite teammates with roles, switch orgs, group keys into workspaces. |
| Errors | The error envelope, every error code, and how to handle each one. |
| MCP for agents | Connect Claude Code or any MCP client straight to the gateway. |
⬇ Postman collection Import, set the apiKey variable, test every endpoint.
| openapi.json | OpenAPI 3.1 schema of the full API. |
| api llms.txt | LLM-readable API summary, served by the gateway. |
| site llms.txt | LLM-readable index of this documentation. |
| MCP server card | Machine-readable MCP discovery for agent clients. |
| status.bharatrouter.com | Live provider health and incident history. |