The Principal Dev – Masterclass for Tech Leads

The Principal Dev – Masterclass for Tech Leads28-29 May

Join

Claude Code Router

Chinese README Discord X License Desktop downloads Documentation

Kimi K2.7 Code sponsor banner
Kimi Code Subscription  Ā·  API Global  Ā·  API China

Thanks to Kimi for sponsoring this project! Kimi K2.7 Code is an open-source, coding-focused agentic model developed by Moonshot AI, with substantial gains on real-world long-horizon coding tasks and higher end-to-end success across complex software engineering workflows. It also cuts thinking-token usage by approximately 30% compared with K2.6. Inside CCR, Kimi ships as built-in provider presets: import the pay-as-you-go API or the Kimi Code subscription in one click and route your coding agent's requests to Kimi, the subscription endpoint passes straight through natively with no protocol conversion, API endpoints are adapted automatically, and your balance and subscription usage show up right in the CCR dashboard.

CCR already supports Kimi. Visit the Kimi Open Platform (中文站 | Global) to try the API, or explore the cost-effective Coding Plan.

Claude Code Router Desktop is a local control plane for coding agents. It gives Claude Code, Codex, Grok CLI, ZCode, and compatible API clients one stable local endpoint, then lets you decide which provider, model, routing policy, tool stack, and account should handle each request.

Instead of wiring every agent to every model service by hand, CCR centralizes the model layer on your own machine: provider presets, custom endpoints, credential pools, fallback chains, Fusion-enhanced models, MCP tools, request logs, account usage, and desktop launch profiles all live in one app.

Claude Code Router Desktop screenshot

What CCR Helps You Do

Goal CCR gives you
Keep the same agent workflow while switching models Local profiles for Claude Code, Codex, Grok CLI, and ZCode, with CLI/app launch entries and per-profile model selection
Try many providers without rebuilding config every time Built-in provider presets, custom OpenAI/Anthropic/Gemini-compatible endpoints, protocol probing, model discovery, and connectivity checks
Make routing a runtime policy Built-in agent routing, conditional rules, request rewrites, model-prefix routing, retries, and fallback model chains
Control cost and quota pressure Credential pools, key rotation, local usage limits, account balance snapshots, token/cost dashboards, and tray status
Upgrade a model without replacing it Fusion models that add vision, web search, or selected MCP tools to an existing base model
Keep large tool sets usable ToolHub, a compact MCP entry point that lets agents resolve and invoke the tools needed for the current task
Debug what actually happened Request logs, resolved provider/model fields, latency, token usage, estimated cost, network capture, and agent observability

Why Use CCR

Feature Highlights

Documentation

Read the full documentation at ccrdesk.top, including the CLI reference and Docker deployment guide.

Download And Install

  1. Open the GitHub Releases page.
  2. Download the package for your platform:
    • macOS Apple Silicon: Claude-Code-Router_<version>-mac-Apple-Silicon-arm64.dmg or .zip
    • macOS Intel: Claude-Code-Router_<version>-mac-Intel-x64.dmg or .zip
    • Windows: Claude Code Router_<version>.exe
    • Linux: Claude Code Router_<version>.AppImage
  3. Install and launch Claude Code Router.
  4. On first launch, CCR creates its local configuration database:
    • macOS/Linux: ~/.claude-code-router/config.sqlite
    • Windows: %APPDATA%\claude-code-router\config.sqlite

CCR stores runtime configuration in SQLite. A legacy config.json is read only once for migration when no SQLite config exists.

After the service is started from the Server page, CCR listens on http://127.0.0.1:3456 by default. The Server page controls the gateway Host, Port, proxy mode, system proxy, network capture, and CA certificate status.

CLI And Docker

The npm CLI requires Node.js 22 or newer and provides the browser management UI, gateway, and Agent Config launch commands without Electron:

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

The CLI management UI defaults to http://127.0.0.1:3458, while its model gateway defaults to http://127.0.0.1:3456. See the complete CLI reference for background/foreground service commands, options, profile launching, authentication, and data locations.

To run the browser UI and gateway behind one Nginx port with persistent Docker storage:

docker compose up -d --build

Docker exposes both management and gateway routes at http://127.0.0.1:3458 by default. Read the Docker deployment guide before remote exposure; it covers the internal port topology, management and gateway authentication, CCR_PUBLIC_BASE_URL, volumes, backup/restore, upgrades, and health checks.

Quick Start

CCR can be configured entirely from the desktop UI. Use this setup order for a clean first run.

1. Add a provider

Open Providers, click Add Provider, then choose a built-in preset, import a supported local agent login state, or select Other / custom API endpoint. Fill in the provider name, base URL, protocol, API key, and model list. Run protocol probing and model connectivity checks when available, then save the provider.

2. Configure routing

Open Routing to enable built-in agent routes, add conditional rules, configure request rewrites, and set fallback behavior. Use Add Routing Rule for request conditions, model-prefix routing, or rule-level fallback targets.

3. Start the gateway

Open Server and click Start. After the page shows Running, CCR listens on http://127.0.0.1:3456 by default. Enable Auto start if you want CCR to start the local gateway whenever the desktop app opens.

4. Connect your agent tool

Open Agent Config and choose the client you want to use. Configure Claude Code, Codex, Grok CLI, or ZCode, select the target model and effect scope, then apply the config. For app entries, use Open Agent to launch the target app through CCR.

5. Monitor and adjust

Use Settings → Logs & Observability to enable request logs and agent observability. Use Logs to confirm request model, resolved provider, resolved model, status, tokens, latency, and errors. Use the dashboard and tray window for token, cost, model distribution, and account status.

Acknowledgements

Codex support is powered by musistudio/codexl.

Support & Sponsoring

If you find this project helpful, please consider sponsoring its development. Your support is greatly appreciated.

Support on Ko-fi
One-time support via Ko-fi
Sponsor with PayPal
International sponsorship
Alipay
Alipay QR code
WeChat Pay
WeChat Pay QR code

Our Sponsors

A huge thank you to all our sponsors for their generous support.

Zhipu icon
Z智谱
AIHubmix icon
AIHubmix
BurnCloud icon
BurnCloud
302.AI icon
302.AI
RunAPI icon
RunAPI
TeamoRouter icon
TeamoRouter
code0.ai icon
code0.ai
claudeapi icon
claudeapi
Qiniu Cloud AI icon
Qiniu Cloud AI
Fenno.ai icon
Fenno.ai
Unity2.Ai icon
Unity2.Ai

Community Sponsors

@Simon Leischnig @duanshuaimin @vrgitadmin @*o @ceilwoo @*诓
@*ꛓ @K*g @R*R @bobleer @*苗 @*划
@Clarence-pan @carter003 @S*r @*Ꙗ @*ꕏ @Z*z
@*ē„¶ @cluic @*苗 @PromptExpert @*åŗ” @yusnake
@*飞 @č‘£* @*ę±€ @*ę¶Æ @*:-) @**磊
@*琢 @*成 @Z*o @*琨 @congzhangzh @*_
@Z*m @*鑫 @c*y @*ꘕ @witsice @b*g
@*äŗæ @*辉 @JACK @*光 @W*l @kesku
@biguncle @äŗŒå‰å‰ @a*g @*ꞗ @*å’ø @*꘎
@S*y @f*o @*智 @F*t @r*c @qierkang
@*军 @snrise-z @*ēŽ‹ @greatheart1000 @*ēŽ‹ @zcutlip
@Peng-YM @*ꛓ @*. @F*t @*政 @*铭
@*叶 @七*o @*青 @**晨 @*远 @*霄
@**吉 @**飞 @**é©° @x*g @**东 @*落
@哆*k @*ę¶› @苗大 @*呢 @d*u @crizcraig
s*s *火 *勤 **锟 *ę¶› **꘎
*矄 *语 *ē“œ

If your name is masked, please contact me via my homepage email to update it with your GitHub username.

License

This project is licensed under the MIT License.

Join libs.tech

...and unlock some superpowers

GitHub

We won't share your data with anyone else.