Claude · Setup

FreeLLMAPI: 7.4 billion free tokens a month for your Claude Code

Has your Claude Code limit cut you off mid-session? FreeLLMAPI plugs your terminal into the free tiers of 34 providers, switches on its own when a model runs out and hands the task over to the next one. The setup in three commands, the handoff note, and the limits to know.

QQuentin Megevand
October 29, 2026 · 7 min read

You're in the middle of a task, and Claude Code tells you you've hit your limit. You wait for the reset, or you upgrade to the next plan. There's a third option for everything that doesn't need the best model: plug your terminal into free models. FreeLLMAPI is an open source router that puts the free tiers of 34 providers behind a single address, and Claude Code connects to it with one command.

You keep your terminal, your files, your CLAUDE.md and your rules. What changes is the model answering: it's no longer Claude, but the best free model available at that moment. Here's the full setup, the setting that stops a model from starting over, and the limits to know before you use it.

Claude AI Lab

The Claude AI Lab is my Skool community where I share my Claude systems and the more advanced modules. Access is $67/month.

Join the Lab →
✅What you need
1
Docker, for the one-command install. Without Docker, there's a desktop app for Mac (.dmg) and Windows (.exe).
2
Claude Code installed, and Node.js to run the npx command that configures it.
3
An account with at least one free provider (Google, Groq, Mistral, Cerebras, OpenRouter…), to get an API key.
4
Fifteen minutes, mostly to create the accounts and copy the keys.
7.4B
free tokens a month, announced capacity
34
free providers behind one address
43,600+
GitHub stars, MIT license
1

What FreeLLMAPI does

🔗 github.com/tashfeenahmed/freellmapi
🔀A router, not a model
5
It runs on your machine. You give it your providers' free keys, and it gives you back one unified key and one address, compatible with the OpenAI and Anthropic formats.
6
It picks the model for every request. The highest-ranked one whose key is healthy and under all its limits. On a quota or server error, it pauses that key and moves to the next model in your chain.
7
It keeps a conversation on the same model for 30 minutes, so you're not switching partners on every message.
8
Your keys stay with you. They're encrypted (AES-256-GCM) in a local database and decrypted in memory for each request. Your tools only ever see the unified key.
Reading the numbers right
The 7.4 billion tokens are the combined capacity the project announces, adding up every provider's free tier. The 635 "endpoints" are provider and model pairs, not 635 different models, and some of them aren't built for coding.
2

Get the free keys

🔑 each provider's website
🗝️One key per provider
9
Create an account on the provider's official website and generate an API key. FreeLLMAPI doesn't invent any quota: it adds up the free tiers each provider gives you.
10
Start with three or four. Google, Groq, Mistral, Cerebras, OpenRouter, Cloudflare, NVIDIA and Cohere are on the list. The more providers you add, the less often you run out.
11
A local model counts too. The "custom" provider accepts any OpenAI-compatible address you host: Ollama, LM Studio, llama.cpp or vLLM.
You're responsible for every account
The router passes your traffic through, but each provider's terms of use apply as they are. Read them before you send it anything sensitive.
3

Install the router

💻 Terminal, macOS, Linux or WSL
📦One command
12
Run the command below. It creates the ~/freellmapi folder, generates an encryption key, pulls the Docker image and starts the router. Running it again later is safe: your configuration and key are kept, and the router updates.
13
Open http://localhost:3001, paste your keys on the Keys page, then order the Fallback Chain the way you want.
14
Copy your unified key, shown at the top of the Keys page. It's the only key Claude Code will need.
curl -fsSL https://freellmapi.co/install.sh | bash
Without Docker
The desktop app (.dmg for Mac, .exe for Windows) is on the repo's Releases page. There's no password to set up.
4

Connect Claude Code

🔌 npx freellmapi setup-claude
🧪Always a preview before writing
15
Export your unified key, or pass it with --api-key on each command.
16
Run the preview first with --dry-run. It shows what would be written to your Claude Code configuration, without touching anything.
17
Then the real command. It merges with your existing configuration and creates a timestamped backup first.
export FREELLMAPI_API_KEY=<your-unified-key>
npx freellmapi setup-claude --url http://localhost:3001 --dry-run
npx freellmapi setup-claude --url http://localhost:3001
🧭Two options worth knowing
18
A separate profile. --profile <name> creates a Claude Code profile dedicated to the router, separate from your usual Claude subscription.
19
Nothing on disk. npx freellmapi launch starts Claude Code connected to the router without writing your key to a configuration file.
The root address, not /v1
Claude Code expects http://localhost:3001, the root address, because it adds the Anthropic API path itself. Other OpenAI-compatible tools expect http://localhost:3001/v1.
5

Turn on the handoff note

📝 the router's .env file
🤝So a model doesn't start over
20
The problem. When the router switches models mid-conversation (quota reached, rate limit, key paused), the new model doesn't know it's picking up a task in progress.
21
The fix. The handoff note adds a short system message telling it that it's taking over, with a recent summary of the exchange, and asks it not to restart the task.
22
Turn it on. Add the line below to the router's .env file (~/freellmapi), then restart it.
FREELLMAPI_CONTEXT_HANDOFF=on_model_switch
✅
What it does
Only kicks in when the model changes within the same session. Keeps messages in memory for 3 hours, never on disk or in the logs.
⛔
What it doesn't do
Nothing on the very first request, or if the model stays the same. It can't recover the previous model's internal state.
6

The limits

⚠️ read before you use it
🧱Five things to know
23
It's no longer Claude answering. Claude Code becomes the client of another model. Your terminal and your project stay the same, the brain changes.
24
No frontier models. Variable latency, no service guarantee. Quality drops late in the day, when the best free models hit their daily caps, then comes back at midnight UTC.
25
The router doesn't create quota. It tracks each key's limits to stay under them, but it can't give you more than the provider grants that day.
26
New models arrive 30 days late on a free install. The Premium option ($19 a year, or $49 once) gets them the same day. The router itself stays free and MIT-licensed.
27
Built for experimenting, not production. The project says so itself: before you ship something real, switch to a paid API.
7

If it doesn't work

🛠️ four symptoms
🔌
Claude Code won't connect
Check the address: Claude Code expects http://localhost:3001, without /v1.
🌙
No model answers anymore
Today's free quotas are used up. Wait for midnight UTC, or add one more provider's key.
🔒
Forgot password (server install)
Click "Forgot password?". The one-time code is written to the server log and lasts 15 minutes.
🔁
The handoff note seems to do nothing
Normal if the line isn't in .env, if it's your first request, or if the model hasn't changed.

To read the password code or follow what the router is doing on a Docker install:

docker compose logs -f freellmapi

When to use it

Keep your Claude subscription for the work that matters: architecture, code that ships to production, decisions where the quality of the reasoning makes the difference. Plug FreeLLMAPI into a separate profile for everything else: prototyping an idea, testing a script, running repetitive tasks that don't need the best model. You won't get blocked by a limit mid-session anymore, and you'll always know which model is working for you.

Want to go further?

And day-to-day, I post one reel a day on Instagram: @quentin_iamarketing