What is claude-code-router?
claude-code-router is a proxy that sits in front of Claude Code and routes each request to a backend of your choice by rule — cost, capability, context length. Point a Provider at Tokonomix and you can drive Claude Code with any of 130+ models, or with consensus, without changing how you use the CLI.
- Intercepts Claude Code requests and forwards them to a configured backend.
- Per-scenario
Routerrules:default,think,background,longContext. - Each backend is a
Providerwith a full chat-completions URL, key and model list. - Open source; configured from
~/.claude-code-router/config.json.
Why route through Tokonomix?
- Send
thinkturns totokonomix-consensusandbackgroundturns to a cheap direct slug — automatically. - One Provider entry unlocks 130+ models for Claude Code.
- Per-call spend caps and region / origin routing apply to every routed call.
- Keep using Claude Code exactly as before — the routing is invisible.
Connect Tokonomix in config.json
Add a Tokonomix Provider with the full chat-completions URL (/chat/completions), your key and model list, then point Router rules at it (provider and model are comma-separated).
{
"Providers": [
{
"name": "tokonomix",
"api_base_url": "https://tokonomix.ai/api/v1/chat/completions",
"api_key": "tok_live_your-key",
"models": ["tokonomix-consensus", "anthropic/claude-sonnet-4-6"]
}
],
"Router": {
"default": "tokonomix,anthropic/claude-sonnet-4-6",
"think": "tokonomix,tokonomix-consensus",
"background": "tokonomix,anthropic/claude-sonnet-4-6"
}
}api_base_url is the full endpoint including /chat/completions (not just the base), and Router values are provider,model — a comma, not a slash.
Verify it works
- Save
config.json, start claude-code-router, and run Claude Code through it. - Trigger a reasoning-heavy task and confirm the
thinkrule routed it to consensus. - Check the calls and token usage in your Tokonomix dashboard.

