こんにちは!Claude Code を無料で使い倒したいエンジニアの皆さんへ。
Claude Code is one of the most productive AI coding assistants available today — but heavy use can make API costs add up quickly. In this tutorial, I'll show you how I run Claude Code on $0/month using free LLM API tiers, keeping the same terminal workflow you already know.
Why $0/Month?
- Zero-risk experimenting: try prompts, agents, and hooks without watching your wallet
- Perfect for side projects: nights-and-weekends coding shouldn't cost money
- Learn the ecosystem: free tiers are ideal for learning how LLM APIs work
Step 1: Choose a Free LLM API Provider
Many providers offer generous free tiers. Solid options (limits change often, so check their docs):
- Google AI Studio — free Gemini API tier with generous limits
- Groq — free tier with extremely fast inference
- Cerebras — free tier with very high throughput
- Mistral AI — free tier on La Plateforme
-
OpenRouter — models tagged
:freecost nothing
Tip: I maintain a curated, regularly updated directory of free LLM APIs — providers, limits, and setup notes — at freellm.net. Start there instead of digging through docs.
Step 2: Get Your Free API Key
- Sign up at your chosen provider (most need only an email address)
- Create an API key in the dashboard
- Note the base URL if the provider uses an OpenAI-style endpoint
Step 3: Point Claude Code at the Free Endpoint
Claude Code reads standard environment variables. Set the base URL and key before launching:
export ANTHROPIC_BASE_URL="https://your-free-provider.example/v1"
export ANTHROPIC_API_KEY="sk-your-free-key"
claude
If your provider only speaks the OpenAI API format, run a tiny local proxy (e.g. LiteLLM) that translates between the two, and point ANTHROPIC_BASE_URL at the proxy:
# terminal 1: start the translator proxy on localhost:4000
litellm --port 4000
# terminal 2: use Claude Code through the proxy
export ANTHROPIC_BASE_URL="http://localhost:4000"
export ANTHROPIC_API_KEY="sk-anything"
claude
Step 4: Verify It's Working (and Free)
Inside Claude Code, ask it something simple:
> What model are you running on?
Then check the provider's dashboard — you should see requests counted against the free tier, with $0 billed.
Practical Tips for Staying Free
- Respect rate limits: free tiers usually cap requests per minute, so keep parallel agents modest
- Pick smaller models for small jobs: a fast free model for summaries, a stronger one for hard reasoning
- Rotate providers: if you hit a limit on one, switch the env vars to another free provider
- Cache aggressively: reuse context instead of re-sending huge files
Wrapping Up
You don't need a paid API plan to get real work done with Claude Code. With a free-tier key and two environment variables, the full agentic coding loop — plan, edit, run, iterate — works at $0/month.
For the latest list of free providers and their limits, bookmark freellm.net.
Happy (free) coding!
— MyToolster