Open Source · Free Tier · 9 Providers

Universal Free LLM Proxy

Run Claude Code, Agent Team, ZeroClaw, Aider, Cline, and mini-agent on 9 free-tier providers instead of paying for the Claude API.

View on GitHub Claude Code Setup Quick Install
one-line install
curl -fsSL https://raw.githubusercontent.com/Mitriyweb/model-router/main/install.sh | bash
STEP 1
bun run dev
Start the proxy on :8787
STEP 2
ANTHROPIC_BASE_URL=http://localhost:8787
Point Claude Code here
STEP 3
claude
Run free 🎉
9
Free providers
2
API formats (Anthropic + OpenAI)
$0
Monthly API cost possible
1M+
Tokens/day (Cerebras trial)

Supported Providers

All free tiers — configure only the ones you have keys for.

CerebrasTrial
1M+ tokens / day
Ultra-fast Llama-3.3-70b, trial-tier daily budget with finite usage
GroqFree
30 RPM / 6k TPM / 14.4k RPD
Instant streaming and fast tool calling via Llama, Gemma, Mistral
Google GeminiFree
15 RPM / 1M TPM / 1.5k RPD
Best for large context windows (>4k tokens) via Gemini 2.5 Flash
Mistral AIFree
2 RPM / ~1B tokens/month
Codestral for code generation, Mistral Large for reasoning
OpenRouterFree
20 RPM / 50 RPD (free models)
Access to 100+ open models from a single endpoint
NVIDIA NIMFree
40 RPM / 1,000 requests
90+ GPU-accelerated models: Llama, DeepSeek, Phi, Qwen
Cloudflare AIFree
60 RPM / 10k RPD
Serverless edge inference on Cloudflare's global network
CohereFree
10 RPM / 100 RPD
Command R+ with advanced RAG and tool-use capabilities
Local (Ollama)Unlimited
No limits, fully offline
Any Ollama model — Qwen2.5-Coder, Mistral, Llama 3.2 and more

How It Works

One proxy, two API formats, nine providers — automatic fallback and rate limiting built-in.

  Claude Code / Agent Team       ZeroClaw / Aider / mini-agent
  (Anthropic API)                 (OpenAI API)
        │                               │
        │ POST /v1/messages             │ POST /v1/chat/completions
        ▼                               ▼
  ┌─────────────────────────────────────────────────┐
  │              model-router                      │
  │   [Rate Limiter] [SHA-256 Cache] [Fallback]     │
  └──────────────────────┬──────────────────────────┘
                         │
        ┌────────────────┼────────────────┐
        ▼                ▼                ▼
  Mistral         Cerebras          Groq
  Gemini           OpenRouter      Ollama
  ...and 3 more

Claude Code Setup

Run Claude Code completely free — using your own LLM provider keys instead of the Anthropic API.

① Start model-router
bun run dev
# or use the installed binary:
model-router

Server starts on http://localhost:8787

② Set environment variables
export ANTHROPIC_BASE_URL=http://localhost:8787
export ANTHROPIC_API_KEY=dummy

Any non-empty string works as API key — it's never sent upstream.

③ Launch Claude Code
claude

Claude Code connects and starts — your requests go to the free provider.

💡 Tip — Add a permanent alias
echo 'alias claude-free="ANTHROPIC_BASE_URL=http://localhost:8787 ANTHROPIC_API_KEY=dummy claude"' >> ~/.zshrc
source ~/.zshrc

# Then just run:
claude-free
Why does it show "Opus 5"?

Claude Code's UI displays its own model labels regardless of the backend. Your requests are actually processed by whichever free provider is active (Mistral, Groq, etc.).

To verify, check the bun run dev terminal — it logs [router] streaming via mistral for every request.

How to verify the active provider?
curl http://localhost:8787/status

Shows request counts and token usage per provider in real time.

Or ask inside Claude Code: "What model are you?" — Mistral will answer with its identity.

Got 502 errors?

You hit the rate limit of your only active provider. Fix: add more provider keys to .env and set a fallback chain:

FALLBACK_ORDER=mistral,groq,gemini,cerebras
🧪 E2E Adapter Testing

Run direct live checks against configured provider APIs to verify keys, provider accessibility, and stream functionality with minimal token usage (maxTokens: 5):

bun run test:e2e

E2E tests do not run during CI or pre-commit checks. An adapter is tested only if its corresponding key exists in .env.

Other Clients

Works with any Anthropic or OpenAI-compatible tool.

🤖 Claude Code Full guide ↑
export ANTHROPIC_BASE_URL=http://localhost:8787
export ANTHROPIC_API_KEY=dummy
claude
👥 Agent Team
export ANTHROPIC_BASE_URL=http://localhost:8787
export ANTHROPIC_API_KEY=dummy
agent-team run --all
⚡ ZeroClaw
export OPENAI_BASE_URL=http://localhost:8787/v1
export OPENAI_API_KEY=dummy
zeroclaw --model model-router-auto
🛠 Aider
export OPENAI_API_BASE=http://localhost:8787/v1
export OPENAI_API_KEY=dummy
aider --model openai/model-router-auto
🧩 Cline / Roo / Continue
Provider: OpenAI Compatible
Base URL: http://localhost:8787/v1
API Key: dummy
Model: model-router-auto
export OPENAI_BASE_URL=http://localhost:8787/v1
export OPENAI_API_KEY=dummy
bun run start -- -y "Your task"