MCPcopy
hub / github.com/Alishahryar1/free-claude-code

github.com/Alishahryar1/free-claude-code @main sqlite

repository ↗ · DeepWiki ↗
3,944 symbols 18,481 edges 385 files 1,411 documented · 36%
README

🤖 Free Claude Code

Use Claude Code CLI, Codex CLI, their VS Code extensions, JetBrains ACP, or chat bots through your own provider-backed proxy.

License: MIT Python 3.14 uv Tested with Pytest Type checking: Ty Code style: Ruff Logging: Loguru

Free Claude Code routes Anthropic Messages API traffic from Claude Code (CLI and VS Code extension) and OpenAI Responses API traffic from Codex (CLI and VS Code extension) to any provider. It keeps each client's protocol stable while letting you choose free, paid, or local models through the same proxy and Admin UI.

Quick Start · Providers · Clients · Integrations · Development

Free Claude Code in action

Claude Code running through the Free Claude Code proxy.

Codex CLI in action through Free Claude Code

Codex CLI using the local FCC Responses provider.

Claude Code model picker showing gateway models

Claude Code native /model picker with FCC gateway models.

Codex model picker showing generated FCC model catalog

Codex native /model picker with the generated FCC catalog.

Star History

  <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=Alishahryar1/free-claude-code&type=Date" width="700">

What You Get

  • Drop-in proxy for Claude Code's Anthropic API calls (/v1/messages, /v1/models).
  • Drop-in proxy for Codex via the OpenAI Responses API (/v1/responses).
  • fcc-claude and fcc-codex launchers that read the current Admin UI port and auth token each time they start.
  • 18 provider backends: NVIDIA NIM, OpenRouter, Google AI Studio (Gemini), DeepSeek, Mistral La Plateforme, Mistral Codestral, OpenCode Zen, OpenCode Go, Wafer, Kimi, Cerebras Inference, Groq, Fireworks AI, Cloudflare, Z.ai, LM Studio, llama.cpp, and Ollama.
  • Per-model routing for Claude Code: send Opus, Sonnet, Haiku, and fallback traffic to different providers.
  • Native Claude Code /model picker support through the proxy's /v1/models endpoint (see Model Picker).
  • Native Codex /model picker support when launched through fcc-codex, using a generated local model catalog.
  • Streaming, tool use, reasoning/thinking block handling, and local request optimizations.
  • Optional Discord or Telegram bot wrapper for remote Claude Code sessions.
  • Optional Usage through the Claude Code VS Code extension.
  • Codex CLI and VS Code extension support through the shared ~/.codex/config.toml provider config.
  • Optional voice-note transcription through local Whisper or NVIDIA NIM.
  • Local Admin UI at /admin to edit supported proxy settings, validate changes, and check providers (loopback access only).

Quick Start

1. Install/Update The Proxy

macOS/Linux:

curl -fsSL "https://github.com/Alishahryar1/free-claude-code/blob/main/scripts/install.sh?raw=1" | sh

Windows PowerShell:

irm "https://github.com/Alishahryar1/free-claude-code/blob/main/scripts/install.ps1?raw=1" | iex

Review the installers at scripts/install.sh and scripts/install.ps1. They install Claude Code and Codex when missing, then install or update the proxy. Re-run these commands to update to the latest version.

To remove only Free Claude Code (not uv, Claude Code, Codex, or the uv-managed Python runtime):

macOS/Linux:

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

Windows PowerShell:

irm "https://raw.githubusercontent.com/Alishahryar1/free-claude-code/main/scripts/uninstall.ps1" | iex

Review scripts/uninstall.sh and scripts/uninstall.ps1. They remove the FCC uv tool and always delete ~/.fcc/. Stop any running fcc-server, fcc-claude, fcc-codex, fcc-init, or free-claude-code process before uninstalling.

2. Start The Proxy

fcc-server

After startup, Uvicorn prints the proxy bind address and the app logs the admin URL:

INFO:     Admin UI: http://127.0.0.1:8082/admin (local-only)

Many terminals make these clickable. Use your configured PORT if it is not 8082.

3. Open The Admin UI And Configure NVIDIA NIM

Open the Admin UI URL from the terminal output.

Need an NVIDIA NIM API key? Use the NVIDIA NIM provider section below, then scroll back up here.

Local admin UI for proxy settings

Paste your NVIDIA NIM API key into NVIDIA_NIM_API_KEY, then click Validate and Apply.

The default model is already set to nvidia_nim/nvidia/nemotron-3-super-120b-a12b. You can change it later from the same Admin UI.

4. Run Your Coding Agent

Keep fcc-server running while you work.

Claude Code

fcc-claude

fcc-claude reads the current configured port and auth token each time it starts, sets the Claude Code environment variables (including a 190k-token CLAUDE_CODE_AUTO_COMPACT_WINDOW for auto-compaction), and then launches the real claude command. When proxy auth is disabled, it still passes ANTHROPIC_AUTH_TOKEN=fcc-no-auth so newer Claude Code versions do not stop at their local login gate before contacting the proxy.

Codex

fcc-codex

fcc-codex reads the same port and auth token, registers an ephemeral fcc model provider that points at the local proxy's /v1/responses endpoint, generates a Codex model catalog from the proxy's /v1/models response, sets FCC_CODEX_API_KEY from the Admin UI auth token, strips official OPENAI_* credentials from the child environment, and then launches the real codex command. Type /model inside Codex to open its native picker. Pass through Codex args as usual, for example fcc-codex exec "hello".

Choose A Provider

Pick one provider, enter its key or local URL in the Admin UI, and set MODEL to a provider-prefixed model slug. MODEL is the fallback. MODEL_OPUS, MODEL_SONNET, and MODEL_HAIKU can override routing for Claude Code's model tiers.

1. NVIDIA NIM

Get a key at build.nvidia.com/settings/api-keys.

In the Admin UI, paste it into NVIDIA_NIM_API_KEY. The default MODEL is nvidia_nim/nvidia/nemotron-3-super-120b-a12b.

Popular examples:

  • nvidia_nim/nvidia/nemotron-3-super-120b-a12b
  • nvidia_nim/z-ai/glm5.1
  • nvidia_nim/moonshotai/kimi-k2.5
  • nvidia_nim/minimaxai/minimax-m2.5

Browse models at build.nvidia.com.

2. OpenRouter

Get a key at openrouter.ai/keys.

In the Admin UI, paste it into OPENROUTER_API_KEY, then set MODEL to an OpenRouter slug such as open_router/openrouter/free.

Browse all models or free models.

3. Google AI Studio (Gemini)

Get a Gemini API key at Google AI Studio (see Google's Gemini OpenAI compatibility docs).

In the Admin UI, paste it into GEMINI_API_KEY, then set MODEL to a Gemini model slug such as gemini/models/gemini-3.1-flash-lite.

The Gemini API exposes an OpenAI-compatible endpoint at https://generativelanguage.googleapis.com/v1beta/openai/. Free tier quotas are per-model; prompts may be used to improve Google's products outside the UK/CH/EEA/EU unless your account region says otherwise—see Google's terms.

Popular examples:

  • gemini/models/gemini-3.1-flash-lite

4. DeepSeek

Get a key at platform.deepseek.com/api_keys.

In the Admin UI, paste it into DEEPSEEK_API_KEY, then set MODEL to a DeepSeek slug such as deepseek/deepseek-chat.

FCC uses DeepSeek's OpenAI-compatible Chat Completions endpoint so DeepSeek's prompt-cache hit/miss counters can be mapped into Claude-compatible usage metadata.

5. Mistral La Plateforme

Mistral hosts an OpenAI-compatible Chat Completions API at https://api.mistral.ai/v1. Activate the Experiment plan on console.mistral.ai for free-tier API access with rate limits (upgrade for higher quotas).

In the Admin UI, paste your API key into MISTRAL_API_KEY, then set MODEL to a Mistral model slug such as mistral/devstral-small-latest or mistral/mistral-small-latest.

Popular examples:

  • mistral/devstral-small-latest
  • mistral/mistral-small-latest

Browse models at Mistral documentation.

6. Mistral Codestral

Mistral's Codestral gateway uses a separate API key from La Plateforme: provision CODESTRAL_API_KEY, then route with the mistral_codestral/ prefix. The default upstream is https://codestral.mistral.ai/v1 (OpenAI-compatible Chat Completions; same request shaping as the mistral provider). See Mistral's coding / FIM domains; the curated free LLM API list summarizes typical Codestral access terms.

Popular examples:

  • mistral_codestral/codestral-latest

7. OpenCode Zen

Get an API key at opencode.ai/auth.

In the Admin UI, paste it into OPENCODE_API_KEY, then set MODEL to an OpenCode Zen model slug such as opencode/gpt-5.3-codex. The same OPENCODE_API_KEY powers OpenCode Go (below); use opencode_go/ slugs there.

OpenCode Zen is a curated model gateway that provides access to models from Anthropic, OpenAI, Google, DeepSeek, and more through a single API key and OpenAI-compatible endpoint at https://opencode.ai/zen/v1.

Popular examples:

  • opencode/gpt-5.3-codex
  • opencode/claude-sonnet-4
  • opencode/deepseek-v4-flash-free (free)
  • opencode/gemini-3-flash
  • opencode/big-pickle (free)
  • opencode/glm-5.1

Browse available models at opencode.ai.

8. OpenCode Go

Get an API key at opencode.ai/auth (same as OpenCode Zen).

In the Admin UI, use OPENCODE_API_KEY, then set MODEL to an OpenCode Go model slug such as opencode_go/minimax-m2.7.

OpenCode Go is a subscription gateway with its own curated catalog and OpenAI-compatible endpoint at https://opencode.ai/zen/go/v1. It shares the same OpenCode API key as Zen; only the slug prefix (opencode_go/ vs opencode/) and upstream path differ.

Popular examples:

  • opencode_go/minimax-m2.7

Browse available models at opencode.ai.

9. Wafer

Get a key from wafer.ai. In the Admin UI, paste it into WAFER_API_KEY, then set MODEL to a Wafer Pass model such as wafer/DeepSeek-V4-Pro.

Popular examples:

  • wafer/DeepSeek-V4-Pro
  • wafer/MiniMax-M2.7
  • wafer/Qwen3.5-397B-A17B
  • wafer/GLM-5.1

This provider uses Wafer's Anthropic-compatible endpoint at https://pass.wafer.ai/v1/messages.

10. Kimi

Get a key at platform.moonshot.ai/console/api-keys.

In the Admin UI, paste it into KIMI_API_KEY, then set MODEL to a Kimi slug such as kimi/kimi-k2.5.

This provider calls Kimi's Anthropic-compatible Messages API (https://api.moonshot.ai/anthropic/v1/messages; model discovery uses OpenAI-compat GET https://api.moonshot.ai/v1/models). It is not the OpenAI Chat Completions path.

Browse models

Core symbols most depended-on inside this repo

append
called by 402
messaging/transcript/segments.py
get
called by 150
providers/runtime/cache.py
format_sse_event
called by 134
core/anthropic/streaming/emitter.py
_build_request_body
called by 80
providers/zai/client.py
apply
called by 72
messaging/transcript/buffer.py
parse_sse_text
called by 71
core/anthropic/stream_contracts.py
resolve
called by 67
api/model_router.py
create_app
called by 53
api/app.py

Shape

Function 2,026
Method 1,512
Class 344
Route 62

Languages

Python99%
TypeScript1%

Modules by API surface

tests/config/test_config.py90 symbols
tests/providers/test_stream_ledger.py65 symbols
core/anthropic/streaming/ledger.py64 symbols
tests/providers/test_streaming_errors.py62 symbols
smoke/lib/e2e.py61 symbols
tests/api/test_request_utils.py59 symbols
tests/messaging/test_tree_concurrency.py53 symbols
tests/providers/test_converter.py50 symbols
tests/messaging/test_discord_markdown.py48 symbols
tests/messaging/test_discord_platform.py42 symbols
tests/providers/test_deepseek.py41 symbols
tests/cli/test_cli.py40 symbols

For agents

$ claude mcp add free-claude-code \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact