anymodel-for-claude-code
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "anymodel-for-claude-code" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-0ec269a9fea61b2ac2618cc89149b785002da32ec78f4663f6d8099e26d31dfb. Verify the upstream source and version against https://skillhub.cn/skills/user_829e5b4f/anymodel-for-claude-code before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
An arbitrary-model proxy solution for Claude Code that uses a local zero-dependency Node proxy to convert Anthropic↔OpenAI protocols. Enables Claude Code to target 8 providers and 21 models such as DeepSeek, SilicaFlow, OpenRouter, Zhipu GLM, Kimi, Google Gemini, Qwen, and Groq. Includes tool-use bidirectional conversion, a management UI for one-click switching, and local API key storage. Designed for using Claude Code without VPN or credit card, with Windows prioritized.
Introduction source: third_party · user_829e5b4f · 1.1.0 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Audience
- Not specified in the source documentation.
- Inputs and outputs
- Not specified in the source documentation.
- Software, accounts and paid services
- Translation pending; see source documentation.
- Limits and differences
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: anymodel-for-claude-code
slug: anymodel-for-claude-code
displayName: AnyModel for Claude Code
description: Claude Code 任意模型代理 —— 让 Claude Code 免 VPN、免信用卡,直接使用 DeepSeek / 硅基流动 / OpenRouter / 智谱 GLM / Kimi / Google Gemini / 通义千问 Qwen / Groq 等 8 家 21 个模型。本地零依赖 Node 代理做 Anthropic↔OpenAI 协议转换,tool use 双向转换,管理界面一键切换,API Key 本地落盘,Windows 优先。
version: 1.1.0
category: 开发工具
platforms: [WorkBuddy, QClaw, Claude Code, Cursor]AnyModel for Claude Code — Claude Code 任意模型代理
功能说明
让 Claude Code 无需 VPN、无需信用卡,直接使用国内和国际 8 家供应商的 21 个大模型。通过本地零依赖 Node 代理做 Anthropic↔OpenAI 协议双向转换,Claude Code 的工具调用(执行命令、读写文件等)完全正常。
适用场景:
- 中国境内无法直接连 Anthropic API 的开发者
- 不想绑信用卡、想用 DeepSeek/Qwen 等国产模型的开发者
- 需要在多个模型间快速切换对比的开发者
- 希望有可视化管理界面监控模型调用的开发者
输入:Claude Code 发出的 Anthropic Messages API 请求 输出:经过协议转换后返回的 Anthropic 格式响应(支持 SSE 流式 + tool_use)
使用方法
Step 1:填写 API Key
两种方式任选其一:
- 方式 A — 界面填写(推荐):启动后打开
http://localhost:4000管理界面,在「配置 API 密钥」卡片里逐家填入,保存即写入data/keys.json(密钥仅存本机,不上传)。 - 方式 B — 环境变量:设置
DEEPSEEK_KEY、SILICONFLOW_KEY、OPENROUTER_KEY、ZHIPU_KEY、MOONSHOT_KEY、GEMINI_KEY、QWEN_KEY、GROQ_KEY等环境变量。
Step 2:启动代理
cd scripts
node check-env.js # 可选:先看环境自检
node proxy.js # 启动代理
代理启动后监听 http://127.0.0.1:4000。
Step 3:打开管理界面
浏览器访问 http://localhost:4000:
- 环境自检卡片:确认 Node / 端口 / Claude 配置 / 已配 Key 全绿
- 选择模型:点任意模型卡片即切换(实时生效)
- 配置 API 密钥:逐家填入并保存
- 接入 Claude Code:点「📋 复制 settings.json」拿到现成配置
Step 4:接入 Claude Code
把界面复制的配置粘进 ~/.claude/settings.json 的 env 字段:
{
"env": {
"ANTHROPIC_API_URL": "http://127.0.0.1:4000",
"ANTHROPIC_BASE_URL": "http://127.0.0.1:4000",
"ANTHROPIC_AUTH_TOKEN": "sk-local-proxy",
"ANTHROPIC_MODEL": "default",
"ANTHROPIC_SMALL_FAST_MODEL": "default"
}
}
ANTHROPIC_MODEL设default,之后在管理界面点一下即可换模型,无需重启 Claude CodeANTHROPIC_AUTH_TOKEN:代理不校验,填任意值- 保存配置后,完全退出并重开 VS Code 的 Claude Code 会话(新会话才生效)
Step 5:使用与验证
- 每次用 Claude Code 前先启动代理(保持
proxy.js运行) - 切换模型:在
http://localhost:4000界面点目标模型即可 - 验证:在 Claude Code 发任意消息,回管理界面看「活动日志」是否出现记录
示例
示例 1:使用 DeepSeek 模型
- 在管理界面「配置 API 密钥」填写 DeepSeek Key
- 点击
deepseek-chat模型卡片 - 正常使用 Claude Code,所有请求自动走 DeepSeek
示例 2:切换到通义千问
- 填写 QWEN_KEY
- 点击
qwen-max模型卡片 - 下一条 Claude Code 请求自动走通义千问
示例 3:零密钥快速验证(不用 Key 也能测)
curl http://127.0.0.1:4000/api/selftest
# 期望: {"ok":true,"events":[...]}
或在界面点「🔧 运行自检」按钮,验证 Anthropic↔OpenAI 转换链路。
支持的模型(开箱即用 · 21 个)
| 模型别名 | 上游服务 | 上游实际模型 | 环境变量 |
|---|---|---|---|
deepseek-chat / deepseek-reasoner |
DeepSeek | deepseek-chat / deepseek-reasoner | DEEPSEEK_KEY |
sf-qwen-72b / sf-deepseek-v3 / sf-glm-4-9b |
硅基流动 SiliconFlow | Qwen2.5-72B / DeepSeek-V3 / glm-4-9b | SILICONFLOW_KEY |
or-deepseek / or-qwen / or-llama |
OpenRouter | deepseek-chat / qwen-72b / llama-3.1-70b | OPENROUTER_KEY |
glm-4-plus / glm-4-air |
智谱 GLM | glm-4-plus / glm-4-air | ZHIPU_KEY |
kimi-chat |
Kimi (Moonshot) | moonshot-v1-8k | MOONSHOT_KEY |
gemini-2.5-pro / gemini-2.5-flash / gemini-2.0-flash |
Google Gemini | gemini-2.5-pro / gemini-2.5-flash / gemini-2.0-flash | GEMINI_KEY |
qwen-max / qwen-plus / qwen-turbo / qwen2.5-72b |
通义千问 Qwen | qwen-max / qwen-plus / qwen-turbo / qwen2.5-72b | QWEN_KEY |
groq-llama-70b / groq-llama-8b / groq-deepseek-r1 |
Groq | llama-3.3-70b / llama-3.1-8b / deepseek-r1-distill | GROQ_KEY |
别名
default和auto是特殊保留字:发给代理时会被解析为「界面当前选中的模型」。 内置自检别名echo:不消耗外部 API、不需要密钥,直接回放模拟响应验证链路。
新增模型只需在 config.json 的 providers 里加一项,无需改代码。
环境与依赖
- 必需:Node.js ≥ 14(零 npm 依赖)
- 不需要:Python、任何第三方 npm 包
- 端口:默认 4000(仅本地 127.0.0.1,不暴露公网)
- 安全:密钥仅存本机(
data/keys.json),不硬编码进代码
管理 API
| 方法 | 路径 | 说明 |
|---|---|---|
| GET | /api/env |
环境自检结果 |
| GET | /api/models |
当前模型 + 全部供应商与模型别名 |
| GET | /api/status |
存活探活 |
| GET | /api/logs |
活动日志(最近请求:模型/供应商/状态/耗时) |
| GET | /api/selftest |
内置自检(免密钥) |
| POST | /api/switch |
切换当前模型 |
| POST | /api/keys |
保存/清除密钥 |
限制说明
- 需要本地运行代理:Claude Code 每次使用前需确保
proxy.js在运行,代理未启动则 Claude Code 无法连接 - 仅支持 Anthropic Messages API 协议:不支持 Anthropic 原始 API 的所有高级特性(如 image blocks 的完整转换)
- 上游 API 可用性依赖外部服务:各供应商的 API 稳定性由供应商自身保证
- API Key 由用户自行管理:平台不提供 Key,用户需自行向各供应商注册获取
- 仅监听 127.0.0.1:不暴露到公网,但也不支持远程访问
- Windows 优先设计:核心功能跨平台可用,但启动脚本和路径检测以 Windows 为主要场景
故障排查
| 症状 | 可能原因 | 解决方案 |
|---|---|---|
| curl 连接拒绝 | 代理未启动 | 运行 node proxy.js |
| EADDRINUSE | 端口被占 | PowerShell: $p=(Get-NetTCPConnection -LocalPort 4000).OwningProcess; Stop-Process -Id $p -Force |
| 回复正常但不能执行工具 | tool use 失败 | 用 /api/selftest 验证 |
| 429 错误 | 上游余额不足 | 检查上游账户余额 |
| 500 "缺少 API key" | Key 未配 | 在界面「配置 API 密钥」填写 |
Resources
scripts/
- proxy.js:Node 原生实现的 Anthropic↔OpenAI 协议代理,零依赖。支持流式响应、tool_use 双向转换、多 provider 路由、default/auto 热切换、模型选择持久化、活动日志、内置 echo 自检。
- config.json:8 家供应商配置,API key 用
${ENV}占位(运行时从环境变量读取),也可由界面写data/keys.json覆盖。 - ui.html:管理界面(选模型 / 配 Key / 复制 settings.json / 中英文 / 深浅主题)。
- check-env.js:安装前环境自检(Node ≥14 / 端口 / Claude 配置 / Key),缺项直接提示。
data/(运行时生成)
- keys.json:界面保存的 API Key,仅本机、不上传。
- state.json:界面选中的当前模型,重启代理后保持上次选择。
Current listing version
1.1.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 解决 Claude Code 无法直连 Anthropic API 的实际痛点,支持 8 家 21 个模型,实用性强
- 适用于中国境内开发者、免信用卡用户、多模型切换对比等广泛场景
Highlights
- 触发词精准覆盖 Claude Code、模型代理、协议转换等核心功能,边界清晰
Highlights
- 文档结构完整,包含功能说明、分步骤使用方法、示例、模型列表、故障排查等
- frontmatter 完整,单文件未超 500 行,排版规范
Highlights
- Node.js 原生实现,零依赖,工具来源明确
- 覆盖端口占用、API Key 缺失、上游错误等主要异常,提供自检和日志监控
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
-
Accounts, secrets or authorization
Use a dedicated least-privilege account. Keep secrets out of public content and command logs; verify the receiving service and tenant.
Mentioned in main document · lines 5, 28, 32, 50, 83
Domains or addresses referenced in the document
These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.
- 127.0.0.1
- localhost
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Translation pending; see source documentation.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.