Routing keys
One key that authenticates your apps and carries the routing plan: which providers serve each request, in what order.
Read as MarkdownA routing key is the API key your apps and agents send on every /v1 request, and it carries the routing plan for those requests: an ordered list of lanes (a Codex subscription, a Claude Code bridge, or a saved provider API key), which the gateway works through until one serves the request. The key decides where the work happens. It starts with pllm_ and goes wherever OPENAI_API_KEY goes.
Why the key carries the routing
- Change providers without touching code. Your app sets
OPENAI_API_KEYonce. Every routing change after that happens in the dashboard and takes effect on the next request, with no deploy. - Use what you already pay for. Put subscription capacity first and metered API keys behind it. The API key bills only when the subscription runs out of capacity.
- Keep serving through provider trouble. In fallback mode, a lane that fails is retried as many times as you set, then the request moves to the next lane and your app still gets its answer. A Codex seat can be set to move on only when its usage limit is reached, so an overloaded backend does not turn into an API bill.
- One key per app or client. Each key has its own budget and its own usage trail, so you can cap and attribute spend per client.
Example layouts
Codex with OpenAI fallback is the everyday setup:
1. Codex your ChatGPT subscription; serves everything it can at $0 metered
2. OpenAI gpt-4o-mini on your API key; catches requests when Codex is out of capacity
Claude Code bridge with Anthropic fallback is the same idea for Claude:
1. Bridge Claude Code on a server you own, backed by your Claude subscription
2. Anthropic your Anthropic API key as the safety net
Classifier routing picks the lane by task. You write the instructions (“code tasks go to Codex, everything else to mini”) and a small model applies them to each request:
1. Codex code generation and review
2. OpenAI gpt-5-mini for everything else
Create and manage keys under Routing keys in the dashboard, or through the API with an account token. The raw key is shown once at creation; you can regenerate it any time.
Routing modes
- Fallback (default): the first lane serves every request. When a lane fails, it is retried as many times as its “Retry on failure” setting says, then the request moves to the next lane. A Codex lane with “Only move on when the usage limit is reached” turned on moves the request past that seat only when the seat has reached its usage limit; any other failure ends the request after the retries, so an overloaded backend never spends your API key. Each Codex lane uses the seat you picked for it.
- Classifier: a small model reads each request and picks the lane, following instructions you write. Configure the classifier provider, model, and instructions on the key. If you have more than one saved key for that provider, “Key used for classification” picks which one runs the classifier; left unset, the oldest saved key for that provider is used.
Lane settings
Each lane can carry settings the gateway applies to every request it serves, unless the request sets its own:
- Thinking effort (Codex Hosted and OpenAI lanes): Off, Low, Medium, High, Very high, or Maximum. Higher effort can improve harder answers, but it is slower and uses more of your allowance or more tokens.
- Answer length (Codex Hosted only): Short, Medium, or Long.
- Priority speed (Codex Hosted only): about 1.5x faster, and uses your ChatGPT allowance faster.
Set them per lane in the dashboard, or over the API with reasoning_effort, verbosity, and service_tier on the lane (Routing keys API).
Budgets
Give a key a monthly budget in USD and it stops serving once metered spend reaches the cap. Subscription-backed lanes (Codex, bridge) bill at $0, so by default they don’t eat the budget; the dashboard tracks what they would have cost on the API instead.
The three key types
| Key | Prefix | Where it works |
|---|---|---|
| Routing key | pllm_ | Inference on /v1/*. Goes in OPENAI_API_KEY. |
| Account token | sk_ (read+write), rk_ (read-only) | Management API under /v1/organizations/* and the CLIs. |
| Bridge token | pllb_ | Auth between ProxyLLM and your own bridge server. |
Give production apps only routing keys. Give agents and outside tools a read-only rk_ account token if they just need stats (Authentication).