Skip to content

Claude Code Router

A local gateway that lets many AI coding agents share one set of model providers and routing rules.

Stars
38k
Forks
3.2k
Licence
MIT
Language
TypeScript
Last update
27 days ago
Type
Dev tool

What it is

Claude Code Router (CCR) runs on your own machine as a local model gateway. Agents such as Claude Code, Codex, and Kimi CLI send their requests to one local address, and CCR forwards them to the model providers you configure. You manage providers, models, routing rules, and request logs from one place instead of editing each agent's settings separately.

  • Point Claude Code and Codex at the same local endpoint while choosing the underlying model in one dashboard
  • Set up an ordered list of fallback models so requests continue if one provider fails
  • Log each request to see which provider and model handled it, plus its latency and token count
  • Add web search or MCP tools to models that do not have them natively, using the documented Fusion and ToolHub features

Great for

  • Developers who use several coding agents and want one place to manage model providers
  • People who want to switch models or providers without reconfiguring each agent
  • Users who want automatic fallback to other models when a request fails
  • Teams who want to see request logs, token usage, and latency across agents

Not ideal for

  • People who only use one agent with one provider, since the extra gateway adds setup without much benefit
  • Users who do not want a local server running on their machine
  • Anyone needing a fully verified security or compliance setup, since the README does not cover this in the excerpt provided
Step-by-step guide: how to use Claude Code RouterInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Download the app

    You'll need: Node.js 22 or newer (for the CLI route)

    Install the CLI from npm

    npm install -g @musistudio/claude-code-router

    Start the browser-based management UI

    ccr ui
  2. 2

    Run it

    • Download the desktop app for your platform, or install the CLI and run ccr ui
    • Open Providers, choose a preset or custom endpoint, enter your API key, and save
    • Open Server and click Start; the gateway listens on http://127.0.0.1:3456 by default
    • Open Agent Config, select your agent and model, and apply the profile
    • Open Logs to confirm requests are being handled
  3. 3

    Get the most out of it

    • Use Routing to add conditions, retries, request rewrites, or fallback models
    • Use credential pools and key rotation to keep requests running when a key fails
    • Enable Fusion vision or web search to add capabilities to models that lack them
    • Use the Logs view to compare latency, token usage, and cost estimates across providers

Downloads

Strengths

  • One local endpoint works across many listed agents and providers
  • Includes a desktop app, a CLI with a browser UI, and Docker options
  • Built-in request logs show resolved provider, model, status, tokens, and errors

Trade-offs

  • The README excerpt is truncated, so some setup details and security settings are not confirmed here
  • Many features (routing conditions, credential pools, ToolHub) add configuration complexity
  • Requires Node.js 22 or newer for the CLI route, and desktop builds are provided for specific platforms

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.