Esc to close · ⌘K / Ctrl-K opens search anywhere
BYOK lets you use your own provider accounts through BharatRouter: one API, one SDK, our routing and failover — your key and your billing upstream. It unlocks every provider you bring a key for (Krutrim Cloud, Sarvam, Mistral, DeepSeek, OpenAI, Groq, Together, Fireworks, Cerebras, xAI and more — 50 providers in all), and runs each request on your own negotiated rates.
Want to route to a model running on a deployment you host, not a provider we support? That's BYOE — bring your own endpoint; seeBYOE vs BYOK for which to use.
BYOK requests are free during beta — BharatRouter charges nothing on top; your provider bills you directly.
upstream_keyPass your provider key on a single request. It is used in-flight, never stored, never logged. Combine with provider to pin where it goes:
curl https://api.bharatrouter.com/v1/chat/completions \
-H "Authorization: Bearer br-..." -H "Content-Type: application/json" \
-d '{
"model": "gpt-oss-20b",
"provider": "groq",
"upstream_key": "YOUR_GROQ_KEY",
"messages": [{"role": "user", "content": "namaste"}]
}'Save a key once — on the dashboard's BYOK tab or viaPUT /me/byok/:provider (org owner) — and every request from your org can use it without the key ever appearing in application code:
PUT /me/byok/krutrim
{ "key": "YOUR_KRUTRIM_CLOUD_KEY", "label": "prod", "always_use": false }
→ { "provider": "krutrim", "mask": "krtm-…a9f2", "always_use": false,
"verified": true, "models_discovered": 14 }On save the key is verified live against the provider and encrypted at rest (AES-256-GCM); the plaintext is never returned — only a mask. Re-check a saved key any time with POST /me/byok/:provider/test, remove it withDELETE /me/byok/:provider.
When you save a key, the gateway asks that provider for its model list withyour key and makes everything it finds routable asprovider/model-id:
GET /me/byok/mistral/models
→ { "provider": "mistral", "models": ["mistral/mistral-large-latest", "mistral/codestral-latest", ...] }
# then simply:
client.chat.completions.create(model="mistral/mistral-large-latest", messages=[...])Discovery refreshes on key save and on test; a flaky provider listing doesn't wipe previously discovered models.
BYOK is required: every route runs on your own provider key, and there is no platform key to fall back to. If your key fails, the request fails — surfaced as a key error, so you know which key broke.
upstream_key always wins — used for that call only, never stored.BYOK key failures are attributed to the key, not the provider route — your expired key won't trip the shared circuit breaker.
A saved key is owned by your org, but it carries two independent rights, so you can share the account without handing out the secret:
Use is granted along one flat ladder — there is no workspace nesting:
| Scope | Who can use the key |
|---|---|
| Org (default) | Everyone in the org — every workspace inherits it. |
| Team | Shared by the workspaces under that team. |
| Workspace | A single workspace only. |
Set the tier per key in the Key Vault (owners only), or via the API:
PUT /me/byok/<provider>/grants
{ "use": [ { "scope_kind": "workspace", "scope_id": 42 } ] }
# empty list = org-wide (everyone, the default)
GET /me/byok/<provider>/grants # { use: [...], custody: [...] }Because scope — not a parent/child tree — decides sharing, one key can serve any set of teams and workspaces without duplication, and workspaces stay flat and easy to reason about.
GET /me/byok returns the live list of providers you can bring a key for. Every provider below is BYOK — save your key and its models become routable.
🇮🇳 Krutrim Cloud
🇮🇳 Sarvam AI
OpenAI
OpenRouter
Groq
Mistral AI
DeepSeek
Together AI
Fireworks AI
Cerebras
xAI
Moonshot AI
DeepInfra
Novita AI
SambaNova
Nebius AI Studio
Hyperbolic
NVIDIA NIM
Perplexity
AI21 Labs
Upstage
MiniMax
Alibaba Qwen (Intl)
Z.ai (Zhipu)
Featherless
kluster.ai
Lambda
Chutes
Cohere
Google Gemini
AI/ML API
FriendliAI
Inception (Mercury)
Jina AI
OVHcloud AI Endpoints
Venice AI
SiliconFlow
Baseten
Nscale
Meta Llama API
StepFun
GMI Cloud
Scaleway
DigitalOcean Gradient
Volcano Engine (ByteDance)
Baidu ERNIE
Parasail
W&B Inference
ElevenLabs
GitHub Models
Full details per provider — residency, live catalog routes — on theproviders page.
| Code | HTTP | Meaning |
|---|---|---|
bad_key | 400 | The submitted key doesn't look like a valid key for that provider. |
unknown_provider | 400 | No such BYOK provider id — check GET /me/byok. |
byok_disabled | 503 | BYOK is not configured on this deployment. |