free-claude-code

命令行工具

Alishahryar1/free-claude-code

免费代理,将 Claude Code 连接到多种 AI 提供商。

项目简介

本地代理服务器,将 Claude Code 的 API 调用路由到 NVIDIA NIM、OpenRouter、DeepSeek、Ollama 等免费或本地 AI 提供商。无需 Anthropic 订阅即可使用 Claude Code,支持流式响应、工具调用和模型路由。

README 预览

\n\n# 🤖 Free Claude Code\n\nUse Claude Code CLI, VS Code, JetBrains ACP, or chat bots through your own Anthropic-compatible proxy.\n\n[](https://opensource.org/licenses/MIT)\n[](https://www.python.org/downloads/)\n[](https://github.com/astral-sh/uv)\n[](https://github.com/Alishahryar1/free-claude-code/actions/workflows/tests.yml)\n[](https://pypi.org/project/ty/)\n[](https://github.com/astral-sh/ruff)\n[](https://github.com/Delgan/loguru)\n\nFree Claude Code routes Anthropic Messages API traffic from Claude Code to NVIDIA NIM, OpenRouter, DeepSeek, LM Studio, llama.cpp, or Ollama. It keeps Claude Code's client-side protocol stable while letting you choose free, paid, or local models.\n\n[Quick Start](#quick-start) · [Providers](#choose-a-provider) · [Clients](#connect-claude-code) · [Troubleshooting](#troubleshooting) · [Development](#development)\n\n\n\n\n  \n\n\n## Star History\n\n\n  \n    \n      \n      \n      \n    \n  \n\n\n## What You Get\n\n- Drop-in proxy for Claude Code's Anthropic API calls.\n- Six provider backends: NVIDIA NIM, OpenRouter, DeepSeek, LM Studio, llama.cpp, and Ollama.\n- Per-model routing: send Opus, Sonnet, Haiku, and fallback traffic to different providers.\n- Native Claude Code `/model` picker support through the proxy's `/v1/models` endpoint (Claude Code must opt in to Gateway model discovery; see [Model Picker](#model-picker)).\n- Streaming, tool use, reasoning/thinking block handling, and local request optimizations.\n- Optional Discord or Telegram bot wrapper for remote coding sessions.\n- Optional voice-note transcription through local Whisper or NVIDIA NIM.\n\n## Quick Start\n\n### 1. Install Requirements\n\nInstall [Claude Code](https://github.com/anthropics/claude-code), then install `uv` and Python 3.14.\n\nmacOS/Linux:\n\n```bash\ncurl -LsSf https://astral.sh/uv/install.sh | sh\nuv self update\nuv python install 3.14\n```\n\nWindows PowerShell:\n\n```powershell\npowershell -ExecutionPolicy ByPass -c "irm https://astral.sh/u

常见问题 (4)

故障排除
如何修复Claude Code发送系统消息时的free-claude-code代理422错误

在 api/models/anthropic.py(第95行)中更新 Message 模型,允许 "system" 角色:role: Literal["user", "assistant", "system"]。编辑后重启代理。注意:此为本地补丁,更新后会被覆盖;如需永久修复,必须更新源仓库。

来源 Issue #611
故障排除
为什么 Free Claude Code (FCC) 中的所有模型突然停止工作,我该如何修复?

此问题影响 FCC 6.16.15 版本,该版本仍指向已停用的 NVIDIA Super 端点,导致所有模型请求均失败。重新安装或更换 API 密钥无法解决此问题。修复方法:运行 fcc-update 升级到 6.16.16 或更高版本——该版本会自动将 NVIDIA Super 选项迁移到新的 Ultra 端点——然后重启 FCC。如果更新后仍然失败,请打开 FCC 设置页面,更正所有错误的模型映射。

来源 Issue #2148
故障排除
为什么 Free Claude Code 的菜单栏(托盘)图标在 macOS 上不显示了?该如何修复?

这是一个从 ~/Applications/Free Claude Code.app 启动 FCC 时的已知问题:该 bundle 的可执行文件是一个 shell 脚本,它会 exec 一个位于 bundle 之外的 Python 解释器,而 macOS 不会为这种启动器模式显示状态栏项(无论是否设置 LSUIElement 或进行临时 codesign -s - 签名,该问题都会存在)。服务器仍在运行,http://localhost:8082/admin 也能正常访问,但你会失去 Open Admin / Restart Server / Quit 托盘菜单。临时解决方法:先用 pkill -f fcc-desktop 终止正在运行的实例,然后在终端中直接运行 fcc-desktop 启动 FCC——菜单栏图标即可正常显示。请注意,再次点击 .app 不会有任何反应,因为第二个实例会发现 desktop.lock 已被持有,然后静默退出。永久性修复需要使用编译的启动器二进制文件,或一个自带/链接其自身 Python 可执行文件的 bundle。

来源 Issue #2092
故障排除
如何修复 Claude Code 中出现的 "There's an issue with the selected model. It may not exist or you may not have access to it" 错误?

此错误表示 Claude Code 对所选模型(例如 claude-opus-5)的请求被后端拒绝——服务器日志显示 POST /v1/messages?beta=true 反复收到 404 Not Found 响应,这意味着该模型没有对应的路由/处理程序。解决方法:在 Claude Code 中运行 /model,切换到你的提供商或代理实际支持的模型,然后重试提示。如果你通过 FCC 等代理路由 Claude Code,请验证你的 FCC 版本已为所选模型注册了端点,在更改配置后重启服务器,并运行 fcc doctor 以确认提供商配置。

来源 Issue #2131