Esc to close · ⌘K / Ctrl-K opens search anywhere
Pin data residency so requests fail closed rather than silently routing offshore.
data_policy: "india_only"SovereigntyBeginner5 min
For regulated or sensitive workloads, "probably stayed in India" is not good enough. Set data_policy: "india_only" and the gateway will only consider India-resident routes — if none is available, the request fails closed with no_route rather than quietly going abroad.
You'll use: the data_policy residency extension. See also the compliance angle in Handle PII under DPDP.
curl https://api.bharatrouter.com/v1/chat/completions \
-H "Authorization: Bearer br-..." -H "Content-Type: application/json" \
-d '{
"model": "gemma-4-e4b-it",
"messages": [{"role": "user", "content": "Process this customer record ..."}],
"data_policy": "india_only"
}'When you ask for a model that has no India route, you get a clean no_route error instead of a leak — handle it explicitly:
from openai import OpenAI, APIStatusError
client = OpenAI(base_url="https://api.bharatrouter.com/v1", api_key="br-...")
try:
r = client.chat.completions.create(
model="gemma-4-e4b-it",
messages=[{"role": "user", "content": "..."}],
extra_body={"data_policy": "india_only"},
)
except APIStatusError as e:
if e.body and e.body.get("error", {}).get("code") == "no_route":
# fall back to a human, a queue, or a different model — never offshore
...BYOK caveat: if you route to a non-India upstream via BYOK, residency no longer holds — india_only governs platform routes, not your own offshore keys.
More recipes in the Cookbook, or see the fullAPI reference.