How AnyRouter Chooses a Credential
The order AnyRouter tries your own keys, the shared pool and credits, and what happens when a key fails.
A request is served by your own provider key, the community shared pool, or your AnyRouter credits. Your own keys are always tried first; the pool is extra capacity for donors and paid plans; credits are the catch-all. BYOK requests are never charged to your credits, whether they succeed or fail.
| Source | Who pays the upstream | Requires |
|---|---|---|
| Your BYOK key | You, at list price | A key on the BYOK page |
| Shared pool | A donor's account | You donated a key or hold a paid plan |
| AnyRouter credits | AnyRouter | Nothing, the default |
flowchart TD
A[Request] --> B{Header override?}
B -->|Yes| C[Use that key only]
B -->|No| D{Always-use key set?}
D -->|Yes| E[Try always-use keys]
D -->|No| F{You hold a key for this provider?}
F -->|Yes| G[Try your keys by strategy]
F -->|No| H{Eligible for shared pool?}
G -->|All fail| H
H -->|Yes| I[Try a donated key]
H -->|No| J[Bill AnyRouter credits]
I -->|Fails too| JOrder
- Your keys. Pin one key per request with the
X-AnyRouter-BYOK-Keyheader, or mark a key Always use. See BYOK: Routing precedence. - Choosing among your keys. A per-provider strategy (Fallback, Round Robin, Weighted or Random), set in Dashboard → BYOK. See Load balancing multiple keys.
- Shared pool, if you have no working key for the provider and are eligible.
- Credits, at the provider's list price with no markup, if nothing above applies or every attempt failed.
When a key fails
One failed attempt does not fail the request; a retry can land on another key of the same provider before AnyRouter moves to the next source.
- Rate limited. The key is set aside for a short cooldown, then returns to rotation. It is not marked broken.
- Rejected (invalid or revoked credential). Parked the same way, so it is not tried until you fix it.
- Bad request. Problems in the request itself are not held against the key.
For candidate ordering and provider preferences see Smart Routing; for request-rate ceilings see Rate Limits.
AnyRouter routes requests to third-party models. Models and outputs are provided as is, with no warranty; you use them at your own risk. Disclaimer