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.

SourceWho pays the upstreamRequires
Your BYOK keyYou, at list priceA key on the BYOK page
Shared poolA donor's accountYou donated a key or hold a paid plan
AnyRouter creditsAnyRouterNothing, 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| J

Order

  1. Your keys. Pin one key per request with the X-AnyRouter-BYOK-Key header, or mark a key Always use. See BYOK: Routing precedence.
  2. Choosing among your keys. A per-provider strategy (Fallback, Round Robin, Weighted or Random), set in Dashboard → BYOK. See Load balancing multiple keys.
  3. Shared pool, if you have no working key for the provider and are eligible.
  4. 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