BYOK is currently in development. Contact support@arouter.ai to join the beta.
- Zero markup on token costs — pay providers directly at their list price
- Your quota — requests count against your own provider rate limits, not ARouter’s shared pool
- Your data policy — your existing provider agreements and data terms apply
- Unified gateway — still get ARouter’s routing, fallback, and observability on top
How BYOK Works
- You register provider API keys in the ARouter Dashboard
- When ARouter routes a request to that provider, it substitutes your key
- Your account is not charged for token costs (only ARouter service fees, if any)
usage.is_byok: trueis returned in the response
Registering Keys
Add provider keys in the ARouter Dashboard. Supported providers and their key formats:| Provider | Key Format | Dashboard Label |
|---|---|---|
| OpenAI | sk-... | OpenAI API Key |
| Anthropic | sk-ant-... | Anthropic API Key |
| Google (Gemini) | AIza... | Google AI Studio Key |
| Azure OpenAI | Endpoint + Key | Azure OpenAI |
| AWS Bedrock | Access Key + Secret + Region | AWS Bedrock |
| Google Vertex AI | Service Account JSON | Google Vertex AI |
BYOK with Provider Ordering
Combine BYOK withprovider.order to control when your key is used:
OpenAI is in the order list and you have an OpenAI BYOK key registered, ARouter automatically uses your key for that provider.
Partial BYOK
You can register keys for some providers while using ARouter’s shared pool for others:Azure OpenAI
Register your Azure OpenAI endpoint and key:AWS Bedrock
Two authentication options: Option 1: Bedrock API Keys (recommended)Google Vertex AI
Identifying BYOK Requests
Responses includeis_byok: true in the usage object when your key was used:
is_byok: true, usage.cost reflects your direct provider cost (not ARouter markup).
Key Priority and Fallback
| Scenario | Behavior |
|---|---|
| BYOK key registered for provider | Use your key |
| BYOK key registered but provider unavailable | Fall back to ARouter shared pool (unless allow_fallbacks: false) |
| No BYOK key for provider | Use ARouter shared pool |
allow_fallbacks: false + no BYOK key | Request fails with 404 |
Debugging BYOK Issues
Check the Activity page in the Dashboard to see which key was used for each request. Common errors:| Error | Cause | Fix |
|---|---|---|
401 Unauthorized | Invalid or expired provider key | Rotate key in Dashboard Settings |
403 Forbidden | Key lacks required permissions | Check provider IAM settings |
quota_exceeded | Your provider quota exhausted | Upgrade provider plan or remove BYOK to use shared pool |