Back to Blog

Claude Code Router (CCR) Explained: What It Is, How It Works, and When a Hosted Router Fits Better (2026)

2026-08-30·4 min read·CodeRouter Team

Update, Nov 12, 2026: Direct is now a mode of a pay-as-you-go CodeRouter account rather than a separate plan: the model you name answers, at model list price with no markup (a 5.5% payment fee is added when you buy credit), and you can switch between Direct and smart routing in the dashboard at any time. The rest of the post is as published. See Direct mode and pricing.

TL;DR — Claude Code Router (CCR) is an MIT-licensed, self-hosted local gateway that sits between coding agents (Claude Code, Codex, Grok CLI, Kimi CLI and others) and model providers, exposing one local endpoint (http://127.0.0.1:3456 by default) so you can route requests across providers with your own rules. It is the right tool if you want to run and tune the gateway yourself. CodeRouter is the hosted alternative for teams that want the same routing without operating the box. Everything below about CCR comes from its README as of 2026-08-30.

What Claude Code Router actually is

CCR describes itself as "a local model gateway and control plane for coding agents." Concretely:

Installing and starting it

The README documents three paths:

Once running, point your agent at the local endpoint (for Claude Code that is the standard base-URL override — see our Claude Code base URL guide for the mechanics, which are identical for any OpenAI-compatible gateway).

Where the work goes: local gateway vs hosted router

Both approaches solve the same problem — routing coding-agent traffic to the right model — but they put the operational burden in different places.

Claude Code Router (self-hosted) CodeRouter (hosted)
Who runs the gateway You (desktop app, CLI process, or Docker) We do — one OpenAI-compatible endpoint
Routing rules You author and maintain them Automatic model selection (to pick the exact model per request, use the Direct plan)
Credentials Your provider keys, managed in CCR's credential pools One CodeRouter key; providers behind it
Fallback / retries Configurable in CCR Built in
Logs, cost tracking Local, per README Dashboard
Best for Developers who want full control and local-only traffic Teams who want routing without running infrastructure

Choose CCR when you need requests to stay on your machine, want to hand-tune rules per agent, or are comfortable maintaining Node/Docker services. Choose a hosted router when the gateway is not something you want to babysit — especially across a team, where one endpoint and one key beats N local configs.

Routing decision card

Facts about Claude Code Router are taken from the project README (MIT, github.com/musistudio/claude-code-router) as of 2026-08-30; the project moves quickly — check the repo for current provider and feature lists.

Try phase-aware routing on your own workload

One base URL for Claude Code, Cursor or Aider. Free trial, no credit card.

Start free trial

Get weekly AI cost optimization tips

Join developers cutting their agent bills