Phase-aware routing for coding agents

Cut your coding-agent bill.Pay for Opus only when a task needs it.

CodeRouter sends each Claude Code, Cursor or Aider request to the cheapest model that can handle it — Claude Haiku 5.5, Kimi K2.6, Claude Sonnet 5.5 or Claude Opus 5.5 — and moves up only when tests or errors show a failure or an agent stops making progress. One base URL, no code changes.

Measured

96–100% of tasks solved for 56–70% less than sending every request to Opus, across runs of TokenWatt's 176-task coding benchmark.

How it was measured
$1 free with no card, $5 with a card (not charged) · 7 daysOpenAI- and Anthropic-compatible

TokenWatt is a measurement project from the same team as CodeRouter. Results depend on your mix of tasks and your cache hit rate; your dashboard shows your own cost per request.

Claude Code setup
# writes ~/.claude/settings.json (keeps a backup) $ curl -fsSL https://www.coderouter.io/setup.sh | bash -s -- cr_YOUR_KEY $ claude
Example routing logExample · not live data
#ModelCache-ReadCost
1kimi-k2.600.007560
2kimi-k2.697280.002720
# tests failed → stronger model
3claude-sonnet-5.500.025900
4claude-sonnet-5.5111360.005110
# same model, cache warm again
One row per request. Values in the format of the X-CodeRouter-Model, -Cache-Read and -Cost response headers (cost in USD at list price). Illustrative values.

How a request is routed

CodeRouter starts each request on the cheapest model that can handle the task and moves up only when tests or errors show a failure or the agent stalls. A coding-agent session stays on one model, so the prompt cache stays warm. We keep optimizing our routing strategies and algorithms.

claude-haiku-5.5
Small edits, docs, easy code
kimi-k2.6
Everyday implementation and debugging
claude-sonnet-5.5
Harder tasks
claude-opus-5.5
The hardest tasks
Opus is in the routing pool on a paid balance (pay as you go and Team).
Setup

Three steps, about two minutes.

If your tool speaks the OpenAI or Anthropic API, it works with CodeRouter.

  1. 01

    Create a key

    Sign in with Google and create a cr_ key in the dashboard. The full key is shown once; we store only a hash.

    Create a free key
  2. 02

    Point your tool at CodeRouter

    Claude Code: run the one-line setup. Cursor, Aider, Cline, Continue.dev and the OpenAI SDK: set the base URL to https://www.coderouter.io/api/v1 and paste the key.

  3. 03

    Use model auto

    Every response carries X-CodeRouter-* headers with the model and cost, and the dashboard shows each request's cost.

# One line: writes ~/.claude/settings.json # (backs up the old file; undo with --uninstall) $ curl -fsSL https://www.coderouter.io/setup.sh | bash -s -- cr_YOUR_KEY $ claude # Or by hand, in ~/.claude/settings.json { "env": { "ANTHROPIC_BASE_URL": "https://www.coderouter.io", "ANTHROPIC_AUTH_TOKEN": "cr_YOUR_KEY", "ANTHROPIC_MODEL": "auto", "ANTHROPIC_DEFAULT_OPUS_MODEL": "auto", "ANTHROPIC_DEFAULT_SONNET_MODEL": "auto", "ANTHROPIC_DEFAULT_HAIKU_MODEL": "auto" } }
Benchmark

Measured, not estimated.

TokenWatt, a measurement project from the same team as CodeRouter, runs 176 single-file Python tasks (Exercism and Aider's polyglot hard set). The model gets the instructions and a stub and returns the file; the tests run; on a failure it gets one retry with the failing test output. Costs are at list price.

Routing v3 · first run · 2026-11-04
176/176
solved · $0.77, 30% of the all-Opus cost (70% less) · 88.6% on the first try
All-Opus baseline
$2.56
176/176 solved with one retry
Earlier router · three runs · Oct 2026
96.0–97.7%
solved at 41–44% of the all-Opus cost (56–59% less)
ConfigurationSolvedFirst tryCostvs all-Opus
All requests to Claude Opus 5.5176/176—$2.56100%
Routing v3, first run (2026-11-04)176/17688.6%$0.7730% · 70% less
Earlier router, three runs (Oct 2026)96.0–97.7%——41–44% · 56–59% less
Limits: single-file Python tasks; public tasks that models may have seen; short single-turn contexts with no prompt-cache cost.Method, model matrix and raw numbers
For teams

One balance for the team. Budgets per developer.

$19 per developer per month. All model usage is billed from a prepaid team balance at list price, with no markup; a 5.5% payment fee applies to top-ups.

Our own team · one key per engineer · May–Sep 2026
$4.30
median routed model cost per developer per active day
$13.03
75th percentile
163
median requests per developer per active day
385 active developer-days with 20+ requests, at model list prices. Our own team's usage, not customers'.

Per-seat price

A seat is an active team member; changes are prorated. Top-ups from $100 by card or US bank transfer (ACH), with optional auto top-up.

Budgets and alerts

Per member, per project and company-wide. Email alert at 80%; at 100%, downgrade to cheaper models or pause — a team setting. The company cap always blocks.

Spend per developer

One key per engineer; spend by member and project. Up to 50 API keys and 2,400 requests per minute.

No prompts for admins

Admins see spend and metadata, never prompts or responses, and can turn request-content storage off.

Pricing

One price: model list price, no markup.

Pay as you go from a prepaid balance with no monthly fee — smart routing or Direct mode, your choice. Team adds budgets and per-member spend for $19 per developer.

OptionMonthly feeModel usageWhat you get
Free start$0$1 over 7 days with no card; $5 once you add a card (not charged)Every model except Claude Opus; then pay as you go
Pay as you goNoneList price, no markup, from a prepaid balance; 5.5% payment fee on top-upsSmart routing or Direct mode; top-ups from $20
Team$19/developer/moList price, no markup, from a team balance; 5.5% payment fee on top-upsBudgets and spend per member and project; top-ups from $100
FAQ

Questions developers ask first.

Does CodeRouter still use Opus?

Yes, on a paid balance (pay as you go and Team). Each task starts on the cheapest model that can handle it and moves up only when tests or errors show a failure or the agent stalls, up to Claude Opus 5.5 for the hardest work. Everyday edits, implementation and tests run on Claude Haiku 5.5, Kimi K2.6 or Claude Sonnet 5.5.

Can I pick the model myself?

Yes. Smart routing is the default: every request is routed and an explicit model name is ignored. Switch to Direct mode in the dashboard and CodeRouter uses the exact model you name, at the same list price with no markup. You can switch back at any time.

How do I see what each request cost?

Every response carries X-CodeRouter-Model and X-CodeRouter-Cost headers, and the dashboard lists each request. X-CodeRouter-Cost-If-Opus prices the same tokens at Opus list price — a same-token estimate. In a coding-agent session a stronger model takes a different number of steps, so it isn't what an all-Opus session would have cost; those requests carry no X-CodeRouter-Savings.

What happens when my balance runs out?

Requests stop: the API returns HTTP 402 with a link to add balance, so you're never billed beyond what you topped up. Turn on auto top-up to refill automatically, or BYOK fallback to continue on your own provider keys. Team has budgets per member and project on top.

What do you store?

To improve routing we keep, for up to 180 days, an excerpt of each request (the latest message and the start and end of the latest tool output), a short response summary and the routing decision. The subprocessor that runs our routing decisions receives the excerpt and states it does not train on customer data. Team admins can turn content storage off. API keys are stored only as a hash. Data is never sold.

How is this different from OpenRouter?

OpenRouter is a general gateway to hundreds of models; its Auto Router and Auto Code (a router for coding agents, launched November 2026) use a decision model to pick a model for each request. CodeRouter is built only for coding agents: it starts each task on the cheapest model that can handle it, moves up only when tests or errors show a failure or the agent stalls, and keeps a session on one model so the prompt cache stays warm. Full comparison

Try it on your own workload.

$1 of free usage over 7 days with no card, $5 once you add one (it isn't charged). Your dashboard shows the cost of every request.

Start free trial

Get weekly AI cost optimization tips

Join developers cutting their agent bills