⚡ New — Kimi K3 is live: bring your own Moonshot key →
Documentation

Use BharatRouter in your coding tool

BharatRouter speaks the OpenAI (and Anthropic) wire format, so your existing coding tool works with a base URL and a key — no re-learning. This page is the one-stop setup for Claude Code,Codex, Cursor and Hermes, plus the zero-installPlayground. Same models, one br- key.

Step 1 — get your key

Sign in and mint a key once: go to bharatrouter.com/start →Create my key → copy it (Ola employees: sign in with Ola SSO). It's shown once — save it somewhere private. This br-… key is all any tool below needs.

No install — just chat (everyone)

Not a terminal person, or just want to try a model? Open the Playground: sign in at/start → Open the console → Playground → start chatting in your browser. Works on any OS, nothing to install. Use glm-5.3-flash.

Claude Code & Codex (terminal, via brcode)

brcode installs the real Claude Code / Codex CLIs and wires them to BharatRouter — one command each. Update to the latest first (it carries the current models and the session-key fix):

curl -fsSL https://bharatrouter.com/install/brcode.sh | bash
# macOS Apple Silicon can also: brew update && brew upgrade brcode
brcode version   # confirm 0.5.8 or newer

Then log in, pick a model, and launch your harness:

brcode login
brcode model glm-5.3-flash     # or gpt-oss-120b / kimi-k3
brcode claude                  # Claude Code   —or—   brcode codex

Switch models anytime with brcode model <id>, or per-launch withBHARATROUTER_MODEL=<id> brcode claude. brcode mints and manages the key for you.

Claude Code — manual (no brcode)

Claude Code uses BharatRouter's native Anthropic /v1/messages surface — point it at the root host (no /v1):

{claudeEnv}

Codex — manual (no brcode)

Codex uses the Responses API — add a custom provider in ~/.codex/config.toml:

{codexToml}
export BHARATROUTER_API_KEY=br-...
codex

The Codex CLI and the Codex IDE extension both read ~/.codex/config.toml, so this works for either. Codex cloud tasks run on OpenAI's side and cannot use a custom endpoint.

Cursor (IDE — macOS, Windows, Linux)

Before you start: a custom endpoint needs a paid Cursor plan — it doesn't work on Hobby/Free. On a Cursor Business/Enterprise team, your admin must also allow personal API keys (Team Settings → Models). If your Models page shows no API-key fields, one of these is why.

  1. Open Cursor Settings → Models. Add a custom model with the exact idglm-5.3-flash (optionally gpt-oss-120b, kimi-k3) and make sure it's enabled.
  2. In the API Keys section of the same page, turn on OpenAI API Key and paste your br-… key.
  3. Turn on Override OpenAI Base URL and enter https://api.bharatrouter.com/v1. (On Cursor 3.15.x these fields may not take a click — update Cursor.)
  4. Pick glm-5.3-flash in the Chat / Agent model picker.

What to expect: the endpoint is used for Chat and Agent with the models you added. Tab autocomplete always uses Cursor's own model, and subagents currently ignore custom models. The base-URL override applies to every OpenAI-routed model, so switch it off to use Cursor's built-in models again. Cursor sends requests through its own servers first, so data_policy: india_only can't keep the prompt inside India — if residency matters, use Claude Code or Codex above.

Hermes (GUI app)

Hermes is a drop-in GUI for the Codex/Claude interface. In the app it'sSettings → Providers → Custom Endpoints → Add Endpoint (not "Accounts") — base URLhttps://api.bharatrouter.com/v1, your br- key, model glm-5.3-flash. Full walkthrough with screenshots: the Hermes guide. If the CLI installer fails on your Mac, see the install-trouble notes — or just use one of the paths above.

Which model?

ModelBest forServed on
glm-5.3-flashYour default — fast (~1s to first token), 1M-token context, day-to-day coding and big-context prompts.Krutrim Cloud
gpt-oss-120bHeavier, multi-step agentic work and long tool-loops.Krutrim Cloud
kimi-k3Hardest reasoning tasks — use sparingly, it runs on outside providers, not Krutrim Cloud.External providers

Always use the exact model id — lowercase, hyphenated (glm-5.3-flash, not "GLM 5.3 Flash"). A display name or wrong casing returns 404 model_not_found. The canonical ids are at /models. See the measured comparison vs Claude & GPT inthe write-up.

Platforms

PlatformClaude Code / Codex / brcodeCursorPlayground
macOS Apple Silicon (M1/M2/M3)Native — brew or curl installerNativeYes
macOS Intel (x86_64)Native — use the curl installer (Homebrew is dropping Intel)NativeYes
WindowsClaude Code & Codex: native (manual setup above). brcode: via WSL (Ubuntu) — run the Linux steps inside itNativeYes
Linux (x86_64 / arm64)NativeNativeYes

Universal fallback for any OS: the browser Playground (no install).

Troubleshooting

SymptomFix
Model list doesn't show glm-5.3-flash (brcode)Update brcode to 0.5.8+ (brew upgrade brcode or the curl installer). It's the default from 0.5.8.
"This API key was revoked" / retrying (Claude Code, Codex)Update brcode and re-run brcode login — the session-key issue is fixed server-side; a fresh login gets a stable key. Or use a durable key created in the console.
Model not switching / 404 model_not_foundUse the exact lowercase-hyphenated id (glm-5.3-flash), not a display name.
Hermes "Test" → "could not reach …/v1/models"Untick Discover models, type the model id manually, and Save — the endpoint works for chat regardless. Retrying the Test usually clears it (transient network).
Hermes installer fails (Intel warning / M1 error / 403)That's Nous's installer, not BharatRouter — use Claude Code, Cursor, or the Playground instead (all reach the same models).
"maximum context length is 1048576 tokens" / context_length_exceededYour agent has filled the model's 1M-token window (the whole conversation + files went into one request) — it's a hard ceiling, not a billing issue. Compact or reset the context: /compact in Claude Code, a fresh session in brcode/Hermes. All our 1M-context models (glm-5.3-flash, kimi-k3, glm-5.2/5.3) share this limit, so switching among them won't help.

Still stuck? Email support@bharatrouter.com with the tool, its version and the exact error (Ola employees: ask on buzz-help).