What is BYOK on AnyRouter?
Bring Your Own Key (BYOK) lets you attach your own upstream provider keys to your AnyRouter account. When a request matches a model one of your keys can serve, AnyRouter forwards the call on your key and you pay the provider directly at their list price. You keep every AnyRouter feature — one unified API, logs, analytics, presets, routing, app attribution — on top of accounts you already have.
AnyRouter exposes BYOK for more than 60 providers: OpenAI, Anthropic, Google AI Studio, Groq, NVIDIA NIM, Z.ai, Ollama Cloud, and enterprise endpoints like Azure OpenAI, Bedrock, and Vertex AI. The full provider-by-provider setup guide lives at /docs/features/byok-providers.
Does AnyRouter charge markup on BYOK?
No. AnyRouter charges nothing for BYOK traffic — no per-request fee, no surcharge, no minimum. Requests served through your own provider keys never deduct AnyRouter credits, on any plan. You only ever pay your provider. If every BYOK key for a provider is exhausted, requests can optionally fall through to pay-as-you-go credits so work keeps flowing.
- $0 markup on your own keys — you pay the provider, nothing to AnyRouter.
- Keep your own rate limits — you route on your account's quota, not a shared pool.
- Automatic failover — add more than one key per provider and a burned key (401/429) is quarantined while the next takes over.
- Load-balancing strategies — Fallback, Round Robin, Weighted, or Random per provider.
- Per-key budgets — cap monthly spend on any key so a runaway loop can't drain a provider account.
Route across your whole key pool
Once you've added keys, three built-in ids route across all of them without naming a specific model — and because they only ever use your own keys, they never spend AnyRouter credits:
| Model id | Routes to |
|---|---|
| anyrouter/byok | Every model your configured keys can reach |
| anyrouter/coding | The coding-capable subset |
| anyrouter/agent | The tool / function-calling subset, built for agents |
curl https://anyrouter.dev/api/v1/chat/completions \
-H "Authorization: Bearer $ANYROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "anyrouter/coding",
"messages": [{ "role": "user", "content": "Refactor this function" }]
}'Donate idle keys, earn credits, go free
Most provider quota sits idle most of the time. Flip the donate toggle on an eligible BYOK key and every request the shared pool routes through it adds up to 8% of that request's notional token cost to a pending balance you can claim anytime. Donating one working key also auto-grants the Go plan for free, for as long as that key stays active — so you skip the $2/mo. You keep first call on your own key; the pool only ever uses spare capacity, and you can opt out instantly.
- Earn up to 8% back on every token a donated key serves — 5% on Go, 8% on Pro/Max, capped at $1 per key per UTC day.
- Eligibility is about routing, not ToS — the toggle appears once AnyRouter can route to that provider. You're responsible for confirming your provider's terms permit sharing the key.
- Explicit, recorded consent — nothing is enrolled automatically.
- 429 auto-pause and instant opt-out from the dashboard.
See the pool in numbers at /pool, donate at /donate, and read the reward mechanics in /blog/shared-key-pool.
How are my keys protected?
BYOK keys are sensitive credentials and AnyRouter treats them that way. They're encrypted at rest with a per-row salt, so a leak of one key's ciphertext never weakens another. They're write-only in the UI — after save only an alias and a masked identifier are shown. They're stripped from request and response logs, validated live on save (then the validation response is discarded), and only ever sent to the upstream provider they're scoped to.
Route the provider keys you already pay for through one API at $0 markup.
Connect a keyRelated posts
Bring your own keys — every provider behind one API
Connect the provider keys and subscriptions you already pay for, route them through one OpenAI-compatible URL with automatic failover, and — soon — earn credits back by donating idle quota to the shared pool.
Donate an idle provider key, earn credits back: a walkthrough
Hold a provider key with headroom to spare? Donate it to the shared pool in two clicks. Every token the pool serves through your key earns pending credits — up to 8% of its notional cost, tiered by plan — claim them anytime or turn on auto-claim. Here's the step-by-step.
Get a free NVIDIA API key and route it through one URL
NVIDIA hands out a free API key with credits and no card required. Attach it to AnyRouter as BYOK and every NVIDIA-hosted model runs through one OpenAI-compatible endpoint — at $0 markup. Here's the five-minute setup.
Route your first request in 2 minutes
Start free with your own keys, or top up and pay per token. Get $4/mo in credits and free models on Go — $2/mo, or free when you donate a provider key.
Start free