简体中文| English
使用 DeepSeek 官方 Anthropic 兼容接口运行 Claude Code。
无需登录 Anthropic 账号,仅需 DeepSeek API Key。
- 支持 Claude Code
- 使用 DeepSeek 官方 Anthropic 兼容接口
- 无需 Claude / Anthropic 账号
- macOS Keychain 安全存储 API Key
- Windows DPAPI 加密存储 API Key
- 自动生成 Claude Code 配置
- 开箱即用
默认模型:
| 类型 | 模型 |
|---|---|
| 主模型 | deepseek-v4-pro[1m] |
| 快速模型 | deepseek-v4-flash |
DeepSeek开放平台:
https://platform.deepseek.com/api_keys
安装 Node.js(LTS 版本):
安装完成后重新打开终端,确认:
npm --version如果尚未安装 Claude Code:
npm install -g @anthropic-ai/claude-code安装完成后确认:
claude --version下载:
install-mac.sh
macOS 可直接双击:
install-mac.sh
首次运行如果被系统拦截:
- 系统设置
- 隐私与安全性
- 允许脚本运行
进入脚本目录:
cd 脚本所在目录执行:
chmod +x install-mac.sh
./install-mac.sh脚本会要求输入一次 API Key。
输入时终端不会显示内容,这是正常现象。
重新打开终端:
claude测试:
claude -p "你好,只回答 OK"API Key 会保存到 macOS Keychain:
- 不会明文写入 shell 配置
- 不会暴露到环境变量
下载:
install-windows.ps1
不要直接双击 .ps1 文件。
推荐方式:
在脚本所在目录:
- 按住
Shift - 鼠标右键
- 点击:
在此处打开 PowerShell
或者:
在终端中打开
执行:
powershell -ExecutionPolicy Bypass -File .\install-windows.ps1如果当前 PowerShell 不在脚本目录:
先切换目录:
cd D:\your-folder再执行:
powershell -ExecutionPolicy Bypass -File .\install-windows.ps1脚本会要求输入一次 API Key。
输入时终端不会显示内容,这是正常现象。
重新打开:
- PowerShell
- Windows Terminal
运行:
claude测试:
claude -p "你好,只回答 OK"API Key 会通过 Windows DPAPI 加密后保存:
%USERPROFILE%\.claude\deepseek-api-key.secret
该文件只能由当前 Windows 用户解密。
说明未安装 Node.js,或安装后未重新打开终端。
下载:
如果 Windows PowerShell 报:
无法加载文件 xxx.ps1,因为在此系统上禁止运行脚本
或者:
npm.ps1 无法运行
这是 Windows PowerShell 的执行策略(Execution Policy)限制,不是脚本本身损坏。
运行本项目安装脚本时,推荐使用临时绕过方式:
powershell -ExecutionPolicy Bypass -File .\install-windows.ps1该方式只对本次命令生效,不会永久修改系统策略。
如果是执行 npm 时遇到 npm.ps1 无法运行,可以改用:
npm.cmd --version或重新打开 cmd / Windows Terminal 后再试。
通常是旧配置残留。
重新运行安装脚本即可自动覆盖:
macOS:
~/.claude/settings.json
Windows:
%USERPROFILE%\.claude\settings.json
如果看到黄色提示:
Auth conflict
说明同时存在:
ANTHROPIC_AUTH_TOKENapiKeyHelper
删除环境变量即可。
macOS / Linux:
unset ANTHROPIC_AUTH_TOKENWindows:
Remove-Item Env:ANTHROPIC_AUTH_TOKEN如果 Windows 报:
ParserError
UnexpectedToken
或者脚本中文乱码:
说明使用了旧版脚本。
新版脚本已经:
- 使用纯 ASCII
- 兼容 Windows PowerShell 5.1
请重新下载最新版脚本。
如果运行:
claude时出现:
apiKeyHelper failed
ConvertTo-SecureString
说明旧版脚本生成了错误的密钥文件。
重新运行新版:
powershell -ExecutionPolicy Bypass -File .\install-windows.ps1即可自动修复。
重新运行安装脚本即可覆盖旧 Key。
macOS:
./install-mac.shWindows:
powershell -ExecutionPolicy Bypass -File .\install-windows.ps1当前安装脚本默认写入:
"CLAUDE_CODE_EFFORT_LEVEL": "xhigh"后续如果想调整,可以改成以下任意一档:
low
medium
high
xhigh
max
macOS:
nano ~/.claude/settings.json找到 CLAUDE_CODE_EFFORT_LEVEL,把它改成想使用的档位,例如:
"CLAUDE_CODE_EFFORT_LEVEL": "max"Windows:
打开 PowerShell,直接执行:
$settings = Join-Path $env:USERPROFILE ".claude\settings.json"
$json = Get-Content $settings -Raw | ConvertFrom-Json
$json.env.CLAUDE_CODE_EFFORT_LEVEL = "max"
$json | ConvertTo-Json -Depth 10 | Set-Content $settings -Encoding UTF8这段命令不需要在安装脚本目录执行,因为它会直接修改当前 Windows 用户的:
%USERPROFILE%\.claude\settings.json
把示例里的 "max" 换成你想使用的档位即可。修改后重新打开终端,或重新运行 claude。
删除 Claude 配置:
rm -rf ~/.claude如需删除 Keychain 中保存的 API Key:
打开:
钥匙串访问
搜索:
deepseek
手动删除对应记录。
删除配置目录:
Remove-Item -Recurse -Force "$env:USERPROFILE\.claude"本项目仅用于:
- 配置 Claude Code
- 转发请求到 DeepSeek 官方 Anthropic 兼容接口
用户需自行承担 API 使用费用。
本项目与 Anthropic、DeepSeek 官方无关联。