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

Quickstart / Welcome Kit

New here? This is everything you need to make your first call — and to hand BharatRouter to an AI agent or IDE so it wires itself up. BharatRouter speaks the OpenAI wire format, so most tools work with two changes: the base URL and your key.

Base URL (OpenAI-compatible)https://api.bharatrouter.com/v1
Base URL (native Anthropic)https://api.bharatrouter.com
AuthAuthorization: Bearer br-…
Starter modelqwen2.5-7b-instruct

Three steps to your first call

  1. Create an API key. Open the API keys panel in the console and click Create key. Your key looks like br-… and is shown once — copy it somewhere safe.
  2. Point at BharatRouter. Set the base URL to https://api.bharatrouter.com/v1 and send your key as Authorization: Bearer br-…. Nothing else about your OpenAI-style code changes.
  3. Call a model. Hit /v1/chat/completions with a model id — we use qwen2.5-7b-instruct below because it's small, fast and always on. Swap it for any model in your console catalog (Krutrim models are first-class here).

Starter code

Three complete, runnable snippets that make the same call. Drop your br- key in and go. Each block has a copy button in its corner.

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": "Say hello from BharatRouter in one line."}
    ]
  }'

Hand it to your agent

Using an AI coding agent or IDE — Claude Code, Cursor, Cline, Windsurf, or your own loop? You don't install anything. Point it at BharatRouter with environment variables, or paste the ready-made block below and let the agent wire itself up.

Environment variables

Most OpenAI-compatible agents and tools read these two:

OPENAI_BASE_URL=https://api.bharatrouter.com/v1
OPENAI_API_KEY=br-...

Claude Code (and any Anthropic-SDK client) uses BharatRouter's native /v1/messages surface — point it at the root host, no /v1:

ANTHROPIC_BASE_URL=https://api.bharatrouter.com
ANTHROPIC_API_KEY=br-...

Copy for your agent

Paste this whole block into your agent or IDE chat. It's self-contained — base URLs, a key placeholder, and a plain-English instruction the agent can act on. Replace br-... with your key first.

You are connected to BharatRouter, an OpenAI-compatible AI gateway (India-native,
one API across Krutrim, Sarvam and global models, billed in INR).

Use these settings for ALL model calls:
- OpenAI-compatible base URL: https://api.bharatrouter.com/v1
- Chat endpoint: POST /v1/chat/completions
- For Claude / Anthropic SDKs, base URL: https://api.bharatrouter.com  (native /v1/messages)
- API key (send as: Authorization: Bearer ): br-...
- Default starter model: qwen2.5-7b-instruct  (swap for any model in the catalog)

Example call:
  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":"hello"}]}'

Configure yourself to use this gateway for inference now.

Add BharatRouter to your agent via MCP

BharatRouter is also a native MCP server — a tool-using agent can add it in one step to discover models, run completions, check balance and mint scoped keys. With Claude Code:

claude mcp add --transport http bharatrouter https://api.bharatrouter.com/mcp \
  --header "Authorization: Bearer br-..."

For MCP clients that take a JSON config (Cursor, Claude Desktop, and most others), add this server:

{
  "mcpServers": {
    "bharatrouter": {
      "type": "http",
      "url": "https://api.bharatrouter.com/mcp",
      "headers": { "Authorization": "Bearer br-..." }
    }
  }
}

Machine-readable discovery for autonomous agents: server card · llms.txt · openapi.json.

What's enabled & where to next

The models you can call are the ones your org admin has enabled for your team — you'll see them in the console when you sign in. Need one that isn't there? Request it from the console and an admin will take a look.