Claude Code Router v3: What Changed and How I Set It Up Now
说明与用途
Claude Code Router v3 简化了配置,扩展了提供商支持,并引入分层路由,能够安全地将 Claude Code 请求重定向到更便宜的模型。
问题
The older Claude Code Router (CCR) was a simple proxy that required manual configuration and was hard to maintain. Users needed a more robust, user-friendly setup that supports multiple providers, models, and routing rules while keeping credentials secure.
结果
CCR v3 simplifies configuration, expands provider support, and introduces tiered routing and script rules, making it easier to route Claude Code traffic to cheaper models while keeping credentials secure.
工作流
- Install Node.js 22+ and the CCR npm package with
npm install -g @musistudio/claude-code-router - Run
ccr ui --no-opento start the background service and obtain the management URL - Add providers via the UI: choose a preset or custom endpoint, paste the key, and test the connection
- Add an API key for CCR to use when Claude Code talks to it
- Configure routing: set default model and any tier overrides or rules
- Confirm the gateway is running in the Server tab
- Create an Agent Config profile: name it, set scope, and pick a model
- Launch the agent with
ccr "Profile Name"or via the UI - Verify requests go through the gateway by listing models with
/modelor checking the request log - For supervised servers, run
ccr serve --no-openwith a fixedCCR_WEB_AUTH_TOKENinstead ofccr start - Use tier overrides, custom rules, or Node.js script rules to fine‑tune routing
- Monitor request logs for diagnostics and ensure scripts fail‑open to avoid downtime
证据
The README now calls it "a local model gateway and control plane for coding agents", and the recommended install is a desktop app.
The settings live in config.sqlite in ~/.claude-code-router (or %APPDATA%\claude-code-router on Windows). The docs warn against editing or copying the live SQLite file while CCR runs.
You don't just set a base URL. You create an "Agent Config" profile, then start Claude Code from CCR.
The tier overrides were the biggest change in how I think about routing.
- 记录日期: 2026-10-07T04:40:49.893Z