Your OpenClaw agent, routed per request.
CodeRouter is a drop-in routing layer for OpenClaw. Each request starts on the cheapest tier that can handle it — Claude Haiku 5.5, Kimi K2.6, Claude Sonnet 5.5, Claude Opus 5.5 — and moves up only when tests or errors show a failure or the agent stops making progress. Change one provider in openclaw.json.
In TokenWatt's 176-task coding benchmark (TokenWatt is a measurement project from the same team), routed requests solved 96–100% of tasks for 56–70% less than sending every request to Opus across runs. How it was measured
Why one model for every call gets expensive
If your agent sends every call to one premium model — Claude Opus 5.5 at $4/$20 per 1M tokens, or GPT-5.5 at $5/$30 — complex reasoning and one-line follow-ups cost the same. Agents also do a lot of:
- Simple Q&A — "summarize this", "translate this"
- Code formatting and linting — regex-level edits, style fixes
- Short follow-ups — "yes", "continue", single-sentence responses
Tasks like these rarely need Opus. Claude Haiku 5.5 lists at $0.10/$0.50 per 1M tokens.
The math: per output token, Claude Opus 5.5 lists at 40× the price of Claude Haiku 5.5 ($20 vs $0.50 per 1M tokens; Anthropic list prices as of 2026-11-02). A call Haiku could handle that goes to Opus instead costs 40× as much at list price.
How CodeRouter routes it
We sit between OpenClaw and the model providers as a task-aware routing proxy. Every call from your agent is:
- Started on the cheapest model that can handle it — Claude Haiku 5.5, Kimi K2.6, Claude Sonnet 5.5, Claude Opus 5.5
- Moved up only when tests or errors show a failure or the agent stops making progress; a session stays on one model so the prompt cache stays warm
- Tracked with per-end-user attribution if you resell your agent to customers
2-minute OpenClaw setup
01 · Sign up and copy your CodeRouter key
Free signup at coderouter.io/login. Dashboard → API Keys → create a key. It starts with cr_.
02 · Add CodeRouter to openclaw.json
Add CodeRouter as a provider in ~/.openclaw/openclaw.json:
Or let the setup script write it (needs the openclaw CLI):
03 · Restart OpenClaw
Every call now goes through CodeRouter, with no code changes. The dashboard shows each request's model and cost.
What the benchmark shows
In TokenWatt's 176-task coding benchmark (single-file Python tasks from Exercism and Aider's polyglot hard set; TokenWatt is a measurement project from the same team as CodeRouter), routed requests solved 96–100% of tasks for 56–70% less than sending every request to Opus, across runs. Your own savings depend on your workload; the dashboard shows what each request and each model cost you.
What you also get
- Per-end-user tracking — if you resell your OpenClaw agent to customers via shared keys, every call is attributed to the right customer for per-user cost analytics.
- Automatic fallback — if a provider returns a 5xx or times out, the request is retried on up to two alternate models (for streams, before the first token is sent).
- Auto top-up — let Stripe refill your prepaid balance when it runs low, so your agent doesn't stop at 3am.
- BYOK fallback (opt-in) — use your own provider keys as a backup when your paid usage runs out, and pay those providers directly.
- Cost dashboard — cost per request, per model and per end user.
Try it
2-minute setup. Free trial: $1 of usage over 7 days with no card, $5 once you add one (it isn't charged). Then pay as you go at model list price with no markup, with top-ups from $20 (plus a 5.5% payment fee) and no monthly fee.