Step 1: Install FreeLLMAPI
FreeLLMAPI is an open-source gateway. It runs on your computer in Docker. It pools the free tiers of 45 providers behind one OpenAI-compatible key.
Install on macOS or Linux
curl -fsSL https://freellmapi.co/install.sh | bashOpen http://localhost:3001. Add at least two free provider keys on the Keys page. Copy your unified key from the same page.
Step 2: Connect Aider
The setup command writes ~/.aider.conf.yml. It makes a backup of the existing file first.
One command
npx freellmapi setup-aider --url http://localhost:3001 --api-key <unified-key> --dry-run
npx freellmapi setup-aider --url http://localhost:3001 --api-key <unified-key>
aiderThe file that the command writes looks like this:
~/.aider.conf.yml
openai-api-base: "http://localhost:3001/v1"
openai-api-key: "<unified-key>"
model: "openai/auto"The openai/ prefix is required. It tells Aider to send the model name to an OpenAI-compatible API. To use environment variables and no file, do this:
Environment variables only
export OPENAI_API_BASE=http://localhost:3001/v1
export OPENAI_API_KEY=<unified-key>
aider --model openai/autoAider looks for .aider.conf.yml in your home directory, then in the root of your git repository, then in the current directory. The file that loads last has priority. A project file can therefore change the model for one repository.
Step 3: Choose models
Aider sends your files and a repo map in each request. It does not need tool calling for its main edit loop, because it reads edits from the model's text. A large context window and good instruction following are more important. The table shows free models with at least 128K context today.
| Model | Free on | Context | Free limits (best offer) | Tools | Vision |
|---|---|---|---|---|---|
| GLM 5.3 | APINex, UnoRouter | 1M | 5 req/min 10M weighted tokens/day shared across APINex free routes; 4x token multiplier; 5 requests/minute/account | Yes | No |
| GLM 5.3 Flash | APINex, BlazeAPI, NVIDIA NIM +1 more | 1M | 40 req/min 40 RPM | Yes | Yes |
| Gemini 3.8 Flash | APINex, Google AI Studio | 1M | 5 req/min 10M weighted tokens/day shared across APINex free routes; 3x token multiplier; 5 requests/minute/account | Yes | Yes |
| Qwen3.8 Flash Next | AMD Radeon Cloud, BlazeAPI, ElectronHub | 262K | Recurring daily account allowance | Yes | No |
| Qwen3.8 Flash | ElectronHub | 1M | $0.25/week shared recurring credit | Yes | Yes |
| Deepseek V4.1 Flash | APINex | 1M | 5 req/min 10M weighted tokens/day shared across APINex free routes; 3x token multiplier; 5 requests/minute/account | No | No |
| Gemini 3.7 Flash | Google AI Studio | 1M | 10 req/min 20 req/day 250,000 tokens/min ~3M | Yes | Yes |
| GPT-5.6 Luna | ElectronHub | 1M | $0.25/week shared recurring credit | Yes | Yes |
| Dots3 Note Preview | Kilo Gateway, OpenRouter | 512K | 20 req/min 50 req/day 50 req/day account-wide (1,000 after a $10 purchase) | Yes | Yes |
| DeepSeek V4 Flash | AMD Radeon Cloud, BazaarLink, ElectronHub | 1M | 10 req/min 50 req/day Shared rate limit | Yes | No |
| DeepSeek V4 Flash 0731 | ElectronHub, Router9 | 1M | 10,000 credits/month (~$1), shared; account-anniversary reset | No | No |
| Qwen3.8 27B | BlazeAPI, ElectronHub, Gizmo +3 more | 262K | 30 req/min 250 req/day 70,000 tokens/min ~6M | Yes | Yes |
Showing 12 of 184 matching free models. See all models.
Live data from the FreeLLMAPI catalog (version 2026.11.19, checked 19 November 2026). Free limits change often. The catalog is checked every day.
Use openai/auto to let the router select a model. Use openai/auto:smart to prefer the models with the highest intelligence. To pin one model, use openai/ and a catalog id from GET /v1/models.
You can also set the models for one session on the command line. This example uses the strongest models for edits. It uses fast models for commit messages and chat history summaries:
Models for one session
aider --model openai/auto:smart --weak-model openai/auto:fastFor a planned profile, make a fallback chain on the FreeLLMAPI dashboard, for example a chain named coding. Then use --model openai/auto:coding. An unknown profile name returns a 400 error, so the request does not go to a different chain without notice.
Aider settings for free models
Aider knows the settings for well-known models. A gateway model such as auto is not known, so set these values yourself.
| Setting | What it does | Recommended value for free models |
|---|---|---|
edit-format | The format that the model uses to send edits: whole, diff, diff-fenced or udiff | diff for strong models. whole for weak models, because it is simpler but sends more tokens. |
weak-model | The model for commit messages and chat history summaries | openai/auto:fast, so small tasks do not use your strong model's quota |
map-tokens | The number of tokens for the repo map. 0 turns it off. | 1024 or less on small free tiers |
architect | One model plans the change and an editor model writes the edits | Optional. It doubles the number of requests. |
~/.aider.conf.yml with settings for free models
openai-api-base: "http://localhost:3001/v1"
openai-api-key: "<unified-key>"
model: "openai/auto"
weak-model: "openai/auto:fast"
edit-format: diff
map-tokens: 1024To give Aider the context window of a gateway model, add a .aider.model.metadata.json file. The key is the full model name. Aider looks for this file in the same places as the config file.
~/.aider.model.metadata.json
{
"openai/auto": {
"max_input_tokens": 128000,
"max_output_tokens": 8192,
"litellm_provider": "openai",
"mode": "chat"
}
}Rate limits and failover
Free tiers have limits per minute and per day. FreeLLMAPI counts each key's use. When a provider sends a 429 error, the router sends the request to the next model in your chain. Aider does not see the error and continues.
- Add keys from four or more providers. More providers give more requests per day.
- Add only the files that you want to change with
/add. Each file is in every request. - Use
/clearbetween tasks to send a shorter chat history. A short history also lowers the tokens per minute. - Use
/dropto remove files that you do not need any more.
Troubleshooting
| Problem | Cause | Fix |
|---|---|---|
| "Model openai/auto: Unknown context window size and costs, using sane defaults." | Aider does not know the gateway model | This warning is usually harmless. To remove it, add .aider.model.metadata.json. |
| The edit did not apply | The model did not follow the edit format | Use --edit-format whole, or a stronger model |
401 "Invalid API key" | Aider sends a different key, for example from another config file | Check the config files in the home directory, git root and current directory |
| Aider calls api.openai.com | The openai/ prefix is used, but the base URL is not set | Set openai-api-base or OPENAI_API_BASE |
| "All models rate-limited after N attempts" | All keys are at their limit | Add keys from more providers, or reduce map-tokens |
Frequently asked questions
Can I use Aider for free?
Yes. Aider is open source. Point it at FreeLLMAPI with openai-api-base and the openai/ model prefix. The gateway uses free provider tiers, so inference costs $0.
How do I use Aider with an OpenAI-compatible API?
Set OPENAI_API_BASE and OPENAI_API_KEY, then run aider --model openai/
Which edit format should I use with free models?
Use diff for strong models, because it sends fewer tokens. If edits fail to apply, use whole. It is simpler for weak models but sends the full file each time.
What does 'Unknown context window size and costs, using sane defaults' mean?
Aider does not know the model name, so it uses default values. The warning is usually harmless. Add .aider.model.metadata.json with the context window to remove it.
Which free model is best for Aider?
Use a model with a large context window and good instruction following. The table on this page shows the strongest free models with 128K or more context today.
Related guides
- Use OpenCode with a free LLM API
- Use Codex CLI with free models
- Best free coding model APIs
- Free OpenAI-compatible API base URLs
- Free LLM API with 1 million token context
Sources
- Aider docs: OpenAI-compatible APIs (checked 20 November 2026)
- Aider docs: YAML config file (checked 20 November 2026)
- Aider docs: options reference (checked 20 November 2026)
- Aider docs: edit formats (checked 20 November 2026)
- Aider docs: model warnings (checked 20 November 2026)
- Aider docs: advanced model settings (checked 20 November 2026)
- FreeLLMAPI CLI generators (checked 20 November 2026)