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

Migrate from OpenRouter

← All migration guides

Aggregatorone-line swap

Already OpenAI-compatible — the same one-line swap, with India residency and INR on top.

The change

Before — OpenRouter

from openai import OpenAI

client = OpenAI(
    base_url="https://openrouter.ai/api/v1",
    api_key="sk-or-...",
)

After — BharatRouter

from openai import OpenAI

client = OpenAI(
    base_url="https://api.bharatrouter.com/v1",
    api_key="br-...",
)

What maps to what

OpenRouterBharatRouter
provider.sort: "price" | "throughput"optimize: "price" | "latency" | "uptime" | "auto"
provider.order / allow_fallbacksSaved fallback chains + automatic failover
provider.only / ignoreprovider (pin) / exclude (drop)
HTTP-Referer / X-Title headersNot required — omit them

What you gain

  • Enforceable India data-residency (data_policy: "india_only") — OpenRouter has no equivalent.
  • Native INR pricing; compare it live with /v1/pricing/compare.
  • Krutrim and Sarvam as first-class India-resident routes.

Watch out for

  • Model ids differ — map OpenRouter's vendor/model ids to BharatRouter catalog ids (see catalog).
  • Not every OpenRouter model is on the catalog yet; bring it via BYOK if missing.

Stuck on a migration? Email [email protected], see the FAQ, or keep your accounts and rates with BYOK.