AI Coding Agents · Claude Code CLI · ANTHROPIC_BASE_URL & LiteLLM
Claude Code Free API Setup & ANTHROPIC_BASE_URL Generator (2026)
Anthropic has no permanent $0 API tier for claude CLI—but you can still run Claude Code for free using either OpenRouter's native Anthropic-compatible endpoint (zero local proxy) or a LiteLLM fallback router combining Google AI Studio, Groq, NVIDIA NIM, and Mistral Codestral.
1. Two Ways to Run Claude Code at $0 (Zero-Proxy vs. LiteLLM)
- Option A — Direct Zero-Proxy (OpenRouter
:free): OpenRouter natively accepts Anthropic Messages API calls athttps://openrouter.ai/api. SetANTHROPIC_AUTH_TOKENto your free OpenRouter key and explicitly setANTHROPIC_API_KEY=""(if you previously logged into Anthropic, run/logoutinsideclaudefirst). - Option B — Local LiteLLM Fallback Proxy (All Free Providers): Google AI Studio, Groq, NVIDIA NIM, Mistral, and SambaNova only expose OpenAI-compatible
/chat/completionsendpoints. Runninglitellm --config litellm_config.yaml --port 4000translates Anthropic calls locally and automatically fails over when one free tier hits 429. - Project-Scoped Config: Native Claude Code ignores standard
.envfiles—put variables in your shell (~/.zshrc) or inside.claude/settings.local.json(generated below).
| Select Free Provider for Claude Code | Default & Fast Model ID | Verified Limits & Privacy | Best Claude Code Role |
|---|---|---|---|
|
Direct + LiteLLM
|
google/gemma-4-31b-it:free
Fast tier:
baidu/ernie-5.5-flash-preview:free |
20 RPM · 50 RPD (<10 credits purchased) or 1,000 RPD (>=10 credits purchased)
No Card · Varies by upstream (:free logs prompts)
|
Zero-proxy native ANTHROPIC_BASE_URL support (set ANTHROPIC_API_KEY="") |
|
Via LiteLLM Proxy
|
gemini-3.8-flash
Fast tier:
gemini-3.5-flash-lite |
Free tier (No Card · per-project RPM/TPM/RPD shown in AI Studio)
No Card · Free tier may train models
|
Large 1M context window for multi-file Claude Code sessions via LiteLLM |
|
Via LiteLLM Proxy
|
openai/gpt-oss-120b
Fast tier:
openai/gpt-oss-20b |
30 RPM · 1,000 RPD · 8K TPM · 200K TPD (No Card)
No Card · No data training by default
|
High daily RPD (1,000/day) and ultra-fast responses via LiteLLM |
|
Via LiteLLM Proxy
|
meta/llama-3.3-70b-instruct
Fast tier:
deepseek-ai/deepseek-r1 |
1,000 Starter Credits · ~40 RPM cap (Phone SMS, No Card)
No Card · No training on API payloads
|
High 40 RPM burst capacity & zero-training starter credits via LiteLLM |
|
Via LiteLLM Proxy
|
codestral-latest
Fast tier:
mistral-small-latest |
1 RPS (~60 RPM) · Experiment Plan (Phone SMS, No Card)
No Card · Trains on Free Experiment tier
|
Dedicated code editing model (codestral-latest) via LiteLLM |
|
Via LiteLLM Proxy
|
gpt-oss-120b
Fast tier:
gemma-4-31B-it |
20 RPM · 20 RPD · 200K TPD (No Card)
No Card · Zero data retention
|
Zero-data-retention fallback slot in LiteLLM router |
2. Interactive Claude Code Config Generator
Shell Export Commands (.zshrc / terminal)
Project-Scoped .claude/settings.local.json
Generated litellm_config.yaml (With Automatic 429 Fallbacks)
3. Need Higher RPM or Zero-Data-Training for Commercial Repos?
Free tiers on OpenRouter :free and Google AI Studio may log prompts for model improvement and cap out at 20–50 RPD/RPM during heavy multi-file agent loops. For commercial codebases, swap in a pay-as-you-go or self-hosted endpoint in the same config:
- Novita AI Model APIs & Agent Sandbox ↗: Low-cost pay-as-you-go endpoints with Anthropic/OpenAI compatibility and no 50 RPD free ceiling.
- RunPod Serverless GPU ($5–$500 Bonus Credit on $10 Top-Up) ↗: Host private vLLM / Qwen / DeepSeek endpoints behind LiteLLM with 100% code privacy.
Disclosure: The Novita AI and RunPod links above are referral/affiliate links that help support FindAITier at no extra cost to you.