Free Claude Code: Route Claude Code to Any LLM Provider
Claude Code's interface is polished and its file editing, tool use, and project context handling are excellent. Its default model is also one of the more expensive ways to do AI-assisted coding. Free Claude Code (FCC) is a local proxy that intercepts Claude Code's API calls and routes them to any of 25 cloud and local providers, including NVIDIA NIM, OpenRouter, Gemini, DeepSeek, Mistral, Groq, Cerebras, GitHub Models, Ollama, and LM Studio.
The project is at github.com/Alishahryar1/free-claude-code, built by Alishahryar1, MIT-licensed, and written in Python 3.14 with FastAPI. It has around 37,000 GitHub stars. The same proxy also works with Codex, Pi, OpenCode, Cline, DeepSeek Harness, Grok Build, Muse Code, and Aider.
How it works
Standard Claude Code sends requests directly to api.anthropic.com. FCC sits between the client and the internet.
Your client sends requests to http://127.0.0.1:8082, which exposes the same Anthropic API endpoints. FCC translates the request format and forwards it to whichever provider and model you've configured. The response comes back translated into the format Claude Code expects. Streaming, tool use, reasoning blocks, and image input all pass through correctly on compatible models.
Routing rules can be set per model tier: you can route Fable requests to one provider, Opus to another, Sonnet to a third, and use a local model for Haiku-class requests. This per-tier routing is what makes strategic cost optimization practical.
Two additional efficiency features: optional RTK filtering reduces terminal output tokens by up to 90% by filtering common command output before it reaches the provider, and five local optimizations handle quota probes, command-prefix detection, titles, suggestions, and file paths without making any provider API call at all.
Installation
FCC requires Python 3.14 and uv (the Python package manager):
The script installs the package and makes fcc-server, fcc-claude, fcc-codex, and other launcher commands available in your shell.
Start the proxy server:
The server runs on port 8082 and opens the Admin UI automatically in your browser. Keep this terminal open or run the server as a background process.
Configuring providers and routing
Adding a provider key
Navigate to the Providers tab in the Admin UI at http://localhost:8082/admin.
For each provider you want to use: get an API key from their dashboard, paste it into the corresponding field in the Admin UI, and click Apply. The default model after setup is nvidia_nim/nvidia/nemotron-3-super-120b-a12b, which is a strong free starting point. NVIDIA NIM is the recommended first provider because the free tier is generous and the default model handles most coding tasks well.
Configuring routing
Navigate to Model Config in the left sidebar.
Set the Default Model from the dropdown: this is what handles all requests unless a more specific rule applies. You can also configure per-tier overrides to route Fable, Opus, Sonnet, and Haiku requests to different models. Click Apply to save.
Using the proxied client
Instead of claude, run:
For Codex, Grok Build, DeepSeek Harness, or other supported agents, the corresponding launcher is fcc-codex, fcc-grok, fcc-dsh, and so on. The launchers set the right environment variables (ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN, CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY) automatically.
The interface looks identical to standard Claude Code. The native /model picker works and shows FCC gateway models. The client doesn't know routing happened behind it.
For VS Code and JetBrains, add these to your Claude Code extension settings:
Restart the IDE after saving.
Practical example: refactoring with a free model
With the proxy running and routed to NVIDIA NIM, a refactoring task:
The agent reads the project context, inspects the target file, generates a diff showing proposed changes, and asks for approval before applying. For a moderately complex refactoring task, a capable free model handles it correctly. The same workflow — file inspection, diff generation, confirmation prompt — works identically to standard Claude Code.
Strategic model routing
The more powerful use case is per-tier routing rather than a single replacement model.
Most coding tasks (renaming variables, writing boilerplate, generating unit tests, explaining a function) don't need frontier-level reasoning. Routing these to a free or cheap model and reserving your premium model for genuinely complex tasks is the practical cost optimization. With per-tier routing configured, you can set:
- Haiku requests → local Ollama model (zero cost, fully private)
- Sonnet requests → Gemini Flash or Groq
- Opus/Fable requests → the real Anthropic model when you actually need it
The proxy aggregates around 1.3 billion free tokens per month across all configured providers, which covers a significant volume of everyday coding tasks.
What this doesn't change
The interface can't compensate for a weak model. If the underlying model struggles with multi-step planning, tool use, or following complex instructions, you'll get poor results regardless of how Claude Code presents them. The quality of output depends entirely on the capabilities of the model handling the request.
Models also have different strengths. A model that handles refactoring well may be less reliable for architectural reasoning or generating correct test suites. Testing your configured model on your actual workload before relying on it is worth doing.
FCC follows provider terms of service. The README documents which provider terms apply to proxied use. The rule of thumb: one account per provider, no reselling access, don't use free tiers as a production backend. Using it within those limits is straightforward.
Voice input is supported via local Whisper or NVIDIA NIM transcription, which feeds into Claude Code, Codex, or other clients through Discord or Telegram bot integrations. The messaging platform setup is covered in the Admin UI under Messaging.