Setup Guide

Get CodeRouter running with your AI agent in under 60 seconds.

1

Pick a plan

All paid plans use system provider keys; the Free Trial gives you 1M tokens (over 2 days) to evaluate routing quality.

See plans
2

Get your API key

Sign in with Google, then create a key in the dashboard. Name it after the engineer or workflow (e.g. alice, ci, prod) so per-key analytics make sense later.

Sign up freeOpen dashboard
3

Configure your AI agent

One-line setup script that detects your installed agent (OpenClaw, Cursor, Aider, Claude Code) and writes the right config:

Anthropic's CLI. Uses ANTHROPIC_AUTH_TOKEN — NOT ANTHROPIC_API_KEY (that one only works against api.anthropic.com directly).
One-shot env vars
export ANTHROPIC_BASE_URL=https://www.coderouter.io/api/v1
export ANTHROPIC_AUTH_TOKEN=cr_YOUR_KEY_HERE
export ANTHROPIC_MODEL=auto
export ANTHROPIC_DEFAULT_OPUS_MODEL=auto
export ANTHROPIC_DEFAULT_SONNET_MODEL=auto
export ANTHROPIC_DEFAULT_HAIKU_MODEL=auto
# Optional v2.x fix: disable experimental beta features that
# some third-party gateways don't yet handle.
export CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1
claude
~/.claude/settings.json (persistent)
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://www.coderouter.io/api/v1",
    "ANTHROPIC_AUTH_TOKEN": "cr_YOUR_KEY_HERE",
    "ANTHROPIC_MODEL": "auto",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "auto",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "auto",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "auto",
    "CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS": "1"
  }
}
⚠ Gotcha: If the badge in Claude Code's header shows 'Claude Max' instead of 'API Usage Billing' after restart, your existing OAuth session is winning over the env vars. Run `claude logout`, then relaunch.

Need a different agent (Cline, Windsurf, GitHub Copilot via LiteLLM)? See full integration docs.

4

Verify it works

Test routing without burning tokens — X-Dry-Run returns the routing decision (model, phase, cost estimate) without calling the provider:

Dry-run test
curl https://www.coderouter.io/api/v1/chat/completions \
  -H "Authorization: Bearer cr_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -H "X-Dry-Run: true" \
  -d '{"model":"auto","messages":[{"role":"user","content":"Hello"}]}'

Response should include the chosen model and phase. Drop X-Dry-Run for a real call.

Need Help?

Join our community or reach out directly.

Contact Support