DeepClaude搭建教程:用DeepSeek跑Claude Code省90%
2分钟装好DeepClaude,用DeepSeek V4 Pro替代Anthropic作为Claude Code的推理后端,成本暴降17倍
入门 · 15 分钟 · 2026年5月4日
教程目标
在 15 分钟内,用 DeepClaude 把 Claude Code 的推理后端从 Anthropic 切换到 DeepSeek V4 Pro,API 费用从 $15/M token 降到 $0.87/M,省下 90% 以上的成本,且保持完整自主编码能力。
你将搭建什么
- DeepClaude 安装与配置 — 一条命令完成
- 多后端切换能力 — DeepSeek、OpenRouter 随意换
- 远程控制模式 — 浏览器里操控 Claude Code
- VS Code 集成 — IDE 内一键切换
准备清单
- DeepSeek API Key(免费注册,$5 起充)
- Claude Code CLI(已安装,有 Anthropic 账号)
- macOS / Linux 终端(Windows 也支持 PowerShell)
总体架构
整个系统只替换"大脑",不碰手脚。Claude Code 的工具循环(文件编辑、bash 执行、git 操作)保持不变,API 调用指向 DeepSeek。
| 模块 | 输入 | 输出 | 预估时间 |
|---|---|---|---|
| 获取 API Key | 注册 DeepSeek 平台 | sk-xxx 密钥 | 2 分钟 |
| 安装 DeepClaude | GitHub 仓库 | deepclaude 命令 | 1 分钟 |
| 首次运行 | deepclaude 命令 | Claude Code + DeepSeek | 2 分钟 |
| 多后端切换 | --backend 参数 | 不同推理模型 | 1 分钟 |
| VS Code 集成 | 配置终端 profile | IDE 内切换 | 5 分钟 |
| 远程控制 | --remote 参数 | 浏览器控制 | 3 分钟 |
第 1 步:获取 DeepSeek API Key
访问 platform.deepseek.com 注册账号,点击 API Keys 创建新密钥,充值 $5-$10 后复制密钥。
export DEEPSEEK_API_KEY="sk-your-key-here"提示:写入
~/.bashrc或~/.zshrc免重复设置。
第 2 步:安装 DeepClaude
git clone https://github.com/aattaran/deepclaude.git
cd deepclaude
chmod +x deepclaude.sh
sudo ln -s "$(pwd)/deepclaude.sh" /usr/local/bin/deepclaude第 3 步:启动 DeepClaude
直接运行 deepclaude 即可启动 Claude Code CLI,所有 API 请求自动指向 DeepSeek V4 Pro($0.87/M output token)。
第 4 步:多后端灵活切换
deepclaude --backend ds # DeepSeek(默认)
deepclaude --backend or # OpenRouter(美国服务器)
deepclaude --backend fw # Fireworks AI(最快推理)
deepclaude --backend anthropic # 回到 Anthropic Opus第 5 步:实时切换(高级功能)
安装代理后,Claude Code 会话内输入 /deepseek 即可秒切后端,无需重启。
第 6 步:远程控制
deepclaude --remote在任何浏览器中操控 Claude Code,手机平板上也能使用。
费用对比
| 使用场景 | Anthropic Max | DeepClaude | 节省 |
|---|---|---|---|
| 轻度使用 | $200/月 | ~$20/月 | 90% |
| 重度使用 | $200/月 | ~$50/月 | 75% |
| 自动循环 | $200/月 | ~$80/月 | 60% |
常见问题
DeepClaude 和直接用 Claude Code 有什么区别?
完全相同的操作界面,只替换了推理后端。日常 80% 任务 DeepSeek 表现与 Claude Opus 相当。
能用图片输入吗?需要 Anthropic 账号吗?
不支持图片输入。需要视觉任务切 --backend anthropic。Claude Code CLI 需要登录,但 API 调用可全走 DeepSeek。
工具词条
Claude Code、DeepSeek、OpenRouter、Fireworks AI、Anthropic