Platform
Gateway and routing
How to set up and run the Token Meter router from the dashboard: who pays for what, auto routing, your own provider keys, routing policies, fallbacks, caching, limits, experiments and the savings it reports.
Related guide: Reduce LLM API costs
The Router screens control what the Token Meter router does with your AI traffic: which model answers each request, what happens when a provider fails, what is cached and which limits apply. This page explains each screen and how to set it up. For the request format your developers send (fields, headers and errors), see Router.
Only traffic sent through the router is affected. Usage recorded with the SDKs, OpenTelemetry or billing imports is not routed, so nothing here changes it.
Before you start
- The Owner or Admin role. Nobody else can open these screens. Every change to keys, policies, limits, defaults and experiments is recorded in the audit log.
- An ingest key to test with (a password that lets your app use the router). It starts with
tl_live_…. Create one at Governance › API keys › Create key. It is shown once, so copy it. - Optional: an API key from OpenAI, Anthropic or Google AI Studio, if you want calls to go through your own provider account.
Where things are
Router is in the sidebar (Home view). It has four tabs: Overview, Rules, Caching and Providers. Live status, Router defaults, Routing activity and Experiments are pages linked from them.
| Screen | What it is for |
|---|---|
| Router › Overview | A status line, tiles for requests routed and failed (plus refused, cache hits and saved when there are any), what happened to each request, Latest requests, a Related list, and links to Live status, Activity and Experiments. |
| Router › Rules | How the router chooses (goal, allowed and excluded models); under Advanced: Auto settings, Policies (with Which policy wins? and Add routing policy), Task-based routing, Request handling and Model routing. |
| Router › Caching | Reusing identical and near-identical answers; under Advanced: requests with no temperature, answering retries, prompt and output capture, and Agent Recall. |
| Router › Providers | Your provider keys; under Advanced: Model capabilities and the LiteLLM gateway, capabilities and routes. |
| Live status (the Live status link on Router › Overview) | Rate & concurrency limits (with Add limit), and, when there are any, requests in progress, providers paused after errors, rules paused after errors and budget enforcement. |
| Router defaults (the Defaults link on Router › Rules) | Cheaper batch jobs and the savings baseline. |
| Routing activity (the Activity link on Router › Overview) | Decisions, batch jobs, routing savings, token savers and cheaper model suggestions. |
| Experiments (the Experiments link on Router › Overview) | Prompt experiments, live model experiments and model evaluations, in one list. |
Set up routing
On a paid plan a new workspace can route traffic straight away with auto routing. Auto runs on Token Meter's own OpenAI, Anthropic and Google keys and needs no setup at all. On the Free plan auto does not run on Token Meter's keys unless the workspace pays from router credits, so add your own provider key (step 4) first. Steps 1 and 2 get your first request through. Steps 3 and 4 are for calling a model by name, which runs on your own provider key.
1. Send a first request with auto routing
- Create an ingest key at Governance › API keys › Create key, and copy it.
- In a terminal, store it in an environment variable:
export TOKEN_METER_KEY=tl_live_…(on Windows PowerShell:$env:TOKEN_METER_KEY="tl_live_…"). - Run the request below.
"model": "auto"tells the router to choose the model. Auto on Token Meter's keys needs Growth or above, or router credits; on Free it gets402 platform_keys_require_paid_plan, so add your provider key under Router › Providers (Add provider key) and send"model": "gpt-4o-mini"instead.
curl -i https://router.timewastevc.com/v1/chat/completions \
-H "Authorization: Bearer $TOKEN_METER_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "auto", "messages": [{"role": "user", "content": "Say hello in five words."}]}'You should see a 200 status, a short answer, and headers such as x-tokenmeter-model (the model that answered) and x-tokenmeter-route (the goal auto used).
From code, point the OpenAI SDK at the router. Install it with npm install openai, save this as hello.mjs and run node hello.mjs:
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://router.timewastevc.com/v1",
apiKey: process.env.TOKEN_METER_KEY,
});
const reply = await client.chat.completions.create({
model: "auto",
messages: [{ role: "user", content: "Say hello in five words." }],
});
console.log(reply.choices[0].message.content);The OpenAI SDK's address ends in /v1. For Python, the Anthropic SDK and coding tools, see Router.
2. Check what happened
Each request becomes a decision. Open Routing activity (the Activity link on Router › Overview), or look at Latest requests on Router › Overview. The Decisions table on Routing activity shows:
| Column | Shows |
|---|---|
| Asked for, Used | The model asked for and the model that served it. |
| Policy | The policy version, such as v3, or none. Shown when any decision in the list has a policy. |
| Latency | Provider time in milliseconds. |
| Result | Empty when completed; otherwise failed, rejected, settlement_pending (the provider answered and the usage is recorded; it is reconciled shortly) or reserved (still running). |
| Why | Why this model, in plain words, for example Auto, Model was named in the request or Backup model used. Other sections of this page name the underlying reason code, such as policy_fallback. |
| Scope | The request's action and feature. Shown when any decision has one. |
The usage also appears with your other usage, with exact tokens, cost and the attribution fields the request carried.
3. Optional: call a model by name
To ask for a specific model (for example gpt-4o-mini) instead of auto, do two things: approve the model (this step) and store your own key for its provider (step 4). A named model runs on your own provider key, unless the workspace pays from Token Meter credits (then it runs on Token Meter's keys, except Claude Code traffic and async batches). Until the model is approved, the router answers 400 model_capability_not_configured. Without your key for its provider, it answers 424 provider_not_configured. Auto routing needs neither.
- Open Router › Providers and open Advanced.
- Under Model capabilities, choose Add capability.
- Pick the Provider model from the list of priced models.
- Enter Max context tokens and Max output tokens. Take them from your provider's model page.
- Tick Tools, Structured output and Vision only if the model supports them.
- Choose Save capability. The model appears in the list with an Edit button. Saving the same model again overwrites it.
The router checks every request against this record. Tools, response_format and images need the matching box ticked. The output cap must fit Max output tokens, and the prompt plus the output must fit Max context tokens. Enter only what you have checked.
Send the bare model name, such as gpt-4o-mini, not openai/gpt-4o-mini. With no policy, the router picks the provider from the name: a name containing claude goes to Anthropic, one containing gemini or gemma goes to Google, and anything else goes to OpenAI. LiteLLM is reached only through a policy.
4. Add your own provider key
A new workspace has no provider keys, and Router › Providers says No provider keys yet. That is fine for auto routing on a paid plan. Everything else (a model you call by name, a routing policy, tiered routing, experiments, batches) runs on your own account with that provider, so it needs your key.
- In your provider's console, create an API key: OpenAI at
platform.openai.com/api-keys, Anthropic atconsole.anthropic.com/settings/keys, Google ataistudio.google.com/apikey. - In the dashboard, open Router › Providers.
- Choose Add provider key and pick the provider.
- Paste the key into Inference API key and choose Store key. The provider appears in the list with the date it was added.
To replace a key later, choose Rotate on its row. Add provider key is hidden once every provider has a key.
- Keys are encrypted and cannot be read back. Each provider has one key; rotating replaces it.
- Your provider bills you for calls made on your key. Token Meter's keys are used for auto routing only, unless the workspace pays from Token Meter credits.
- For Google, use a Gemini API key from Google AI Studio. You cannot store your own Vertex AI service account.
- Billing-admin keys used for billing imports are never reused for routing.
Who pays for what
Every routed call goes out on some provider key. Which key depends on the kind of request.
| Traffic | Whose key, and the limit |
|---|---|
Auto routing (model: "auto") | On the Growth, Scale and Enterprise plans, always Token Meter's keys, even if you stored your own. Each workspace has a monthly allowance of $25 per calendar month (UTC). On the Free plan auto does not run on Token Meter's keys: an auto request gets 402 platform_keys_require_paid_plan unless a routing policy sends it to a model on your own key. A workspace that pays from router credits runs auto on Token Meter's keys on any plan, with no allowance: the credit balance is the limit. The lines under Router › Rules › Advanced › Auto settings show your allowance and how much is used. It covers auto's answers and the classifier calls auto makes. When it runs out, auto requests get 402 auto_monthly_limit_reached until the 1st of the next month. Requests that name a model are not affected. |
| Auto routing's sampled checks | Token Meter runs and pays for them, up to a monthly limit Token Meter sets. They never count toward your allowance, and there is nothing to set. |
| Everything else: named models, routing policies, tiered routing, canaries, experiments, async batches, model evaluations | Your own key for that provider, from Router › Providers. Your provider bills you, and no allowance applies. With no key for the provider, the router answers 424 provider_not_configured. On Token Meter credits these calls run on Token Meter's keys instead, except async batches and Claude Code traffic: see Credits on the Router page. |
| The router's helper calls: the AI task classifier, the guardrail's AI judge and similarity check, semantic-cache embeddings | Your own key too, on every request, auto requests included. With no key for the provider they need, they are skipped: the classifier falls back to keyword rules, the guardrail to its rules, and the semantic cache does not answer. The request itself still goes through. |
Your named traffic stays on your key
Unless the workspace pays from Token Meter credits, a call that names a model is never sent to Token Meter's OpenAI, Anthropic, Google, Amazon Bedrock, Azure OpenAI or Vertex AI accounts. Thex-tokenmeter-endpoint response header names the endpoint that answered; your own key shows as own key.Auto routing
Send auto as the model and the router picks a model for each request, by the kind of task and how hard it is. It picks from current models of OpenAI, Anthropic and Google. You turn it on in your app's code, in the model field of each call. There is no dashboard switch that moves an app onto auto: a request that names a model gets that model. A first request is shown in Set up routing.
Model names
| Send | Means |
|---|---|
auto | The workspace's default goal, set under Goal on Router › Rules. |
auto:cheap (or auto:cost), auto:balanced, auto:quality | This goal for this request. cheap leans on cheaper models, quality always uses the strongest model, balanced sits between. |
auto:fast | The default goal, with speed first. It picks the same model as auto; it never raises reasoning effort, and it tries the endpoint with the fastest first byte first. It is a hint on the goal, not a goal of its own: the response says x-tokenmeter-route: auto:balanced (or whichever goal is the default) and x-tokenmeter-speed: fast. The x-tokenmeter-speed: fast request header does the same with any auto name. |
tokenmeter/auto, tokenmeter-auto | The same names with a prefix, for tools that reject a bare auto, such as tokenmeter/auto:quality. Any other suffix is refused with 400 unknown_auto_goal. |
Auto routing settings
Open Router › Rules. How should the router choose? sets the goal and the model lists; Advanced › Auto settings holds the rest and saves with the same Save changes. Lines under Auto settings show this month's auto allowance (on Free, why auto is refused), this month's routed requests, how many models auto can pick from and what your settings did.
| Row | What it does |
|---|---|
| Goal | Used when a request says just auto: Lowest cost, Balanced or Best quality. |
| Use instant mode | Off by default. When on, easy task types go to a cheaper model from the first request; with Lowest cost, harder ones do too. Those answers carry x-tokenmeter-quality-verified: false until checks back them. Sampled checks move a task type back up when the cheaper model keeps losing. It does not apply to the Best quality goal. |
| Shared check results | Share and use (default), Use only or Off. Lets auto move to a cheaper model sooner, based on checks from other Token Meter workspaces. Only verdicts are shared (task type, the two models, which answer won), never prompts, answers or who sent them. |
| Allowed models | Auto picks only from these. Leave empty for any model. You can pick a whole provider, or type a pattern such as gpt-4o*. |
| Excluded models | Auto never picks these, even when they are allowed. |
| Lock model lists | Refuse requests that send their own allowed_models or excluded_models (400 model_lists_locked). |
How it picks
- Each request is classified by task type and difficulty. A request can state both itself with
task_typeandtask_difficulty, trusted as far as Request handling allows. - For each task type and goal, auto keeps a ladder of models. A task type starts on the strongest model. It moves to a cheaper one only after that model has passed judged sampled checks. Harder requests climb the ladder.
- Reasoning is the exception, under the Lowest cost and Balanced goals. It starts on the newest Claude Sonnet whatever its difficulty, and goes to the newest Claude Opus only after an explicit failure. That means the Sonnet call failed or could not take the request, Sonnet refused or returned an empty answer (requests that are not streamed only), or the conversation keeps failing (the
strugglingrule). A harder prompt does not move it, though a conversation already on Opus for another task can stay there. After an escalation the response carriesx-tokenmeter-escalationwith the reason, and Routing activity shows Escalated after failure. When Sonnet refused or returned nothing, that answer is still paid for and counts toward the platform allowance. Opus is asked only when both answers fit the amount held for the request; otherwise Sonnet's answer is returned. - When the model fails, the request moves up the ladder, never down. Only a model that is gone or refuses a parameter may be replaced by the nearest other model on the ladder, which can be cheaper.
- A conversation stays on its model between turns. The router recognises a conversation by the
x-tokenmeter-session-idheader, else asession_idin the body, elsex-tokenmeter-rollout-key, elsetrace_id, else its opening messages (the system prompt and the first user message). Sendsession_idto be sure. Without a session id, a conversation's first turn is decided on its own and its model is kept from the second turn on, so two people who open with the same words are never held on each other's model. It keeps its model under one goal: the same conversation asked under another goal (auto:cheapafterauto:quality, or plainautoafter the workspace's default goal changed) is decided for that goal, with no weighing of the provider's prompt cache. - Auto runs on Token Meter's keys over Token Meter's model list. You need no provider key or capability record for the models it picks. See Who pays for what for the allowance.
Request fields
{
"model": "auto:balanced",
"messages": [{ "role": "user", "content": "Summarise this ticket" }],
"allowed_models": ["anthropic/*", "gpt-4o*"],
"excluded_models": ["anthropic/claude-opus-*"],
"max_cost_usd": 0.05,
"session_id": "ticket-4821"
}| Field | What it does |
|---|---|
allowed_models, excluded_models | Narrow what auto may pick for this request: up to 20 patterns each, provider/model or a bare model name, with * as a wildcard. They can only narrow the lists set on Router › Rules, never widen them. Sent with a named model they are refused (400 model_lists_only_apply_to_auto). When they leave nothing, the request gets 400 auto_routing_no_model_in_lists. |
max_cost_usd | A per-request cost ceiling. A model whose worst-case cost is above it is skipped for one that fits, rather than the request being refused. |
models | Not allowed with auto (400 models_not_supported_with_auto): auto picks its own fallbacks. |
What comes back
| Response header | Shows |
|---|---|
x-tokenmeter-route | The goal used, such as auto:balanced, or policy when a routing policy served the request. |
x-tokenmeter-model | The model that served the request. |
x-tokenmeter-route-reason | Why that model: strongest (no cheaper model proven yet), assignment or ladder (the task's rung), pinned_conversation (the conversation kept its model, and this turn alone would have gone to a different one; a pinned turn that would have got the same model anyway reads assignment or ladder), struggling (one rung up because the conversation's tool calls keep failing), constraint_fallback (only a model below the task's rung can serve the request's tools, images or size), failover (the first pick failed), policy_override (a routing policy served it) or evaluation_canary (a model evaluation served it). |
x-tokenmeter-task-type | The task type the request was classified as. |
x-tokenmeter-effort | The reasoning effort used, when auto set one. |
x-tokenmeter-speed | fast when the request asked for speed (auto:fast or the x-tokenmeter-speed: fast request header). Absent otherwise. |
x-tokenmeter-quality-verified | false when the model has not passed checks for this task yet (instant mode, or a reasoning request on Sonnet). |
x-tokenmeter-escalation | Why a reasoning request that started on Sonnet was answered by Opus: the Sonnet call's outcome (such as provider_error, network_error, refused_answer or empty_answer) or session_struggling. |
x-tokenmeter-attempts | How many attempts the router made, when more than one. See Fallbacks for what counts. |
x-tokenmeter-endpoint | Where the request was served (see Where a model is served). |
When auto does not apply
- A routing policy that matches the request wins and sends it to the policy's target. Leave
autoout of policy scopes unless you mean that. - Batches (
/v1/batches) need a named model:400 auto_routing_not_supported_for_batches. - Native Anthropic requests (
/v1/messages) pick among Anthropic models only. - If Token Meter has turned auto off for your workspace, a line under Router › Rules › Advanced › Auto settings says so and requests get
400 auto_routing_disabled. There is no switch for this; contact support. - When governance or the request's needs (tools, images, context size) rule out every model, the request gets
400 auto_routing_no_allowed_model.
Routing policies
A policy sends matching requests to a model you choose. To create one, open Router › Rules, open Advanced, and under Policies choose Add routing policy. Fill in the fields below and save.
| Field | What it does |
|---|---|
| Tiering | Off: route to the Target model, or with no target keep the requested model. Automatic: classify each request and route it by its task's tier assignment (see Tiered routing); target and fallback are ignored. |
| Tasks with no tier assignment | Automatic only. Use the requested model (the default on the Add routing policy form; a caller that sent auto gets the baseline model from Router defaults), a fixed model you pick, or Refuse the request (400 tiered_routing_not_configured). A policy created by approving a tiered-routing recommendation on Improvements, or saved before this setting existed, refuses. A policy can't be edited: to change this, retire it and add a new one, or pin a model for the task under Router › Rules › Advanced › Task-based routing. |
| Quiet | Asks for concise, answer-first responses that keep requested detail. It adds a short instruction to the prompt. |
| Logs | Shortens long tool results that look like logs before sending. A result is shortened only when it is at least 16,000 characters or 120 lines and has a few log-style lines in it (errors, warnings, test results or timestamps); anything smaller is sent as it is. Repeated identical lines are folded into one first. It keeps the first and last 35 lines and up to 50 lines from the middle, in their original order: failure lines (FAIL lines, errors, the first frames of a stack trace) with a few lines around each, then lines about failures, denials and timeouts, then warnings, while room is left. In a very long log some failures can be left out, and failures that differ only in their numbers share one window. |
| Requested model, Action, Feature | What the policy matches. Each is an exact match; blank matches anything. |
| Priority, Rollout % | Higher priority is tried first. Rollout sends that share of matching traffic (1 to 100). |
| Target model, Fallback model | Chosen from models with a capability record. With tiering off, leave the target empty to apply Quiet or Logs to whichever model each request asks for. A policy with neither switch needs a target. |
| Max request cost USD | A per-request cost ceiling for traffic this policy serves. |
| P95 latency guardrail ms, Min success rate 0–1, Min quality score 0–100 | Optional extra conditions for pausing the policy automatically. |
Creating or resuming a policy checks that its target and fallback providers have a key and a capability record, that a cost ceiling has prices to estimate against, and that an Automatic policy set to refuse unassigned tasks has tier assignments to use.
How the router picks a policy. It takes the enabled policies whose requested model, action and feature match. It orders them by priority, then newest first, and uses the first whose rollout includes the request. Rollout buckets are stable per policy version, API key and rollout key (the X-TokenMeter-Rollout-Key header, else customer_ref, user or trace_id), so one conversation stays on one model. When nothing matches, the requested model is used as sent. The Model routing card can still stop a policy from moving a request.
Matches every request. A policy with no requested model, action or feature applies to every request, including requests for other providers' models, and carries this badge. A policy that can never win, because a higher one always matches first, is marked Never reached: vN always wins first. Requests to /v1/messages that a policy would send to a non-Anthropic model are refused, and the policy says so.
Which policy wins? (next to Add routing policy under Router › Rules › Advanced › Policies) opens a tester. Enter a requested model, the endpoint (OpenAI-compatible or native Anthropic), action, feature, API key and rollout key, and choose Check. It shows the model that serves the request, the matching policies in the order the router tries them, and any live experiment or evaluation canary that applies. It uses the same code as the router. Fallbacks, open circuits and monthly-budget downgrades can still change the model at request time.
Changing a policy. Policies are versioned and not edited in place.
- Ramp raises the rollout on the same version. People already in the rollout stay in; lowering is not offered.
- Retire stops the policy.
- Resume turns a paused policy back on after the same checks as creation.
Automatic pause. A new policy pauses itself when, in one hour with at least 50 decisions, its failure rate goes above 5%, its fallback rate above 10%, or its p95 latency above the optional guardrail (or success rate or quality score below theirs, once enough outcomes are linked). It then shows Paused after errors, and the trip is listed under Rules paused after errors on Live status. Check the decisions before choosing Resume.
Cost ceilings. Before calling the provider, the router works out the request's worst-case cost: the exact input token count plus the output cap (the request's max_tokens or max_completion_tokens, else the model's Max output tokens). If that is above the tighter of the policy's Max request cost USD and the workspace's Per request, at most (Settings › Workspace › Workspace defaults), the request is refused with 402 policy_max_request_cost_usd_exceeded or 402 org_max_request_cost_usd_exceeded and both amounts. Callers do not need to send anything for this.
Model routing
The Model routing card under Router › Rules › Advanced sets limits that override every policy. A model family groups a model's versions: Claude Opus 4 and Opus 5 are one family, GPT and GPT mini are two. Choose a setting per family, then Save changes.
| Setting | What it does |
|---|---|
| Route normally | The default. Policies, tiers and experiments may move requests to and from this family. |
| Never route away | A request that names a model in this family is served by that model. No policy target, tier, evaluation canary or live experiment moves it. The matching policy's Quiet, Logs and cost cap still apply, and its fallback is used only if it is in the same family. |
| Never route to | Routing never picks this family for a request that did not name it: not as a policy target or fallback, tier assignment, canary or experiment. A caller can still name the model directly. To block a model outright, use a governance policy. |
Cache-aware switching (Off, Shadow: record only or On). On a tiered policy, and for auto routing, each turn of a conversation is classified on its own, so a conversation can move to a cheaper model mid-way and lose the provider's prompt cache. With this on, a turn stays on the current model while that cache is warm (about five minutes) unless switching would save at least 5% over the next three turns. A cached prefix shorter than 1,024 tokens counts as no cache. A move to a pricier model always goes ahead. Shadow records what it would have done without changing any route. A conversation is recognised the same way as for auto routing: by the x-tokenmeter-session-id header, else a session_id in the body, else x-tokenmeter-rollout-key, else trace_id, else its opening messages.
Prompt caching on Claude (Off, Conversations only or Every request; off by default). Claude reads from its prompt cache only what a request marks for caching, and a request in OpenAI's format (/v1/chat/completions) has no way to mark anything, so a conversation the router sends to Claude pays full input price on every turn. OpenAI and Gemini models cache long prompts by themselves. With this on, the router marks the end of the system prompt and the last message of an OpenAI-format request it sends to Claude, so the next turn reads them from the cache. A part is marked only when it is long enough for the model to cache (512 to 4,096 tokens, depending on the model). Writing to the cache costs 1.25 times the input price and reading it a tenth or less, so a marked prompt that is never read again costs a quarter more once. Conversations only marks a request that carries an earlier assistant turn, or whose caller names the conversation (x-tokenmeter-session-id, session_id, x-tokenmeter-rollout-key or trace_id). Every request also marks the system prompt of every other request, which pays off when many requests share one system prompt. Requests to /v1/messages keep their own markers and get none added, a request that already carries markers is left as it is, and Claude on Amazon Bedrock and Vertex AI is not marked. The x-tokenmeter-cache-markers response header says how many markers were added.
Fallbacks, circuit breaker and timeouts
Fallback. When a model fails, the router can try another one. One request makes at most three attempts: the first model and up to two more. It tries, in order:
- the policy's Fallback model;
- then any models the request lists in
models(up to 5); - for an auto request with neither, the next models up its ladder.
A fallback is tried when the model fails at the network level, times out, returns 408, 429, 500, 502, 503 or 504, its circuit is open, or the provider account has no room left. It is also tried when the router could not build the request for that provider. It is also tried when the provider says the request is too long for the model (then only a model with a larger context window is tried), except for Claude Code, which gets the error back so it can compact the conversation. A model that is retired or refuses a parameter gets a fallback only when the router chose it (auto, a tier, a policy target); a model the caller named is the caller's to fix. The decision's reason becomes policy_fallback, and x-tokenmeter-attempts says how many attempts the router made. That can be more than the number of models: another endpoint of the same model, or a retry of the same model, counts too. A model skipped without a call (its circuit open, its account out of room, or no endpoint meeting the provider options) also counts as an attempt.
The fallback is skipped when:
- the request has a
run_id; - a governance token or cost cap applies to it, or a governance policy blocks the fallback model;
- the fallback's worst-case cost is higher than the amount the request was already checked against;
- it is a
/v1/messagesrequest and the fallback is not an Anthropic model; - the Model routing card says Never route to for the fallback's family;
- the fallback has no capability record that fits the request, or no key for its provider (it is passed over and the next one is tried);
- an evaluation canary served the request (it never gets auto's ladder, only a policy's or the request's own fallbacks);
- a live experiment's treatment served the request (it falls back only to the control model);
- the response has already started streaming (the choice is made before the first byte is sent).
Other provider errors are returned as they are. The router does not retry the same model on the same endpoint, but it may try the same model on another endpoint (see Where a model is served).
Caller controls. A request that names a model can add its own fallbacks with models: up to 5 entries, each a bare model name or provider/model. Every entry still needs a capability record and must pass governance and cost checks. To try only the first model (not even the policy's fallback), send "provider": { "allow_fallbacks": false }. A malformed list gets 400 invalid_models.
{
"model": "gpt-4o-mini",
"models": ["anthropic/claude-haiku-4-5"],
"messages": [{ "role": "user", "content": "Summarise this ticket" }]
}{
"model": "gpt-4o-mini",
"provider": { "allow_fallbacks": false },
"messages": [{ "role": "user", "content": "Summarise this ticket" }]
}Circuit breaker. Three provider errors (408, 500, 502, 503 or 504) or network failures in a row on one model, each within two minutes of the last, open its circuit for 60 seconds. Rate limits (429) do not count. Any other answer, such as a 4xx or a 501, shows the provider is up and resets the count. An answer saying the model is gone neither counts nor resets. While a circuit is open, requests go to a fallback if there is one, and otherwise fail with 503 provider_circuit_open and Retry-After: 30. A successful call closes it. Each workspace has its own circuits. On Token Meter's keys there is also a shared circuit per model, counted across every workspace on that key, so a circuit can open because of failures elsewhere. Providers paused after errors on Live status shows it either way, and Router › Overview shows a warning while any circuit is open.
Timeouts. A non-streaming call has 30 seconds. A streaming call has 30 seconds to start, 60 seconds between chunks and 10 minutes in total. These cannot be changed. If a stream breaks part-way, the response ends, the decision is marked failed and the tokens it did produce are still metered.
Where a model is served
One model can often be served from more than one place, called an endpoint: Claude through Anthropic directly, Amazon Bedrock or Vertex AI; GPT models through OpenAI or Azure OpenAI; Gemini through Google directly or Vertex AI. Each endpoint has its own region, data terms and price. The router spreads traffic across them by price and health, keeps a conversation on one endpoint while its prompt cache is warm, and moves to another endpoint when one fails. The x-tokenmeter-endpoint response header names the endpoint that answered.
A request can set rules with a provider object:
{
"model": "auto",
"messages": [{ "role": "user", "content": "Summarise this ticket" }],
"provider": { "only": ["direct"], "sort": "latency" }
}| Field | What it does |
|---|---|
only | Use only these endpoints (1 to 5): direct (the provider's own API, and your own key if you stored one), bedrock, azure_openai, vertex, or an endpoint's name as shown in x-tokenmeter-endpoint, such as OpenAI main. Case does not matter. A provider name such as openai is not a host kind, so it matches only an endpoint named exactly that. |
order | Try these endpoints first, in this order. Others come after. It takes the same values as only. |
sort | A fixed order instead of the price-and-health split: price (cheapest first), latency (fastest first byte) or throughput (fastest output). |
region | A region such as eu-west-1, or a geography: eu, us or ap. Endpoints elsewhere, or with no known region, are not used. |
zdr | true: only endpoints whose signed terms say nothing is kept after the response (zero data retention). |
data_collection | deny: only endpoints whose terms rule out training on your data. |
preferred_max_latency, preferred_min_throughput | Seconds to the first byte, and output tokens per second. Endpoints measured as worse move to the back of the order; they are never removed. |
allow_fallbacks | false: try the first model only (see Fallbacks). |
Any other key in provider is refused with 400 unsupported_provider_option:<name>, and a malformed value with 400 invalid_provider_options. When no endpoint of any allowed model meets the rules, the request gets 400 no_endpoint_meets_provider_requirements:<reason>, where the reason is zdr, data_collection, region or only.
Tiered routing
Tiered routing sends each request to a model chosen for its kind of task. Task types are grouped in three tiers, Light, Mid and Premium, shown as columns under Router › Rules › Advanced › Task-based routing (choose Show tasks) with each task's assigned model. The dashboard calls tiered routing Task-based routing.
- Choose a Goal and Regenerate assignments. Cost picks the cheapest model that clears a minimal quality bar, Balanced the cheapest that clears a solid bar, Quality the most capable model with cost as tiebreaker. It runs in the background.
- A model is assigned only with independently judged shadow evidence: at least 200 paired responses, acceptable quality and critical-failure rates, format pass rate, measured cost savings and latency. Tasks without enough passing evidence show Not yet generated. Open a task to see its measured cost and quality and the candidates considered.
- Pin override fixes a task to a provider and exact model (it needs a capability record) and protects it from regeneration. Unpin releases it. A pin without passing judged evidence is labelled “not quality-verified”.
- Create a policy with Tiering set to Automatic. Nothing changes until you do.
Each request on an Automatic policy is classified first. A task type with no assignment goes to the policy's choice for Tasks with no tier assignment: the requested model (the baseline model from Router defaults when the caller sent auto) or a model you name, and the decision is marked as served that way. A policy set to refuse instead fails such a request with 400 tiered_routing_not_configured rather than guessing a model.
Request handling
The first three settings below (the prompt-injection guardrail and both answer scans) are under Prompt and answer scanning on Governance › Rules. The rest are on the Request handling card on Router › Rules, under Advanced. Each place has its own Save changes. Every switch is off by default. Caller task hints starts on Trust hints, and when the guardrail is turned on its selects start on Uncertain requests: no similarity check and Undecided requests: allow.
- Prompt-injection guardrail. Scans every user message and tool result before routing. Clear-cut injections are blocked by pattern rules. When the switch is on, two selects appear:
- Uncertain requests: compare with known injections (the similarity check) compares a request the rules cannot settle with a set of known injections. It makes one extra
text-embedding-3-smallcall on your own OpenAI key, metered as aninternal_embeddingdecision. It needs an OpenAI key under Router › Providers; without one this check is skipped. The other choice is Uncertain requests: no similarity check. - Undecided requests: allow or block decides what happens when no check can decide.
400 prompt_rejectedwith no detail about why. A flagged tool result or earlier message is replaced with a short notice instead and the request goes on, withx-tokenmeter-guardrail: redacted=<count>on the response. That way an agent that resends its history (Claude Code, Codex) is not stuck on one flagged file. Either way, flagged content is never sent to the model. - Uncertain requests: compare with known injections (the similarity check) compares a request the rules cannot settle with a set of known injections. It makes one extra
- Answer scanning. Checks a finished (non-streamed) answer before the caller sees it, for the system prompt being read back or an instruction the model picked up from the text it was given. A failed check withholds the whole answer: the caller gets
400 response_rejectedwithbilled: false. - Streamed answer scanning. The same patterns over a streamed answer, as it goes out. It can cut the stream off from the next chunk; it cannot take back what was already sent, so the caller gets a part answer. Streaming is not slowed down. Claude Code traffic is not scanned by either answer setting.
- Caller task hints. How far to trust a request's
task_typeandtask_difficulty: Trust hints, Same or a cheaper tier only, or Ignore hints; always classify. Any API key can send a hint, so trusting them lets a caller pick the premium tier or the strongest model. With the middle option a difficulty hint can lower a request's rating and never raise it. - AI task classifier. When keyword rules are not confident, sends the latest user message (its first 800 characters) to the cheapest model you have approved, on the workspace's key, possibly at another provider. Each call is metered as an
internal_classificationdecision. Without it, unmatched requests get the default mid-tier classification. - Classifier context. Also sends the AI classifier the start of the system prompt (up to 600 characters) and up to three earlier turns (up to 400 characters each; user and assistant text only, never tool content or images). Anything containing a secret, a card number or a social security number is left out. It does nothing unless the AI task classifier is on.
- Jev task labelling. Shown only where offered. For uncertain
autorequests, sends the latest user message (with detected emails, phone numbers, card numbers and keys replaced, cut to 2,000 characters) to Jev, an outside processor, to label the task. Requests carrying a secret or a declareddata_classificationare never sent. Leave it off for regulated data. - Shadow recommendations. For requests on a non-tiered policy, logs which model tiered routing would have chosen, without changing what runs. Results appear under Cheaper model suggestions on Routing activity. It can add classifier latency, and classifier cost if the AI classifier is on.
Limits and budgets
Rate and concurrency limits. Until you set your own, the workspace and each API key get the plan's limits:
| Plan | Requests a minute | At once |
|---|---|---|
| Free | 600 | 50 |
| Growth | 1,500 | 100 |
| Scale | 5,000 | 300 |
| Enterprise | 15,000 | 1,000 |
On Free a limit you set can only be lower: at most 600 a minute and 50 at once (a higher limit saved on a paid plan counts as those after a move to Free). On paid plans you can set any limit up to 100,000 a minute and 10,000 at once. To set one:
- Open Live status (the Live status link on Router › Overview) and choose Add limit.
- Pick Applies to: the whole workspace or one API key.
- Set Max per minute (1 to 100,000) and Max at once (1 to 10,000), and save.
A request needs room under both its workspace limit and its key limit. Otherwise it gets 429 rate_limit_exceeded with the scope, a limit of per_minute or concurrency, and a Retry-After header. The table shows each limit's count this minute and requests in flight now, with Save and Remove. Batch submissions count against the same limits.
Monthly request limit. Each plan includes a number of routed requests a calendar month (UTC). Every request through the router counts once; the router's own calls (task classification, guardrail checks, sampled checks) do not.
| Plan | Routed requests a month |
|---|---|
| Free | 100,000 |
| Growth | 2,500,000 |
| Scale | 10,000,000 |
| Enterprise | 40,000,000 |
At the limit the router answers 429 monthly_request_limit_reached with limit, used and resets_at until the 1st of the next month (UTC), before any provider is called. Batches are checked against an exact count. Single requests are checked against a count each router instance keeps up to date and re-reads every 30 seconds, so requests sent as the limit is reached can go a few past it. The lines under Router › Rules › Advanced › Auto settings show this month's count.
Per-request and per-run ceilings. Set Per request, at most and Per agent task, at most (the per-run ceiling) under Settings › Workspace › Workspace defaults (Router spending limits). Only the Owner, or an Admin who also holds a billing role, can see and change them. The per-request ceiling applies to every routed request (see Cost ceilings under Routing policies). The per-run ceiling caps the run_budget_usd a caller may set.
Run budgets. An agent run can share one budget across its requests. Send the same run_id on every request of the run, and run_budget_usd on the first one. The first request that sends run_budget_usd creates the budget; once it exists, a run_budget_usd sent later is ignored. Before each call the router reserves the request's worst-case cost against what is left, and settles it at the real cost afterwards. A request with a run_id never falls back to another model.
- Every request with a
run_idmust also sendmax_cost_usd, or it gets400 max_cost_usd_required. run_budget_usdwithout arun_idgets400 run_id_required_for_budget_controls.- Until a request of the run has sent
run_budget_usd, the run has no budget, and its requests get400 run_budget_not_configured. An answer served from the response or semantic cache, or replayed for an idempotency key, is not checked against the run's budget and does not create it. - A
run_budget_usdthat is zero, negative or out of range gets400 invalid_run_budget_usd. - A first
run_budget_usdabove Per agent task, at most gets402 run_budget_exceeds_org_max, and no budget is stored. - A request whose worst-case cost does not fit in what is left gets
402 run_budget_exceeded. The body carriesbudget_usd,spent_usd,reserved_usd,remaining_usd,requested_max_cost_usdandrun_state. Only that request is refused; a smaller one can still go through. If the run's real spend goes over its budget, the run stops and every later request in it gets the same error.
Monthly budgets. A workspace-wide budget under Governance › Budgets with enforcement Enforced: router traffic only, quality-gated downgrade or reject is enforced by the router. It reserves each request's worst-case cost against the budget before the call. A request that does not fit is refused with 402 monthly_budget_exceeded. The exception: if its policy has a cheaper fallback and Improvements has a quality-approved downgrade for that pair, the fallback serves it (monthly_budget_downgrade). Tiered requests are never downgraded. See Governance for budgets and governance policies. Budget enforcement on Live status shows each run and monthly budget's ceiling, use and reservations.
Gemini prompts are counted with an approximate tokenizer, so the router pads them by 20% for these checks. The bill always uses the provider's own usage.
Caching
Everything under Router › Caching is off until you turn it on, stored encrypted and kept to your workspace. Everything except the two answer-reuse switches is under Advanced. Turn on a row's switch, then choose Save changes; it sits above Advanced and saves both parts.
Reuse identical answers (15 minutes) (the exact response cache). Reuses an identical earlier answer for 15 minutes. A request is eligible only when all of these hold:
- it is not streamed and sets
temperatureto0(or sets none at all, if you turned on Requests that set no temperature); - it sends no
tools,tool_choice,response_formator images, and is not a/v1/messagesrequest; - it does not send
sensitive: true,cache_control: "no-store"or aCache-Control: no-storeheader; - its
actiondoes not contain a whole word such as auth, credentials, secret, payment, health, medical, legal, hr, personnel, security or pii.
The match covers the provider, model and whole request, including customer_ref and project, so one customer never gets another's answer. trace_id, action, feature, team, environment and member_ref are left out, so people in one workspace who ask the same thing share the answer; a hit is never recorded under the person who first asked. Responses over 256 KB are not stored, and an answer served by a fallback or downgrade model is never stored under the requested model.
Requests that set no temperature. Most SDKs send no temperature unless you set one. Turn this on to let both caches serve those requests too.
Reuse answers to near-identical questions (the semantic cache). Experimental. Reuses an answer when the last user message is similar enough and everything else (the system prompt, earlier turns and every parameter) matches exactly. On top of the exact cache's rules, the request must have plain text messages only, at most 64 of them and 12,000 bytes of text, ending with a user message. Similarity is computed with OpenAI's text-embedding-3-small on your own OpenAI key, so this cache needs an OpenAI key under Router › Providers and answers nothing without one. Each embedding is metered as an internal_embedding decision. An embedding is made only when there are stored entries to compare against. Set Similarity from 0.900 to 0.999. Entries last 24 hours, up to 1,000 per workspace, and responses over 64 KB are not stored.
A cache hit sends nothing to the model and records no usage for the answer. A semantic hit still makes one embedding call to find its match, recorded as internal usage, and an auto request is classified before the cache is checked. The response carries x-tokenmeter-cache: hit or semantic-hit, and the decision's reason is response_cache_hit or semantic_response_cache_hit. A semantic hit also carries x-tokenmeter-cache-similarity, the similarity score of the match (for example 0.991). Hits are counted on Routing activity (the Cache hits tile, split exact and similar).
A cached answer has no x-tokenmeter-endpoint, because no endpoint was called. For a named model it carries the cache headers and x-tokenmeter-routing-decision, plus x-tokenmeter-guardrail or x-tokenmeter-recall-archived when those were set for the request. An auto request is classified and picked before the cache is checked, so its cached answer also carries the auto headers of this request's pick (x-tokenmeter-route, x-tokenmeter-model, x-tokenmeter-route-reason, x-tokenmeter-task-type and, when set, x-tokenmeter-effort, x-tokenmeter-speed and x-tokenmeter-quality-verified). The cache key includes the picked model, so a request that picks a different model misses the cache.
When a cache is on and a request could be cached but no stored answer matched, the response carries x-tokenmeter-cache: miss. When a cache is on and a request cannot be cached, the response says why in x-tokenmeter-cache: ineligible:<reason>. The reason is one of streaming, temperature_not_zero, temperature_not_set, tools, tool_choice, response_format, images, sensitive, no_store or anthropic_messages_endpoint.
Answer retries from the saved response (24 hours) (idempotent replay). Keeps each completed non-streamed response encrypted for 24 hours. A retry carrying the same X-TokenMeter-Idempotency-Key and the same request gets it back without a second call or charge. Streamed responses, responses withheld by a guardrail and bodies over 256 KiB are not kept. See Router for the other outcomes of a reused key.
Prompt and output capture. Stores the message array (Prompts) and the non-streamed answer (Outputs) of router requests, encrypted, for Keep 1 to 30 days. Streaming, /v1/messages, rejected requests, SDK and OpenTelemetry traffic are left out. Captured content cannot be viewed in the dashboard. Once anything is held, Live status shows how many items are held and when the next expires.
Agent Recall
Recall keeps long agent runs smaller. Large tool results from earlier turns are archived and replaced by a short marker, and the model can fetch one back when it needs the exact text.
- Open Router › Caching, open Advanced and find Agent Recall.
- Set Keep (1 to 30 days), Minimum (1,024 to 1,000,000 bytes) and Allowed tools, a comma-separated list of tool names (for example
read_file, run_tests). At least one tool name is required. - Turn on the switch and choose Save changes (above Advanced).
- In your agent's requests, add the
tokenmeter_recalltool totoolsand send arecallobject withenabled: trueand asession_idthat stays the same for the whole run. The TypeScript SDK'sRecallClientdoes this for you and runs the tool; see the API reference. Without the SDK, send the fields yourself:
{
"model": "gpt-4o-mini",
"messages": [{ "role": "user", "content": "Run the tests and fix what fails." }],
"tools": [
{
"type": "function",
"function": {
"name": "tokenmeter_recall",
"description": "Retrieve an archived previous tool result by recall_id when its exact contents are needed.",
"parameters": {
"type": "object",
"properties": { "recall_id": { "type": "string" } },
"required": ["recall_id"],
"additionalProperties": false
}
}
}
],
"recall": { "enabled": true, "session_id": "run-42" }
}The router then replaces each tool-result message whose tool is on the allowed list, and whose text is at least the minimum, with a marker holding a Recall ID. The minimum is the larger of the workspace's and the request's (recall.min_tool_result_bytes), up to 1,000,000 bytes. The tool name is read from the message's own name, or else from the tool_calls entry on the assistant turn that asked for it (where current OpenAI SDKs put it). Anthropic's own format works too on POST /v1/messages: each tool_result block is matched to its tool_use block. A result holding a string or a single text block is archived; anything richer, or marked is_error, is left as it is. Claude Code traffic is passed through unchanged and never archived.
When the model calls tokenmeter_recall, your agent fetches the original with the same ingest key that sent it:
curl https://router.timewastevc.com/v1/recall/retrieve \
-H "Authorization: Bearer $TOKEN_METER_KEY" \
-H "Content-Type: application/json" \
-d '{"recall_id": "RECALL_ID_FROM_THE_MARKER", "session_id": "run-42"}'The answer is recall_id, tool_name, content (the exact original text) and content_sha256; an unknown ID gets 404 recall_not_found. Every answer to a request carrying recall returns x-tokenmeter-recall-archived, the number of tool results it archived, so a run that saves nothing is visible. Requests without the tokenmeter_recall tool are never changed, and if storage fails the original text is kept. Token savers on Routing activity shows Recall: net tokens avoided.
Batch routing and the savings baseline
Run non-urgent requests as cheaper batch jobs (results within 24 hours) (Router defaults, the Defaults link on Router › Rules). When on, a request sent with the Prefer: respond-async header is queued through the provider's batch API and answered within 24 hours, usually at the provider's batch price. Only OpenAI and Anthropic models qualify. Requests that stream, send tools or images, or use run or cost budget fields are refused. Ordinary requests are never moved to batches. Queued batches are listed under Batch jobs on Routing activity. Explicit POST /v1/batches submissions do not need this switch; see Router.
Savings measured against (Router defaults). Routing savings compare the model that served a request with another model. The Savings headline measures a request sent to auto against the priciest model auto considered for it, which the router records. A tiered request, a request sent as default, and an auto request with no recorded priciest model are measured against this baseline model instead. The vs your baseline line under the headline measures every request the router chose a model for, or sent with a placeholder name (default, or any auto name such as auto, auto:cheap, tokenmeter-auto or tokenmeter/auto), against this baseline model. A request that names a real model is measured against that model. Choose one of your approved models, or Not set. With none set, the requests measured against the baseline are unpriced, and the line under the headline says No baseline model declared. Changing it restates past savings figures. Auto names need no policy; default does, since without one the router sends it to the provider as it is.
Experiments and model evaluations
Experiments (the Experiments link on Router › Overview) lists prompt experiments, live model experiments and model evaluations; Show filters it by type. Each comparison starts as a draft and serves traffic only after an admin approves it.
Prompt experiments
Compare two prompt versions of your own on a small share of one workload. Token Meter never stores or rewrites prompt content; your application builds the prompt.
- Choose New experiment (Show: All or Prompt). Enter a name, provider, the exact selected model, an exact action and/or feature, the control and candidate variant IDs and revisions, Candidate allocation (1 to 20%), minimum requests, success outcomes and quality outcomes per variant, and the largest success-rate, quality and latency regressions you accept. Choose Save draft.
- Choose Approve and start. Assignment runs for up to 14 days, then outcomes have 7 more days to arrive. Pause stops it, and Resume restarts an experiment you paused while its window is open. Once both variants reach their minimums, a monitor checks the guardrails every 15 minutes and pauses the experiment on a regression. That pause is final (the same regression would pause it again), so fix the candidate and start a new experiment. Each card shows requests, outcomes, success rate, p95 and cost per request per variant.
- Before building each prompt, your application asks the router which variant to use. Copy the experiment ID from the card.
cohort_keyis the stable unit you assign, such as a user. You can sendrequested_modelinstead ofmodel.
curl https://router.timewastevc.com/v1/prompt-experiments/assignment \
-H "Authorization: Bearer $TOKEN_METER_KEY" \
-H "Content-Type: application/json" \
-d '{"experiment_id": "EXPERIMENT_ID_FROM_THE_CARD", "cohort_key": "user-123", "action": "summarize", "feature": "inbox", "model": "gpt-4o-mini", "provider": "openai"}'{ "experiment_id": "EXPERIMENT_ID_FROM_THE_CARD", "variant_id": "control", "revision": "v1" }- Send the routed request with all four headers
X-TokenMeter-Prompt-Experiment-Id,X-TokenMeter-Prompt-Cohort-Key,X-TokenMeter-Prompt-Variant-IdandX-TokenMeter-Prompt-Revision. Sending only some is refused (prompt_experiment_headers_incomplete), and a variant that does not match the assignment gets409 prompt_experiment_assignment_mismatch. - Report success outcomes (and quality outcomes, when that threshold is not zero) to the ingest address, not the router. Every outcome needs an
actionor atrace_id(or both).routing_decision_id(from thex-tokenmeter-routing-decisionresponse header) links the outcome to the routed call the experiment counts, but does not replace them. Quality outcomes useoutcome_kind: "quality"withquality_scorefrom 0 to 100.
curl https://ingest.timewastevc.com/v1/outcomes:batch \
-H "Authorization: Bearer $TOKEN_METER_KEY" \
-H "Content-Type: application/json" \
-d '{"events": [{"action": "summarize", "outcome_kind": "success", "success": true, "routing_decision_id": "VALUE_OF_X_TOKENMETER_ROUTING_DECISION"}]}'Only one running prompt experiment may cover a workload.
Model evaluations
Measure a candidate model against a baseline on your real traffic before it serves anyone.
- Under Show › Model evaluations, choose Evaluation settings and tick Allow sampled model evaluation and its short-lived encrypted work queue. To build a replay set, also tick Also allow encrypted prompt and response capture for 30-day offline replay. Choose Save evaluation setting.
- Choose New evaluation. Pick the Baseline model, Candidate model, an optional Rubric judge (an OpenAI or Anthropic model from a different family than both), Evaluation sample rate (0 to 1), Daily candidate cap (USD) and Live rollout (%) (keep 0 to stay off production traffic). Choose Create draft campaign. All models need a capability record.
- While the campaign is a draft and capture is on, the router keeps encrypted samples of the baseline's matching traffic for replay (non-streamed requests without tools or images, not
/v1/messages, up to 256 KB each). - Queue replay evaluation runs the samples against the candidate (and judge) in the background. The run passes only with at least 300 items, at most 3% judged worse, at most 0.2% critical failures, at least 99% format passes, at least 20% cost saving and at most 10% latency regression. Provider rate limits, overloads and timeouts are retried up to four times. An item that still fails is skipped and never counts as judged, and the run fails if more than 5% of its items are skipped (queuing it again is safe). Open the campaign for its status, the reasons it failed and the Evaluation report (Markdown). Both show counts of worse, critical and format-fail items, the judge's mean score per rubric dimension, and a warning when answers were cut off by
max_tokens(a 60-token cap, for example, cuts most answers short and makes the verdicts unreliable). - Failed items lists every worse, critical or format-fail item with its verdict and scores. These are comparisons the candidate lost, not requests that failed. Each item shows what its reason means, every rubric score under its full name, and whether an answer was cut short. While prompt capture is on, owners and admins can open an item's prompt, baseline answer, candidate answer and the judge's reason. That content is kept encrypted for at most 30 days, only for failed items. Every view is recorded in the audit log, and turning capture off closes it. The Markdown report never contains it.
- Activate appears once the run has passed. An active campaign samples matching traffic at the sample rate. After the customer has their answer, the candidate (and judge) answer the same request in the background, each metered as its own decision, until the daily cap is spent. Repeated candidate errors pause the campaign. Live % serves that share of matching traffic from the candidate instead (reason
evaluation_canary). Update changes it and Pause stops the campaign.
Shadow calls are real calls
Shadow work never changes the response or status a customer receives. Its candidate and judge calls are real provider calls on the workspace's provider keys (Token Meter's unless you stored your own).Live model experiments
Serve a share of one workload from a candidate model and compare it with the model it would otherwise get.
- Under Show › Live model, choose New experiment. Enter a name, an exact action and/or feature, an optional requested model, the Control model (served today) and Treatment model, Treatment allocation (1 to 50%), minimum decisions and linked success outcomes per arm, and the allowed cost, failure-rate, p95 latency and quality changes. Both models need an enabled capability record. Choose Save draft.
- Choose Approve and start. It is refused while another running experiment covers some of the same traffic, or an Automatic tiering policy serves it. It runs for 14 days.
- Only requests that carry a stable key (
X-TokenMeter-Rollout-Key,customer_ref,userortrace_id) and would otherwise be served by the control model are enrolled. A failed treatment request falls back to the control model. - The evaluator measures both arms every 15 minutes: decisions, failure rate, p95 latency, cost per request and success rate. The status is Collecting, Within tolerances, Breach or Cost not provable. A breach pauses the experiment automatically.
- Once every tolerance passes at the minimum samples it shows Ready to promote. Promote creates a routing policy for the same scope that targets the treatment model, falls back to the control model and starts at 5% rollout; ramp it with Ramp on its row under Router › Rules › Advanced › Policies. Roll back ends the experiment without changing routing.
Results are fixed tolerances at minimum samples, not a significance test.
Savings
Routing activity (the Activity link on Router › Overview) shows, for 24 hours, 7 or 30 days:
- Routed calls, exact and semantic cache hits, completed, fallbacks, rejected or failed, and settlement pending.
- The latest 100 decisions, sortable by time, latency and result.
- Routing savings: the same tokens priced on the model each request would otherwise have used and on the model that served it, at your rates. Fallbacks, budget downgrades and evaluation canary traffic are listed separately and never counted as savings. The calculation is explained in Routing savings methodology.
- Token savers: tokens removed by Logs, decisions on Quiet policies, and Recall's net tokens avoided, as token estimates rather than dollars.
- Cheaper model suggestions: per task type, the model tiered routing would have picked and its estimated cost, when shadow recommendations are on.
Router › Overview shows the same estimate in its Saved tile (when there are priced savings); under More detail it also gives Verified savings this month when Improvements has realized any.
LiteLLM
To route through your own LiteLLM proxy, use the three LiteLLM sections under Router › Providers › Advanced, in order:
- LiteLLM gateway: choose Add gateway credential, enter the Gateway URL (its origin, optionally ending in
/v1) and a LiteLLM virtual key, and choose Store gateway credential. The gateway's address must be on Token Meter's allowlist. If saving fails with “This gateway origin is not on the operator's allowlist”, ask support to add it. - LiteLLM capabilities: choose Add LiteLLM capability and approve each model by its Catalog model id, for example
openai/gpt-4o, with the same limits and boxes as other models. Prices come from a weekly catalog job; until it has synced, LiteLLM routes have no list prices and the page says so. - LiteLLM routes: choose Add route and set the Target catalog model, optional Requested model match, Action match and Feature match, Priority and Rollout percent, then choose Create LiteLLM route. This creates an ordinary routing policy; Retire removes it.
LiteLLM supports POST /v1/batches but not Prefer: respond-async.
Limits
- A request body can be at most 2 MB, or 32 MB on
/v1/messages, measured after decompression. A larger body gets413 request_too_large. A batch holds at most 1,000 requests. - One request makes at most three attempts, and a caller's
modelslist holds at most 5 models. /v1/messagesrequests stay on Anthropic models and are not cached, captured or shadow-evaluated.- Google Gemini has no batch or async support.
- Timeouts and the circuit breaker's thresholds are fixed.
- Captured prompts, outputs, replay samples and Recall items cannot be viewed in the dashboard.
Troubleshooting
Each code below is the error_code in the router's JSON error body. The body's message says the same thing in words, and is what an OpenAI or Anthropic SDK shows on the error it raises. See Router › Errors for the full shape.
| What you see | What to do |
|---|---|
424 provider_not_configured | The request names a model (or a policy sends it to one) and the workspace has no key of its own for that provider. Add one under Router › Providers, or, on a paid plan, send model auto, which needs no key. |
400 model_capability_not_configured | Approve the model under Router › Providers › Advanced › Model capabilities (Set up routing, step 3), or, on a paid plan, send model auto. If the message says to drop a provider prefix, send the bare model name. |
400 model_does_not_support_tools | The model was saved without Tools. Edit it under Router › Providers › Advanced › Model capabilities if the model really supports tools. |
402 auto_monthly_limit_reached | This month's auto allowance is used up. The body has limit_usd, spent_usd and resets_at. Name an approved model until then, or contact support. |
402 platform_keys_require_paid_plan | The workspace is on the Free plan, where auto does not run on Token Meter's keys (429 in Claude Code). Add your provider key under Router › Providers and name a model, for example "model": "gpt-4o-mini", or upgrade under Settings › Plan. |
400 auto_routing_disabled | Token Meter has turned auto off for the workspace. There is no switch in the dashboard; contact support, or name a model. |
400 auto_routing_no_model_in_lists | The Allowed and Excluded models on Router › Rules, or the request's own lists, leave no model. Widen them. |
400 models_not_supported_with_auto | Remove models from the request, or name a model instead of auto. |
400 invalid_models, invalid_provider_options, unsupported_provider_option:… | Fix the models list (1 to 5 strings) or the provider object; see Fallbacks and Where a model is served. |
400 no_endpoint_meets_provider_requirements:… | No endpoint meets the request's provider rules (the part after the colon says which). Loosen region, zdr, data_collection or only. |
| A policy never applies | Use Which policy wins?. Action, feature and requested model match exactly. Check the rollout, the Never reached badge and the Model routing card. |
| A policy shows Paused after errors | See Rules paused after errors on Live status (Router › Overview › Live status) and the decisions, then choose Resume. |
400 tiered_routing_not_configured | The task type has no assignment and the policy refuses unassigned tasks. Pin a model for the task, replace the policy with one whose Tasks with no tier assignment uses a model (a policy can't be edited, so retire the old one), or regenerate once judged evaluations pass. |
503 provider_circuit_open | The model failed three times in a row, in this workspace or on the shared Token Meter key. See Providers paused after errors on Live status, wait the Retry-After seconds, or add a fallback to the policy. |
429 rate_limit_exceeded | A limit under Rate & concurrency limits on Live status is full for the workspace or the key named in scope. limit says which one (per_minute or concurrency). Wait the Retry-After seconds before retrying. |
429 provider_rate_limited | The provider account serving the model is at its rate limit and no fallback could take the request. Wait the Retry-After seconds, or list fallback models. |
429 monthly_request_limit_reached | The workspace has used the routed requests its plan includes this month. The body has limit, used and resets_at. Upgrade under Settings › Plan, or wait for the reset on the 1st (UTC). |
502 provider_network_failure | The provider could not be reached, or its answer could not be read. Retry. |
402 policy_max_request_cost_usd_exceeded, org_max_request_cost_usd_exceeded, monthly_budget_exceeded | The request's worst-case cost is over the policy's Max request cost USD, the workspace's Per request, at most, or an enforced monthly budget. Lower max_tokens or raise the limit. |
402 estimated_cost_exceeds_max_cost_usd | The request's worst-case cost is over the max_cost_usd it sent. Lower max_tokens or raise max_cost_usd. |
402 run_budget_exceeded | The request does not fit in what is left of its run's budget, or the run has stopped. Lower max_tokens, or start a new run_id with a new budget. See Run budgets. |
402 run_budget_exceeds_org_max | The run's run_budget_usd is above the workspace's Per agent task, at most. Send a smaller budget, or raise the ceiling under Settings › Workspace › Workspace defaults. |
400 max_cost_usd_required, run_id_required_for_budget_controls, run_budget_not_configured, invalid_run_budget_usd | A run's budget fields are missing or wrong. See Run budgets under Limits and budgets. |
400 response_rejected | Answer scanning withheld the answer. Nothing was billed. Check the prompt for injected instructions, or turn Answer scanning off. |
413 request_too_large | The body is over 2 MB (32 MB on /v1/messages). Send less, or trim earlier turns. |
| The caches never hit | Read the x-tokenmeter-cache: ineligible:<reason> header (see Caching). Most often the request sets no temperature: send temperature: 0, or turn on Requests that set no temperature. If you run the router yourself, it also needs ROUTING_RESPONSE_CACHE_KEY. |
503 prompt_experiment_fingerprint_key_unavailable | The router is missing a setting. Contact support. If you run the router yourself, set ROUTER_CACHE_HMAC_KEY. |
| A model campaign cannot be activated | Evaluation must be on and the linked replay evaluation must have passed. The replay set fills only while capture is on and the campaign is a draft. |
| A live experiment gets no traffic | Requests need a stable key and must otherwise be served by the control model. |
A decision stays settlement_pending | The provider answered and the usage is stored. It is delivered to the ledger automatically and the decision then completes. If the usage can never be delivered (for example, the key that sent it was revoked), the decision ends with a failure code instead; one with nothing left to settle it ends after an hour. |