✏️ Edit
⚡ CC Router Wiki
Welcome to the CC Router Wiki — the complete knowledge base for running Claude Code with multiple LLM backends: DeepSeek V4 Pro DeepSeek Flash MiniMax M3 GLM‑5.1
Claude Code ──▶ cc‑proxy :3456 ──▶ api.minimax.io
├──▶ api.deepseek.com
└──▶ api.z.ai
🔄 Dynamic Switching
Change models with /model inside Claude Code or cc-model from terminal.
⚡ One‑Click Deploy
python3 setup.py does everything: proxy, config, auto‑start, verification.
🌐 International Endpoints
Pre‑configured with api.minimax.io, api.z.ai — no 401 traps.
📦 4 LLMs
DeepSeek Pro, Flash, MiniMax M3, GLM‑5.1 from one Claude Code instance.
✏️ Edit
🚀 Quick Start
1. Get API Keys
2. Clone & Configure
git clone https://github.com/ai-caseylai/cc-router.git
cd cc-router
# Edit setup.py — fill in your API keys
3. One‑Click Deploy
python3 setup.py
4. Launch
source ~/.zshrc && claude
✏️ Edit
📦 Installation
Prerequisites
- macOS 12+ (Linux/Windows: manual)
- Python 3
- Claude Code (auto‑installed)
Automatic (macOS)
python3 setup.py
Manual
# 1. Start proxy
python3 ~/Documents/minimax/cc-proxy.py &
# 2. Configure settings.json
# → See "settings.json" page for full config
# 3. Add alias
echo "alias cc-model='bash ~/Documents/minimax/cc-model.sh'" >> ~/.zshrc
Verify
curl http://127.0.0.1:3456/health # → {"status":"ok"}
claude # /status → http://127.0.0.1:3456
✏️ Edit
DeepSeek
Home / Providers / DeepSeek
| Model | ID | Use Case |
| DeepSeek V4 Pro | deepseek-v4-pro[1m] | Heavy coding, reasoning, 1M context |
| DeepSeek Flash | deepseek-v4-flash | Quick answers, background tasks |
Endpoint
https://api.deepseek.com/anthropic/v1/messages
API Key
Register at platform.deepseek.com, top up, create key → sk-xxxxxxxx. One key serves both models.
Aliases
| Alias | Maps To |
|---|
deepseek-chat | deepseek-v4-flash |
deepseek-reasoner | deepseek-v4-pro[1m] |
✏️ Edit
MiniMax M3 ⚠️ tricky
Home / Providers / MiniMax M3
Biggest trap: Their docs show api.minimaxi.com which returns 401 invalid api key for non‑CN users. Always use api.minimax.io.
| Model | ID | Key Prefix | Auth Header |
| MiniMax M3 | MiniMax-M3 | sk-cp- | x-api-key |
Correct Endpoint
https://api.minimax.io/anthropic/v1/messages ← ✅ International
https://api.minimaxi.com/anthropic/v1/messages ← ❌ CN only → 401
Test Connectivity
curl -s https://api.minimax.io/anthropic/v1/messages \
-H "Content-Type: application/json" \
-H "x-api-key: sk-cp-YOUR_KEY" \
-H "anthropic-version: 2023-06-01" \
-d '{"model":"MiniMax-M3","max_tokens":5,"messages":[{"role":"user","content":"hi"}]}'
Features
- Extended Thinking (toggle: Option+T / Alt+T in Claude Code)
- Context: 512K → set
CLAUDE_CODE_AUTO_COMPACT_WINDOW: "512000"
✏️ Edit
GLM‑5.1 (Zhipu AI)
Home / Providers / GLM‑5.1
| Model | ID | Key Format |
|---|
| GLM‑5.1 | glm-5.1 | xxx.yyy.zzz |
Endpoints
| Region | Endpoint |
|---|
| International | https://api.z.ai/api/anthropic/v1/messages |
| China | https://open.bigmodel.cn/api/anthropic/v1/messages |
API Key
Register at open.bigmodel.cn, create key.
✏️ Edit
🌐 International Endpoints
Home / Providers / Endpoints
| Provider | ✅ International | ❌ Do NOT Use |
| DeepSeek | api.deepseek.com | — |
| MiniMax | api.minimax.io | api.minimaxi.com → 401 |
| GLM‑5.1 | api.z.ai | open.bigmodel.cn (CN only) |
How Claude Code Connects
"ANTHROPIC_BASE_URL": "http://127.0.0.1:3456" ← local proxy
"ANTHROPIC_AUTH_TOKEN": "dummy" ← proxy handles real auth
The proxy strips ?beta=true query params and routes by model field.
✏️ Edit
🕹️ Model Switching
Terminal
cc-model pro # Default=DeepSeek Pro → Haiku=MiniMax
cc-model flash # Default=DeepSeek Flash → Haiku=MiniMax
cc-model minimax # Default=MiniMax → Haiku=DeepSeek Pro
cc-model glm # Default=GLM‑5.1 → Haiku=MiniMax
cc-model status # Show mapping + proxy health
Inside Claude Code
Type /model → arrow keys → Default ↔ Haiku. No restart needed.
Why only 2 slots? Claude Code's /model picker only shows Default + Haiku + current custom model in non‑Anthropic mode. Use cc-model to rotate which models fill those slots.
✏️ Edit
cc-model CLI
The cc-model command updates ~/.claude/settings.json to remap which models appear in /model's two slots.
Installation
# Auto (setup.py)
python3 setup.py
# Manual
echo "alias cc-model='bash ~/Documents/minimax/cc-model.sh'" >> ~/.zshrc
Commands
| Command | Default Slot | Haiku Slot |
cc-model pro | deepseek-v4-pro[1m] | MiniMax-M3 |
cc-model flash | deepseek-v4-flash | MiniMax-M3 |
cc-model minimax | MiniMax-M3 | deepseek-v4-pro[1m] |
cc-model glm | glm-5.1 | MiniMax-M3 |
cc-model status | Show mapping + proxy health |
✏️ Edit
🔧 Architecture
Home / Internals / Architecture
cc‑proxy is a single‑file Python HTTP server (~120 lines) using only http.server and urllib.request — zero dependencies.
Request Flow
1. Claude Code → POST /v1/messages?beta=true (model="MiniMax-M3")
2. Proxy strips ?beta=true, reads model name
3. Looks up PROVIDERS["MiniMax-M3"]
4. Forwards to https://api.minimax.io/anthropic/v1/messages
5. Streams response back (SSE supported)
6. Claude Code receives response as if from Anthropic API
✏️ Edit
📁 File Map
Home / Internals / File Map
| File | Role |
~/Documents/minimax/cc-proxy.py | Core router — HTTP proxy on :3456, routes by model name |
~/Documents/minimax/cc-model.sh | Switcher CLI — updates settings.json model mapping |
~/.claude/settings.json | Claude Code config — points to proxy, sets model slots |
~/.claude.json | Onboarding flag — must have "hasCompletedOnboarding": true |
~/Library/LaunchAgents/com.cc-proxy.plist | macOS launchd — auto‑starts proxy on boot |
✏️ Edit
settings.json
Home / Internals / settings.json
{
"env": {
"ANTHROPIC_BASE_URL": "http://127.0.0.1:3456",
"ANTHROPIC_AUTH_TOKEN": "dummy",
"ANTHROPIC_MODEL": "deepseek-v4-pro[1m]", ← Default slot
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "MiniMax-M3", ← Haiku slot
"API_TIMEOUT_MS": "3000000",
"CLAUDE_CODE_AUTO_COMPACT_WINDOW": "512000",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
},
"model": "deepseek-v4-pro[1m]",
"availableModels": ["MiniMax-M3","deepseek-v4-pro[1m]","deepseek-v4-flash"]
}
Env var priority: ~/.zshrc exports > settings.json env. Always comment out ANTHROPIC_* in .zshrc.
✏️ Edit
Streaming
Home / Internals / Streaming
The proxy supports both streaming (SSE) and non‑streaming responses:
# Streaming (Claude Code default)
req["stream"] = true → proxy reads 4KB chunks, forwards immediately
# Non‑streaming
req["stream"] = false → proxy reads entire response, sends at once
Query Params
Claude Code sends POST /v1/messages?beta=true. The proxy strips query params before path matching (path.split("?")[0]).
Early proxy versions returned 404 because self.path == "/v1/messages" failed against "/v1/messages?beta=true". Fixed in v2.
✏️ Edit
"model may not exist"
Cause: Proxy not running, or Claude Code can't reach port 3456.
# Check
curl http://127.0.0.1:3456/health
# Restart
lsof -ti :3456 | xargs kill
python3 ~/Documents/minimax/cc-proxy.py &
Also check: ANTHROPIC_BASE_URL in settings.json must be http://127.0.0.1:3456.
✏️ Edit
MiniMax 401 · invalid api key
Home / Troubleshooting / MiniMax 401
Three causes:
- Using
api.minimaxi.com instead of api.minimax.io
- API key expired on MiniMax platform
- Key truncated or malformed (must start with
sk-cp-)
curl -s https://api.minimax.io/anthropic/v1/messages \
-H "x-api-key: sk-cp-YOUR_KEY" \
-H "anthropic-version: 2023-06-01" \
-d '{"model":"MiniMax-M3","max_tokens":5,"messages":[{"role":"user","content":"hi"}]}'
✏️ Edit
API Timeout · Retrying
Home / Troubleshooting / API Timeout
Cause: ANTHROPIC_BASE_URL pointing to dead endpoint or wrong port.
Common causes:
~/.zshrc has export ANTHROPIC_BASE_URL=... overriding settings.json
- Proxy not running on port 3456
- Port mismatch (settings.json has 3457 but proxy is on 3456)
# Check for conflicts
grep ANTHROPIC ~/.zshrc
# Comment them out
sed -i '' 's/^export ANTHROPIC_/# export ANTHROPIC_/' ~/.zshrc
✏️ Edit
Env Var Conflicts
Home / Troubleshooting / Env Var Conflicts
Priority order:
1. ~/.zshrc export ANTHROPIC_* ← HIGHEST (overrides everything)
2. ~/.claude/settings.json env ← MIDDLE
3. ~/.claude.json ← LOWEST
If both .zshrc and settings.json set the same variable, the .zshrc value wins.
✏️ Edit
launchd "Operation not permitted"
Home / Troubleshooting / launchd
macOS privacy restriction.
Fix: System Settings → Privacy & Security → Full Disk Access → add /usr/bin/python3.
✏️ Edit
📋 Command Cheatsheet
Home / Reference / Cheatsheet
| Task | Command |
| Deploy | python3 ~/Documents/minimax/cc-router/setup.py |
| Switch to DeepSeek Pro | cc-model pro |
| Switch to DeepSeek Flash | cc-model flash |
| Switch to MiniMax | cc-model minimax |
| Switch to GLM‑5.1 | cc-model glm |
| Show status | cc-model status |
| Proxy health | curl http://127.0.0.1:3456/health |
| Model list | curl http://127.0.0.1:3456/v1/models |
| Restart proxy | lsof -ti :3456 | xargs kill && python3 ~/Documents/minimax/cc-proxy.py & |
| Test MiniMax | curl -s https://api.minimax.io/anthropic/v1/messages -H "x-api-key: KEY" -H "anthropic-version: 2023-06-01" -d '{"model":"MiniMax-M3","max_tokens":5,"messages":[{"role":"user","content":"hi"}]}' |
| Check env conflicts | grep ANTHROPIC ~/.zshrc |
✏️ Edit
🔗 Links