Aider
Pair-program in the terminal with Aider using FreeModel models through the OpenAI-compatible path.
Overview
Aider edits files in your git repository from a chat in the terminal. It reaches models through LiteLLM, and the openai/ prefix on a model name tells it to use the OpenAI-compatible endpoint you set. The prefix is removed before the request is sent, so FreeModel receives the plain model id.
Prerequisites
- Aider installed (
aider --versionworks) and a git repository to work in. - A FreeModel key from Dashboard → API Keys.
- Free accounts: free models only, such as
gpt-6-luna. Claude Haiku 5.5 and GPT-6.2 Astra are on the free plan; the other Claude models and premium models need a paid plan.
Configuration
Environment variables
export OPENAI_API_BASE=https://freemodel.in/v1
export OPENAI_API_KEY=fm_your_key_here
aider --model openai/gpt-6-luna
On Windows PowerShell use $env:OPENAI_API_BASE = "https://freemodel.in/v1" and $env:OPENAI_API_KEY = "fm_your_key_here".
Config file
To avoid typing flags, put the same settings in .aider.conf.yml in your home directory or the repository root:
model: openai/gpt-6-luna
weak-model: openai/gpt-6-luna
openai-api-base: https://freemodel.in/v1
openai-api-key: fm_your_key_here
If the file lives in a repository, add it to .gitignore or leave the key out of it and keep OPENAI_API_KEY in your shell.
The weak model
Aider uses a second, "weak" model for commit messages and chat summaries. Set it explicitly with --weak-model (or weak-model: in the config file) to a FreeModel id with the openai/ prefix, so those requests also go to FreeModel and use a model your account can reach. In architect mode, the same applies to --editor-model.
Unknown-model warnings
Aider keeps its own table of known models. For a FreeModel id it may warn that the context window and costs are unknown and fall back to defaults. That warning does not stop requests. You can describe the model in Aider's model metadata file (see Aider's documentation on model settings), or hide the warning with --no-show-model-warnings. Aider's cost estimates do not reflect FreeModel billing; your dashboard shows real token use.
Test the connection
Send one message and exit, without touching git:
aider --model openai/gpt-6-luna --no-git --message "Reply with the word ok."
If that fails, take Aider out of the picture:
curl https://freemodel.in/v1/chat/completions \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "gpt-6-luna", "messages": [{"role": "user", "content": "Reply with the word ok."}]}'
Which model ids to use
| Account | Aider --model value |
|---|---|
| Free | openai/gpt-6-luna, or openai/ plus another free model id. Free models: GPT-6.2 Astra, GPT-6 Luna, Grok 4.6, Grok 4.7, Claude Haiku 5.5, GLM-5.3 Flash, Qwen 3.8 Omni Flash and DeepSeek V4.1 Flash 1017. |
| Paid | openai/claude-sonnet-5, openai/claude-opus-5-5, openai/gpt-6-astra, or any id on Models. |
Always use the openai/ prefix here, even for Claude models: the prefix picks Aider's connection type, not the model vendor. Without it, Aider may try to reach the vendor directly with your FreeModel key and fail.
Aider sends the files you add to the chat with every message. Add only the files you need, since input tokens count toward your plan (multiplied by the model's rate).
Common errors and fixes
| Status | What it means | Fix |
|---|---|---|
401 | Wrong or missing key at FreeModel. | Check OPENAI_API_KEY. An error that mentions OpenAI's own site means OPENAI_API_BASE was not set. |
403 upgrade_required | Free account, paid model — check the weak model too. | Use free ids for --model and --weak-model, or buy a plan. |
404 model_not_found | The id after openai/ is not a FreeModel id. | Copy it from Models. Unlisted names are not mapped to other models. |
402 | Tokens used up (tokens_exhausted). | Renew or upgrade. Refused requests are not charged. |
429 | Plan requests-per-minute limit. | Aider retries with back-off; a larger plan raises the limit. |
Related pages
- Using Coding Agents
- Chat Completions — the endpoint Aider calls
- Codex CLI — another terminal agent