Docs
The detail behind FreeAITokens, for developers and the curious. If you just want it working, download the app and follow Setup.
Command line
With Node.js 20 or newer you don't need the app:
npx freeaitokens # start the local endpoint
npx freeaitokens add # add a free provider key (guided)
npx freeaitokens list # providers, key status, what is left today
npx freeaitokens remove <id> # delete a stored key
Or install it once: npm install -g freeaitokens. The endpoint listens on 127.0.0.1:4949 only and needs the local token from the startup banner. The app and the command share keys and settings.
Use it with your tools
| Tool | How |
|---|---|
| Claude Code | npx freeaitokens claude (any Claude Code arguments work after it) |
| Codex | npx freeaitokens codex |
| Gemini CLI | npx freeaitokens gemini |
| OpenCode | npx freeaitokens setup opencode, then the model freeaitokens/free |
| Kilo Code CLI, Qwen Code, Goose, Aider | npx freeaitokens kilo / qwen / goose / aider |
| Zed, JetBrains AI, VS Code | npx freeaitokens setup zed / jetbrains / vscode prints what to paste |
| Continue, Cline, Crush, Roo Code | npx freeaitokens setup cline (or the tool's name) prints the values |
| Anything OpenAI-compatible | Base URL http://127.0.0.1:4949/v1, model free, key from the startup banner |
| Anthropic, Gemini or Ollama clients | Base URL http://127.0.0.1:4949, the same key |
Launchers only affect that one session and write nothing to your tool's config. setup opencode adds a provider next to your existing ones and keeps a backup; --undo restores it.
What it does
- Picks a model per request. Only models that can handle it: enough context, tool calling when the tool needs it, images when there are images. It prefers better models that have been fast and reliable for you, and stays on the same model through a conversation unless another is clearly better.
- Fails over. On a rate limit, server error or timeout it tries the next model before your tool sees anything. If everything is busy and capacity returns within 30 seconds it waits; otherwise it tells you when.
- Tracks free limits per provider, model and key, by the minute and by the day, and corrects itself from the limits providers report.
- Speaks five formats: OpenAI chat completions, Anthropic Messages (Claude Code), OpenAI Responses (Codex), Gemini (Gemini CLI) and Ollama (
/api/chat). - Keeps an up-to-date provider list, signed and checked before use, so new free models arrive without an update.
Not only chat
The same endpoint takes the OpenAI routes for embeddings (/v1/embeddings), plain completions (/v1/completions), images (/v1/images/generations), text to speech (/v1/audio/speech), transcription (/v1/audio/transcriptions) and video (/v1/videos), each sent to a free provider that offers it, with the same failover and limits.
- Free today: embeddings (Gemini, OpenRouter, SEA-LION, Cloudflare, OVH), completions (Cerebras, OpenRouter, OVH), images (Cloudflare Flux, OpenRouter), text to speech (Groq, OpenRouter, Cloudflare), transcription (Groq, Cloudflare, OVH). No provider offers free video yet.
- Embeddings: vectors from different models can't be compared. Send the model name the response gave you (for example
gemini-embedding-001) and later requests stay on it.
Paid keys and options
Paid keys can sit below the free ones as a last resort: used only when no free model can serve the request, each paid request is printed, with a daily cap.
| Option | What it does |
|---|---|
--port <n> | Port for the local endpoint (default 4949) |
--free-only | Never use paid keys |
--paid-cap <n> | Most paid requests per day (default 200) |
All 27 providers
Together they publish up to about 7.5 billion free tokens a month. That figure adds up published free limits, counting 2,000 tokens a request where only a request limit is published; most of it comes from a few large allowances, and you get it only with a key for each provider. Providers that publish no limit count as zero.
| Provider | Key needed | Free limit | Good to know |
|---|---|---|---|
| Kilo Gateway | No | not published | No account needed. About 200 requests an hour per IP address. Free prompts and answers may be used for training. |
| Groq | Free key | up to 500,000 tokens a day per model | |
| Cerebras | Free key | up to 216,000,000 tokens a day per model | |
| OpenRouter | Free key | up to 50 requests a day per model | Free models allow about 50 requests a day on an account with no credit. |
| Google Gemini | Free key | up to 1,000 requests a day per model | Google's terms limit the API to professional or business use. Free-tier prompts may be used to improve Google's products. |
| SEA-LION | Free key | 10 requests a minute | Google sign-in, one trial key per user, and the terms allow AI Singapore to use content to improve its services. |
| Typhoon | Free key | 200 requests a minute | A free research showcase API: SCB 10X collects usage data to improve its models and API. |
| NVIDIA NIM | Free key | not published | Free access is a trial for prototyping and testing only; production use needs an NVIDIA AI Enterprise license, and rate limits vary by model and load. |
| Z.ai (GLM) | Free key | not published | Only the Flash models are free. Their rate limits are not published and show only in the Z.ai console. |
| Nabh Cloud | Free key | up to 500 requests a day per model | Reseller. Only GPT OSS 20B is free, at 5 requests a minute and 500 a day. |
| KiosAPI | Free key | not published | Reseller (Indonesia). A small daily free quota on its free-tier models; the amounts are not published. One account per person. |
| Kenari | Free key | up to 50 requests a day per model | Reseller (Indonesia), no company named. Free models are capped at 5 a minute and 50 a day; upstream providers' policies apply. |
| Plugsky | Free key | up to 50,000 tokens a day per model | Reseller. 100 free requests and 50K tokens a day. The free model does not say what runs underneath, and failover may switch models. |
| ZRO (MoonMath) | Free key | not published | Reseller. The $0 plan gives some DeepSeek V4.1 Flash use each day; the amount is not stated. |
| Requesty | Free key | up to 200 requests a day per model | Reseller. Free models at 200 a day and 20 a minute. Logs are kept 30 days and Requesty may train on free-plan content. |
| BazaarLink | Free key | 10 requests a minute | Reseller (Taiwan). 10 a minute and a small daily allowance. Failed, flagged and sampled requests are kept in full. |
| Logfare | Free key | up to 5,000 requests a day per model | Reseller. 5,000 free requests a day, but you must link Discord and stay in its server. Everything is logged and used for evals unless you opt out. |
| CheapLLM | Free key | not published | Small reseller on its own GPUs. Free during its beta; afterwards only about 5K tokens in and 1K out per hour. One request at a time. |
| OVHcloud AI Endpoints | No | 2 requests a minute | No account needed. About 2 requests a minute per IP address for each model. |
| LLM7.io | Free key | not published | Small operator with no published free-tier terms or limits; data handling is unclear. |
| AI Horde | Free key | not published | Volunteer workers run the models and can see your prompts; it is queued, slow, has no tool calls, and the model list changes often. |
| BlockRun | Free key | 30 requests a minute | |
| Electron Hub | Free key | up to 10 requests a day per model | Providers behind :free models may train on your prompts. A Neutrino is spent even when a request fails, and going over 5 rpm triggers a 3-minute cooldown. |
| Septor Labs | Free key | up to 250,000 tokens a day per model | Free requests go to third-party aggregators (some hosted in China) that may keep prompts; not for personal or sensitive data. |
| Api.Airforce | Free key | up to 1,000 requests a day per model | Small reseller with unclear upstream sources; logs IPs and usage, and the free plan allows only 1 request per minute. |
| Routeway | Free key | up to 200 requests a day per model | Operator is not named in its terms, and requests are scanned before routing to upstream providers. |
| Cloudflare Workers AI | Free key | not published | 10,000 free Neurons a day, shared by every Cloudflare model you use (chat, embeddings, images, speech, transcription); resets at 00:00 UTC. The key is your Account ID plus an API token. |
Not supported yet
- Cursor: it sends custom-endpoint traffic through its own servers, which can't reach a local address.
- The ChatGPT app: it can't use a custom endpoint.
- Image editing, audio translation, realtime voice.
- Codex's connected-app (MCP) tools and web search are not passed to free models: they add more context than free models accept.
Source code, issues and the full README: GitHub.