deepclaude-proxy
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesedeepclaude
deepclaude
Skill by ara.so — Daily 2026 Skills collection.
deepclaude routes Claude Code's API calls to DeepSeek V4 Pro, OpenRouter, Fireworks AI, or any Anthropic-compatible backend — keeping the full Claude Code UX (file editing, bash, subagents, git) while cutting costs by up to 17x.
由ara.so提供的Skill——属于Daily 2026 Skills合集。
deepclaude可将Claude Code的API请求路由至DeepSeek V4 Pro、OpenRouter、Fireworks AI或任何Anthropic兼容后端——在保留Claude Code完整用户体验(文件编辑、bash、子Agent、git)的同时,将成本最高降低17倍。
How it works
工作原理
Claude Code reads specific environment variables to determine its API endpoint and model names. sets these per-session (not permanently), launches Claude Code, then restores originals on exit.
deepclaudeYour terminal
└── Claude Code CLI (tool loop, file editing, bash, git — unchanged)
└── API calls → DeepSeek V4 Pro ($0.87/M) instead of Anthropic ($15/M)Key environment variables Claude Code uses:
| Variable | Purpose |
|---|---|
| API endpoint override |
| API key for the backend |
| Model for Opus-tier tasks |
| Model for Sonnet-tier tasks |
| Model for Haiku-tier / subagents |
| Model for spawned subagents |
Claude Code会读取特定的环境变量来确定其API端点和模型名称。会按会话设置这些变量(非永久),启动Claude Code,然后在退出时恢复原始设置。
deepclaude你的终端
└── Claude Code CLI(工具循环、文件编辑、bash、git —— 保持不变)
└── API请求 → 转向DeepSeek V4 Pro(每百万token0.87美元)而非Anthropic(每百万token15美元)Claude Code使用的关键环境变量:
| 变量 | 用途 |
|---|---|
| API端点覆盖 |
| 后端的API密钥 |
| Opus级任务使用的模型 |
| Sonnet级任务使用的模型 |
| Haiku级/子Agent使用的模型 |
| 生成的子Agent使用的模型 |
Installation
安装
Prerequisites
前提条件
- Claude Code CLI installed ()
npm install -g @anthropic-ai/claude-code - Node.js 18+ (for the proxy server)
- API key for at least one backend
- 已安装Claude Code CLI()
npm install -g @anthropic-ai/claude-code - Node.js 18+(用于代理服务器)
- 至少一个后端的API密钥
1. Clone the repo
1. 克隆仓库
bash
git clone https://github.com/aattaran/deepclaude.git
cd deepclaudebash
git clone https://github.com/aattaran/deepclaude.git
cd deepclaude2. Set API keys
2. 设置API密钥
macOS/Linux:
bash
undefinedmacOS/Linux:
bash
undefinedDeepSeek (default backend — get key at platform.deepseek.com)
DeepSeek(默认后端——在platform.deepseek.com获取密钥)
echo 'export DEEPSEEK_API_KEY="$DEEPSEEK_API_KEY"' >> ~/.bashrc
echo 'export DEEPSEEK_API_KEY="$DEEPSEEK_API_KEY"' >> ~/.bashrc
OpenRouter (optional — cheapest US latency)
OpenRouter(可选——美国区域延迟最低)
echo 'export OPENROUTER_API_KEY="$OPENROUTER_API_KEY"' >> ~/.bashrc
echo 'export OPENROUTER_API_KEY="$OPENROUTER_API_KEY"' >> ~/.bashrc
Fireworks AI (optional — fastest inference)
Fireworks AI(可选——推理速度最快)
echo 'export FIREWORKS_API_KEY="$FIREWORKS_API_KEY"' >> ~/.bashrc
source ~/.bashrc
**Windows (PowerShell):**
```powershell
setx DEEPSEEK_API_KEY $env:DEEPSEEK_API_KEY
setx OPENROUTER_API_KEY $env:OPENROUTER_API_KEY
setx FIREWORKS_API_KEY $env:FIREWORKS_API_KEYecho 'export FIREWORKS_API_KEY="$FIREWORKS_API_KEY"' >> ~/.bashrc
source ~/.bashrc
**Windows (PowerShell):**
```powershell
setx DEEPSEEK_API_KEY $env:DEEPSEEK_API_KEY
setx OPENROUTER_API_KEY $env:OPENROUTER_API_KEY
setx FIREWORKS_API_KEY $env:FIREWORKS_API_KEY3. Install the CLI
3. 安装CLI
macOS/Linux:
bash
chmod +x deepclaude.sh
sudo ln -s "$(pwd)/deepclaude.sh" /usr/local/bin/deepclaudeWindows (PowerShell):
powershell
Copy-Item deepclaude.ps1 "$env:USERPROFILE\.local\bin\deepclaude.ps1"macOS/Linux:
bash
chmod +x deepclaude.sh
sudo ln -s "$(pwd)/deepclaude.sh" /usr/local/bin/deepclaudeWindows (PowerShell):
powershell
Copy-Item deepclaude.ps1 "$env:USERPROFILE\.local\bin\deepclaude.ps1"Or add repo directory to PATH:
或将仓库目录添加至PATH:
setx PATH "$env:PATH;C:\path\to\deepclaude"
undefinedsetx PATH "$env:PATH;C:\path\to\deepclaude"
undefinedKey CLI commands
关键CLI命令
bash
undefinedbash
undefinedLaunch Claude Code with DeepSeek V4 Pro (default)
使用DeepSeek V4 Pro启动Claude Code(默认)
deepclaude
deepclaude
Show available backends and configured API keys
显示可用后端和已配置的API密钥
deepclaude --status
deepclaude --status
Select a specific backend
选择特定后端
deepclaude --backend ds # DeepSeek (default)
deepclaude --backend or # OpenRouter
deepclaude --backend fw # Fireworks AI
deepclaude --backend anthropic # Normal Claude Opus
deepclaude --backend ds # DeepSeek(默认)
deepclaude --backend or # OpenRouter
deepclaude --backend fw # Fireworks AI
deepclaude --backend anthropic # 原生Claude Opus
Show pricing comparison
显示价格对比
deepclaude --cost
deepclaude --cost
Latency benchmark across all configured providers
在所有已配置提供商之间进行延迟基准测试
deepclaude --benchmark
deepclaude --benchmark
Switch backend mid-session (proxy must be running)
会话中切换后端(需代理运行)
deepclaude --switch ds
deepclaude --switch or
deepclaude --switch anthropic
deepclaude --switch ds
deepclaude --switch or
deepclaude --switch anthropic
Remote control — open session in any browser
远程控制——在任意浏览器中打开会话
deepclaude --remote
deepclaude --remote --backend or
deepclaude --remote --backend anthropic
undefineddeepclaude --remote
deepclaude --remote --backend or
deepclaude --remote --backend anthropic
undefinedSupported backends
支持的后端
| Backend | Flag | Input/M | Output/M | Notes |
|---|---|---|---|---|
| DeepSeek | | $0.44 | $0.87 | Auto context caching (120x cheaper on repeat turns) |
| OpenRouter | | $0.44 | $0.87 | Lowest latency from US/EU |
| Fireworks AI | | $1.74 | $3.48 | Fastest inference, US servers |
| Anthropic | | $3.00 | $15.00 | Original Claude Opus |
| 后端 | 标识 | 输入/百万token | 输出/百万token | 说明 |
|---|---|---|---|---|
| DeepSeek | | $0.44 | $0.87 | 自动上下文缓存(重复轮次成本低120倍) |
| OpenRouter | | $0.44 | $0.87 | 美国/欧盟区域延迟最低 |
| Fireworks AI | | $1.74 | $3.48 | 推理速度最快,美国服务器 |
| Anthropic | | $3.00 | $15.00 | 原生Claude Opus |
Live backend switching (no restart)
实时后端切换(无需重启)
A local proxy runs on and intercepts all API calls. Switch backends instantly without restarting Claude Code.
localhost:3200本地代理运行在,可拦截所有API请求。无需重启Claude Code即可即时切换后端。
localhost:3200Proxy control endpoints
代理控制端点
bash
undefinedbash
undefinedSwitch backend
切换后端
curl -sX POST http://127.0.0.1:3200/_proxy/mode -d "backend=deepseek"
curl -sX POST http://127.0.0.1:3200/_proxy/mode -d "backend=openrouter"
curl -sX POST http://127.0.0.1:3200/_proxy/mode -d "backend=anthropic"
curl -sX POST http://127.0.0.1:3200/_proxy/mode -d "backend=deepseek"
curl -sX POST http://127.0.0.1:3200/_proxy/mode -d "backend=openrouter"
curl -sX POST http://127.0.0.1:3200/_proxy/mode -d "backend=anthropic"
Check current backend + uptime
查看当前后端+运行时长
Token usage and cost savings vs Anthropic
Token使用量及与Anthropic相比的成本节省
Cost endpoint response shape:
```json
{
"backends": {
"deepseek": {
"input_tokens": 125000,
"output_tokens": 45000,
"requests": 12,
"cost": 0.0941,
"anthropic_equivalent": 1.05
}
},
"total_cost": 0.0941,
"anthropic_equivalent": 1.05,
"savings": 0.9559
}
成本端点响应格式:
```json
{
"backends": {
"deepseek": {
"input_tokens": 125000,
"output_tokens": 45000,
"requests": 12,
"cost": 0.0941,
"anthropic_equivalent": 1.05
}
},
"total_cost": 0.0941,
"anthropic_equivalent": 1.05,
"savings": 0.9559
}Slash commands (recommended UX)
斜杠命令(推荐体验)
Create files in to switch backends from inside any Claude Code session:
~/.claude/commands/~/.claude/commands/deepseek.mdmarkdown
Switch the model proxy to DeepSeek. Run this command silently and report the result:
curl -sX POST http://127.0.0.1:3200/_proxy/mode -d "backend=deepseek"
If successful, say: "Switched to DeepSeek."~/.claude/commands/anthropic.mdmarkdown
Switch the model proxy back to Anthropic. Run this command silently and report the result:
curl -sX POST http://127.0.0.1:3200/_proxy/mode -d "backend=anthropic"
If successful, say: "Switched to Anthropic."~/.claude/commands/openrouter.mdmarkdown
Switch the model proxy to OpenRouter. Run this command silently and report the result:
curl -sX POST http://127.0.0.1:3200/_proxy/mode -d "backend=openrouter"
If successful, say: "Switched to OpenRouter."Then type , , or in any Claude Code session.
/deepseek/anthropic/openrouter在目录下创建文件,即可在任意Claude Code会话内切换后端:
~/.claude/commands/~/.claude/commands/deepseek.mdmarkdown
将模型代理切换至DeepSeek。静默运行此命令并报告结果:
curl -sX POST http://127.0.0.1:3200/_proxy/mode -d "backend=deepseek"
如果成功,回复:"已切换至DeepSeek。"~/.claude/commands/anthropic.mdmarkdown
将模型代理切换回Anthropic。静默运行此命令并报告结果:
curl -sX POST http://127.0.0.1:3200/_proxy/mode -d "backend=anthropic"
如果成功,回复:"已切换至Anthropic。"~/.claude/commands/openrouter.mdmarkdown
将模型代理切换至OpenRouter。静默运行此命令并报告结果:
curl -sX POST http://127.0.0.1:3200/_proxy/mode -d "backend=openrouter"
如果成功,回复:"已切换至OpenRouter。"之后在任意Claude Code会话中输入、或即可执行切换。
/deepseek/anthropic/openrouterVS Code keyboard shortcuts
VS Code键盘快捷键
.vscode/tasks.jsonjson
{
"version": "2.0.0",
"tasks": [
{
"label": "Proxy: Switch to DeepSeek",
"type": "shell",
"command": "curl -sX POST http://127.0.0.1:3200/_proxy/mode -d 'backend=deepseek'",
"presentation": { "reveal": "always" },
"problemMatcher": []
},
{
"label": "Proxy: Switch to Anthropic",
"type": "shell",
"command": "curl -sX POST http://127.0.0.1:3200/_proxy/mode -d 'backend=anthropic'",
"presentation": { "reveal": "always" },
"problemMatcher": []
},
{
"label": "Proxy: Switch to OpenRouter",
"type": "shell",
"command": "curl -sX POST http://127.0.0.1:3200/_proxy/mode -d 'backend=openrouter'",
"presentation": { "reveal": "always" },
"problemMatcher": []
}
]
}keybindings.jsonjson
[
{ "key": "ctrl+alt+d", "command": "workbench.action.tasks.runTask", "args": "Proxy: Switch to DeepSeek" },
{ "key": "ctrl+alt+a", "command": "workbench.action.tasks.runTask", "args": "Proxy: Switch to Anthropic" },
{ "key": "ctrl+alt+o", "command": "workbench.action.tasks.runTask", "args": "Proxy: Switch to OpenRouter" }
].vscode/tasks.jsonjson
{
"version": "2.0.0",
"tasks": [
{
"label": "Proxy: Switch to DeepSeek",
"type": "shell",
"command": "curl -sX POST http://127.0.0.1:3200/_proxy/mode -d 'backend=deepseek'",
"presentation": { "reveal": "always" },
"problemMatcher": []
},
{
"label": "Proxy: Switch to Anthropic",
"type": "shell",
"command": "curl -sX POST http://127.0.0.1:3200/_proxy/mode -d 'backend=anthropic'",
"presentation": { "reveal": "always" },
"problemMatcher": []
},
{
"label": "Proxy: Switch to OpenRouter",
"type": "shell",
"command": "curl -sX POST http://127.0.0.1:3200/_proxy/mode -d 'backend=openrouter'",
"presentation": { "reveal": "always" },
"problemMatcher": []
}
]
}keybindings.jsonjson
[
{ "key": "ctrl+alt+d", "command": "workbench.action.tasks.runTask", "args": "Proxy: Switch to DeepSeek" },
{ "key": "ctrl+alt+a", "command": "workbench.action.tasks.runTask", "args": "Proxy: Switch to Anthropic" },
{ "key": "ctrl+alt+o", "command": "workbench.action.tasks.runTask", "args": "Proxy: Switch to OpenRouter" }
]VS Code / Cursor terminal profiles
VS Code / Cursor终端配置文件
settings.jsonjson
{
"terminal.integrated.profiles.linux": {
"DeepSeek Agent": {
"path": "/usr/local/bin/deepclaude"
},
"DeepSeek (OpenRouter)": {
"path": "/usr/local/bin/deepclaude",
"args": ["--backend", "or"]
}
},
"terminal.integrated.defaultProfile.linux": "DeepSeek Agent"
}settings.jsonjson
{
"terminal.integrated.profiles.windows": {
"DeepSeek Agent": {
"path": "powershell.exe",
"args": ["-ExecutionPolicy", "Bypass", "-NoExit", "-File", "C:\\path\\to\\deepclaude.ps1"]
}
}
}macOS/Linux下的:
settings.jsonjson
{
"terminal.integrated.profiles.linux": {
"DeepSeek Agent": {
"path": "/usr/local/bin/deepclaude"
},
"DeepSeek (OpenRouter)": {
"path": "/usr/local/bin/deepclaude",
"args": ["--backend", "or"]
}
},
"terminal.integrated.defaultProfile.linux": "DeepSeek Agent"
}Windows下的:
settings.jsonjson
{
"terminal.integrated.profiles.windows": {
"DeepSeek Agent": {
"path": "powershell.exe",
"args": ["-ExecutionPolicy", "Bypass", "-NoExit", "-File", "C:\\path\\to\\deepclaude.ps1"]
}
}
}Remote control (browser UI)
远程控制(浏览器UI)
Open a Claude Code session in any browser with DeepSeek as the backend:
bash
deepclaude --remote # DeepSeek backend
deepclaude --remote --backend or # OpenRouter backend
deepclaude --remote --backend anthropic # Normal AnthropicTraffic split:
claude remote-control
├── Bridge WebSocket → wss://bridge.claudeusercontent.com (Anthropic, required)
└── Model API calls → http://localhost:3200 (proxy)
├── /v1/messages → active backend (DeepSeek/OR/etc.)
└── everything else → Anthropic (passthrough)Requirements for remote control:
- Must be logged in:
claude auth login - Must have a claude.ai subscription (bridge is Anthropic infrastructure)
在任意浏览器中打开以DeepSeek为后端的Claude Code会话:
bash
deepclaude --remote # DeepSeek后端
deepclaude --remote --backend or # OpenRouter后端
deepclaude --remote --backend anthropic # 原生Anthropic后端流量分配:
claude远程控制
├── 桥接WebSocket → wss://bridge.claudeusercontent.com(Anthropic,必需)
└── 模型API请求 → http://localhost:3200(代理)
├── /v1/messages → 当前激活后端(DeepSeek/OR等)
└── 其他请求 → 转发至Anthropic远程控制要求:
- 已登录:
claude auth login - 拥有claude.ai订阅(桥接服务依赖Anthropic基础设施)
Manually setting environment variables (without the CLI wrapper)
手动设置环境变量(不使用CLI包装器)
If you want to wire up the backend yourself without using the wrapper script:
deepclaudebash
undefined如果不想使用包装脚本,可自行配置后端:
deepclaudebash
undefinedDeepSeek
DeepSeek
export ANTHROPIC_BASE_URL="https://api.deepseek.com/v1"
export ANTHROPIC_AUTH_TOKEN="$DEEPSEEK_API_KEY"
export ANTHROPIC_DEFAULT_OPUS_MODEL="deepseek-chat"
export ANTHROPIC_DEFAULT_SONNET_MODEL="deepseek-chat"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="deepseek-chat"
export CLAUDE_CODE_SUBAGENT_MODEL="deepseek-chat"
claude # launch normally
export ANTHROPIC_BASE_URL="https://api.deepseek.com/v1"
export ANTHROPIC_AUTH_TOKEN="$DEEPSEEK_API_KEY"
export ANTHROPIC_DEFAULT_OPUS_MODEL="deepseek-chat"
export ANTHROPIC_DEFAULT_SONNET_MODEL="deepseek-chat"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="deepseek-chat"
export CLAUDE_CODE_SUBAGENT_MODEL="deepseek-chat"
claude # 正常启动
OpenRouter
OpenRouter
export ANTHROPIC_BASE_URL="https://openrouter.ai/api/v1"
export ANTHROPIC_AUTH_TOKEN="$OPENROUTER_API_KEY"
export ANTHROPIC_DEFAULT_OPUS_MODEL="deepseek/deepseek-chat-v3-0324"
export ANTHROPIC_DEFAULT_SONNET_MODEL="deepseek/deepseek-chat-v3-0324"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="deepseek/deepseek-chat-v3-0324"
export CLAUDE_CODE_SUBAGENT_MODEL="deepseek/deepseek-chat-v3-0324"
claude
undefinedexport ANTHROPIC_BASE_URL="https://openrouter.ai/api/v1"
export ANTHROPIC_AUTH_TOKEN="$OPENROUTER_API_KEY"
export ANTHROPIC_DEFAULT_OPUS_MODEL="deepseek/deepseek-chat-v3-0324"
export ANTHROPIC_DEFAULT_SONNET_MODEL="deepseek/deepseek-chat-v3-0324"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="deepseek/deepseek-chat-v3-0324"
export CLAUDE_CODE_SUBAGENT_MODEL="deepseek/deepseek-chat-v3-0324"
claude
undefinedWhat works and what doesn't
支持与不支持的功能
✅ Fully supported
✅ 完全支持
- File reading, writing, editing (/
Read/Writetools)Edit - Bash / PowerShell execution
- Glob and Grep search
- Multi-step autonomous tool loops
- Subagent spawning
- Git operations
- Project initialization ()
/init - Thinking mode (enabled by default)
- 文件读取、写入、编辑(/
Read/Write工具)Edit - Bash / PowerShell执行
- Glob和Grep搜索
- 多步骤自主工具循环
- 子Agent生成
- Git操作
- 项目初始化()
/init - 思考模式(默认启用)
⚠️ Not supported or degraded
⚠️ 不支持或功能受限
| Feature | Reason |
|---|---|
| Image / vision input | DeepSeek's Anthropic-compat endpoint doesn't support images |
| MCP server tools | Not supported through compatibility layer |
Anthropic prompt caching ( | Ignored; DeepSeek uses its own automatic caching |
| Parallel tool use | DeepSeek supports up to 128/call but Claude Code sends sequentially |
| 功能 | 原因 |
|---|---|
| 图片/视觉输入 | DeepSeek的Anthropic兼容端点不支持图片 |
| MCP服务器工具 | 兼容层不支持该功能 |
Anthropic提示缓存( | 被忽略;DeepSeek使用自身自动缓存机制 |
| 并行工具调用 | DeepSeek支持单次调用最多128个工具,但Claude Code会按顺序发送请求 |
Choosing the right backend
选择合适的后端
| Task type | Recommendation |
|---|---|
| Routine coding, refactoring, CRUD | DeepSeek (default) — 90% cost savings |
| US/EU latency sensitive | OpenRouter |
| Highest throughput / speed | Fireworks AI |
| Complex multi-step reasoning, architecture | Switch to |
Use for most work, for the hard 20% — then switch back.
/deepseek/anthropic| 任务类型 | 推荐方案 |
|---|---|
| 常规编码、重构、CRUD | DeepSeek(默认)——节省90%成本 |
| 对美国/欧盟区域延迟敏感 | OpenRouter |
| 最高吞吐量/速度需求 | Fireworks AI |
| 复杂多步骤推理、架构设计 | 切换至 |
大部分工作使用,遇到20%的复杂任务时切换至,完成后再切回。
/deepseek/anthropicTroubleshooting
故障排查
DEEPSEEK_API_KEYbash
undefined未找到:
DEEPSEEK_API_KEYbash
undefinedVerify the var is set in current shell
验证当前shell中变量是否已设置
echo $DEEPSEEK_API_KEY
echo $DEEPSEEK_API_KEY
If blank, re-source your profile
如果为空,重新加载配置文件
source ~/.bashrc # or ~/.zshrc
**`deepclaude: command not found`:**
```bashsource /.bashrc # 或/.zshrc
**`deepclaude: command not found`:**
```bashCheck symlink
检查符号链接
ls -la /usr/local/bin/deepclaude
ls -la /usr/local/bin/deepclaude
Re-create if missing
若缺失则重新创建
sudo ln -sf "$(pwd)/deepclaude.sh" /usr/local/bin/deepclaude
**Proxy not responding on port 3200:**
```bashsudo ln -sf "$(pwd)/deepclaude.sh" /usr/local/bin/deepclaude
**代理在3200端口无响应:**
```bashCheck if proxy process is running
检查代理进程是否运行
lsof -i :3200
lsof -i :3200
Restart deepclaude — proxy starts automatically
重启deepclaude——代理会自动启动
deepclaude
**`curl` not available on Windows for slash commands:**
```powershelldeepclaude
**Windows下斜杠命令缺少`curl`:**
```powershellUse PowerShell equivalent in the .md command files:
在.md命令文件中使用PowerShell等效命令:
Invoke-RestMethod -Uri http://127.0.0.1:3200/_proxy/mode -Method Post -Body 'backend=deepseek'
**Image inputs fail with DeepSeek:**
- Switch to Anthropic for that session: `deepclaude --switch anthropic`
- Or launch with: `deepclaude --backend anthropic`
**Remote control fails:**
```bashInvoke-RestMethod -Uri http://127.0.0.1:3200/_proxy/mode -Method Post -Body 'backend=deepseek'
**使用DeepSeek时图片输入失败:**
- 切换至Anthropic会话:`deepclaude --switch anthropic`
- 或启动时指定:`deepclaude --backend anthropic`
**远程控制失败:**
```bashEnsure you're authenticated
确保已完成认证
claude auth login
claude auth login
Verify subscription at claude.ai — bridge requires it
验证claude.ai订阅状态——桥接服务需要订阅权限
undefinedundefined