# 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](https://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.

<iframe class="aspect-video h-auto" width="100%" height="315" src="https://www.youtube.com/embed/vxrZWbZ2fZA"" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

## How it works

Standard Claude Code sends requests directly to `api.anthropic.com`. FCC sits between the client and the internet.

![A diagram showing how the fcc-server acts as a local proxy between multiple coding agent clients (Claude Code, Codex, Pi) and various backend providers.](https://imagedelivery.net/xZXo0QFi-1_4Zimer-T0XQ/3762e9e9-00d5-4afe-862d-ab332eb75c00/md2x =1920x1080)

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):

```command
curl -fsSL "https://raw.githubusercontent.com/Alishahryar1/free-claude-code/main/scripts/install.sh" | sh
```

![The installation command being executed in a dark-themed terminal.](https://imagedelivery.net/xZXo0QFi-1_4Zimer-T0XQ/e1c8f4da-13a9-4ac5-50b4-e2d53cc8ff00/md2x =1920x1080)

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:

```command
fcc-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`.

![The "Providers" tab of the Free Claude Code admin UI, showing a long list of configurable model providers like NVIDIA NIM, OpenRouter, and Groq.](https://imagedelivery.net/xZXo0QFi-1_4Zimer-T0XQ/9b3383b1-8d02-49fd-898c-155cff82a800/public =1920x1080)

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.

![The "Model Config" page of the admin UI, with a yellow arrow pointing to the "Default Model" dropdown menu where a user selects the primary model for routing.](https://imagedelivery.net/xZXo0QFi-1_4Zimer-T0XQ/4f971362-5be9-47a7-9ba6-de10fcb51800/orig =1920x1080)

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:

```command
fcc-claude
```

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:

```json
[label settings.json]
{
  "env": {
    "ANTHROPIC_BASE_URL": "http://localhost:8082",
    "ANTHROPIC_AUTH_TOKEN": "freecc",
    "CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY": "1"
  }
}
```

Restart the IDE after saving.

## Practical example: refactoring with a free model

With the proxy running and routed to NVIDIA NIM, a refactoring task:

![A close-up of the user prompt being typed into the VS Code terminal, instructing the AI to refactor the component.](https://imagedelivery.net/xZXo0QFi-1_4Zimer-T0XQ/ebf51935-8b15-4491-f8c8-8e2b9a6f3f00/orig =1920x1080)

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.

![A diagram showing how different types of tasks (Boilerplate, Refactoring, Hard reasoning) can be routed to different, appropriately-powered AI models (Gemini Flash, GPT-5 mini, Claude Opus).](https://imagedelivery.net/xZXo0QFi-1_4Zimer-T0XQ/4cfdc9a0-4461-4bfc-f25b-604ba219d200/md1x =1920x1080)

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.