free-claude-code
CLI ToolAlishahryar1/free-claude-code
Free proxy to use Claude Code with alternative AI providers like NVIDIA or DeepSeek.
Overview
A local proxy server that routes Claude Code's API calls to free or local AI providers such as NVIDIA NIM, OpenRouter, DeepSeek, and Ollama. It allows using Claude Code without an Anthropic subscription by translating the protocol to compatible backends. Supports streaming, tool use, and model routing.
README Preview
\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
FAQ (1)
TroubleshootingHow to fix free-claude-code proxy 422 error when Claude Code sends system messages?
Update the Message model in api/models/anthropic.py (line 95) to allow the "system" role: role: Literal["user", "assistant", "system"]. After editing, restart the proxy. Note: This is a local patch that will be overwritten on update; for a permanent fix, the source repository must be updated.