Esc to close · ⌘K / Ctrl-K opens search anywhere
Fall through Krutrim → Sarvam → a global model automatically, with circuit-breaker failover.
Collections + circuit breakersReliabilityIntermediate10 min
A single provider will have a bad five minutes. A Collection is an ordered, versioned chain of {model, provider} steps; the gateway walks it top-to-bottom and serves the first healthy step, tripping a circuit breaker on the ones that fail.
You'll use: saved fallback chains (Collections) + automatic circuit-breaker failover. Reference: Collections.
Create a Collection in the dashboard (or via the API), then call it by slug. The chain below prefers India-resident routes and only reaches for a global model as a last resort:
| Order | Model | Provider | Why |
|---|---|---|---|
| 1 | gemma-4-e4b-it | krutrim | Cheapest India route, tried first |
| 2 | qwen3-32b | groq | Open-weight fallback (BYOK) |
| 3 | gpt-5-mini | openai | Global safety net |
from openai import OpenAI
client = OpenAI(base_url="https://api.bharatrouter.com/v1", api_key="br-...")
r = client.chat.completions.create(
model="@my-org/resilient-chat", # your Collection slug
messages=[{"role": "user", "content": "namaste"}],
)
# x-br-provider tells you which step actually served the requestHarden it further: add your own endpoint as a ₹0 last step with BYOE, and canary the chain so you're alerted before users notice.
More recipes in the Cookbook, or see the fullAPI reference.