DevPik Logo
open sourceaillmapifree

FreeLLMAPI: 7.4 Billion Free AI Tokens a Month From 34 Providers Behind One Endpoint

FreeLLMAPI stacks the free tiers of 34 AI providers behind one OpenAI-compatible endpoint, adding up to about 7.4 billion free tokens a month with smart routing and automatic failover. It has 50,376 stars.

ByMuhammad Tayyab8 min read
All open source picks
tashfeenahmed/freellmapi
The official repository — this write-up is not affiliated with the project.
50.4kTypeScriptMIT

What FreeLLMAPI Is: 7.4 Billion Free Tokens Behind One Endpoint

FreeLLMAPI is a self-hosted router that stacks the free tiers of 34 AI providers behind a single OpenAI-compatible /v1 endpoint. Every serious AI lab offers a free tier, a few million tokens a month or a few thousand requests a day, and on its own each one is a toy. Stacked together they add up to roughly 7.4 billion tokens a month across 474 model families and 635 free endpoints, from small and fast models to reasonably capable ones. Point any OpenAI client library at your local server and it routes across whichever providers you added keys for. The project is written in TypeScript, released under the MIT license, and it has 50,376 stars.

How the Router Works: Smart Routing, Failover and Per-Key Quotas

The router picks the best available model for each request and falls over to the next provider when one is rate-limited. It scores every model on live speed, capability and reliability, then retries the next model in your chain on a 429 or 5xx error, with cooldowns and key rotation. Per-key rate tracking keeps RPM, RPD, TPM and TPD counters for each platform, model and key, so routing stays under every free-tier cap. If a provider feels slow from your side, a Speed Test tells you whether your own connection is the bottleneck before you blame the router. The same model on several providers collapses into one entry with strict in-group failover, and named fallback-chain profiles let you keep a coding chain and a vision chain and switch between them per request.

What You Can Run on It: Chat, Code, Images, Video and Voice

FreeLLMAPI covers every OpenAI-style surface: chat completions, responses, completions for editor ghost-text autocomplete, image generation, video generation, audio speech and transcriptions, embeddings and models, streaming and non-streaming. There is also an Anthropic Messages API surface, so Claude Code and the official Anthropic SDKs run against your free pool, plus a native Gemini surface for Gemini CLI and opt-in Ollama emulation for Zed, JetBrains and other local-model clients. A Fusion mode fans one prompt out to a panel of diverse free models in parallel and has a judge model synthesize one answer from the drafts. Tool calling and structured outputs round-trip across providers, so coding agents get real tool calls rather than plain text.

Using It With Claude Code, Codex, Cursor and Other Coding Agents

Most agents configure themselves with one command that reads your live catalog, backs up the existing config and merges into it. For Claude Code it is npx freellmapi setup-claude with your server URL and unified key, and there are matching commands for Codex CLI, Gemini CLI, Cursor, Cline, Roo Code, OpenCode, Aider and more, plus Continue, Goose, Qwen Code, Kilo Code, Crush, Zed, JetBrains AI and any OpenAI-compatible, Anthropic, Gemini or Ollama client. Conversations stay on one model for 30 minutes, and an optional compact handoff note keeps the thread coherent when a mid-chat switch happens. The opt-in prompt compression pipeline can deduplicate prompts, filter tool output and trim stale context before routing, and running your prompt text through an AI Text Cleaner first is another easy way to cut wasted tokens before a request ever leaves your machine.

Getting Started: Docker, the Desktop App and One Unified Key

The fastest start is the one-liner that sets up ~/freellmapi, generates an encryption key, pulls the Docker image and starts the container, then you open http://localhost:3001, add provider keys on the Keys page, reorder the fallback chain and grab your unified key from the header. That unified key is what you point your OpenAI SDK at, with base URL http://localhost:3001/v1 and model "auto" to let the router pick. There is also a native menu-bar desktop app for macOS and Windows, with the whole router and dashboard running locally from the tray, plus Android via Termux and a Raspberry Pi friendly footprint of about 40 MB RAM at idle. Provider keys are AES-256-GCM encrypted in SQLite and decrypted in memory per request, and your apps only ever see the single unified bearer token. The dashboard ships in 60 languages and shows p50/p95/TTFT analytics over 24 hour to 90 day windows.

The Honest Limits: Free Tiers, Latency and the $19 Live Catalog

FreeLLMAPI describes itself as built for personal experimentation, and the limits are real: no frontier models, variable latency, no SLA, and the effective intelligence of the endpoint dips late in the day as top models hit their daily caps, then resets at UTC midnight. Each provider's free tier has its own rules and limits, so the 7.4 billion figure is the sum of the listed free-tier capacity, not a guaranteed allowance for any one user. The router keeps its model catalog fresh on its own, pulling a signed catalog twice a day, but free installs track the monthly snapshot, so a model reaches them 30 days after it joins the live feed. The live catalog is a $19 per year premium add-on (or $49 once, lifetime), and it is the only paid part: the router itself stays MIT licensed and fully free, forever.

Frequently Asked Questions

What is FreeLLMAPI?

FreeLLMAPI is a self-hosted router that stacks the free tiers of 34 AI providers behind one OpenAI-compatible /v1 endpoint, adding up to about 7.4 billion free tokens a month across 474 model families and 635 free endpoints. It routes each request to the best available model, fails over automatically when a provider is rate-limited, and stores provider keys encrypted. It has 50,376 stars.

Is FreeLLMAPI really free?

Yes, the router is MIT licensed and fully free, forever. You bring your own free-tier keys from providers like Google, Groq, Cerebras, Mistral, OpenRouter and others, and the router aggregates them. The only paid part is the $19 per year live model catalog, which gets new models the same day instead of 30 days later on the free monthly snapshot.

How does the 7.4 billion tokens figure work?

It is the sum of the listed free-tier capacity across 34 providers, 474 model families and 635 free endpoints. Each provider's free tier has its own rules and request and token limits, so it is a total pool you draw from, not a single allowance, and the strongest models can hit their daily caps late in the day before resetting at UTC midnight.

Which coding agents work with FreeLLMAPI?

Claude Code, Codex CLI, Gemini CLI, Cursor, Cline, Roo Code, OpenCode, Aider, Continue, Goose, Qwen Code, Kilo Code, Crush, Zed, JetBrains AI and any OpenAI-compatible, Anthropic, Gemini or Ollama client. Most configure themselves with one setup command, and the router also exposes an MCP server and a ChatGPT-ready private tunnel.

What are the limits?

No frontier models, variable latency and no SLA. The effective intelligence dips late in the day as top models hit daily caps, then resets at UTC midnight. Free installs get new models 30 days after they join the live catalog, and the project describes itself as built for personal experimentation rather than production workloads.

What does the $19 per year premium add?

Premium keeps the signed model catalog live on every router you run, so new models, quota changes and provider fixes land the same day instead of 30 days later on the free monthly snapshot. One key covers every router you run. The router itself stays free, and premium is what funds the daily model testing and catalog maintenance.

Related DevPik tools

Muhammad Tayyab

Written by

Muhammad Tayyab

Founder of DevPik

Muhammad Tayyab founded DevPik and builds its free developer tools. He writes about developer tools, AI and web technology.

More open source picks