# Routing keys

One key that authenticates your apps and carries the routing plan: which providers serve each request, in what order.

*ProxyLLM docs · https://proxyllm.ai/docs/routing-keys*

A 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_KEY` once. 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, when a lane is rate limited or down, the request moves to the next lane and your app still gets its answer.
- **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](https://proxyllm.ai/dashboard/routing-keys) in the dashboard, or [through the API](/docs/api#account-management) 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. If it hits a rate limit, an exhausted usage window, or an error, the request falls through to the next lane.
- **Classifier**: a small model reads each request and picks the lane, following instructions you write. Configure the classifier model and instructions on the key.

## 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](/docs/api/authentication)).
