Aider with a cheaper OpenAI-compatible API (UberLLM)
Set OPENAI_API_BASE=https://api.uberllm.dev/v1 and OPENAI_API_KEY to your UberLLM key, then run aider --model openai/<UberLLM model id>. Add a .aider.model.settings.yml so Aider edits with diffs and uses its repo map.
Steps
- Make a key on your keys page and add credit.
- Set two variables:
export OPENAI_API_BASE=https://api.uberllm.dev/v1
export OPENAI_API_KEY=ull_your_key
Windows: setx OPENAI_API_BASE https://api.uberllm.dev/v1 and setx OPENAI_API_KEY ull_your_key, then open a new terminal.
- Run Aider with
openai/in front of the UberLLM id:
aider --model openai/moonshotai/kimi-k3 --weak-model openai/deepseek/deepseek-v4.1-flash
openai/ tells Aider to use the OpenAI-compatible route. Only that first part is removed, so the id that reaches UberLLM is moonshotai/kimi-k3.
Make edits work well (important)
Aider picks edit settings by model name. For a model it does not know, it falls back to rewriting whole files and turns the repo map off: slower, more tokens, worse results. Tell it the right settings in .aider.model.settings.yml (in your home folder or the repo root):
- name: openai/moonshotai/kimi-k3
edit_format: diff
use_repo_map: true
name must be exactly what you pass to --model.
Silence the "unknown context window" warning
Aider warns that it does not know the model's size and price. Give it the numbers in .aider.model.metadata.json, using the model's page on uberllm.dev/models:
{
"openai/moonshotai/kimi-k3": {
"max_input_tokens": 200000,
"max_output_tokens": 32000,
"input_cost_per_token": 0.000001,
"output_cost_per_token": 0.000004,
"litellm_provider": "openai",
"mode": "chat"
}
}
The numbers are an example: copy the real context length, and divide the per-1M prices in the table below by 1,000,000. Aider then shows a cost close to what you pay. Or just turn the warning off with show-model-warnings: false.
Keep it in a config file
.aider.conf.yml in your home folder or repo:
openai-api-base: https://api.uberllm.dev/v1
openai-api-key: ull_your_key
model: openai/moonshotai/kimi-k3
weak-model: openai/deepseek/deepseek-v4.1-flash
Do not commit a file that contains your key.
Troubleshooting
- "Unknown context window size and costs": harmless; add the metadata file above.
- Aider rewrites whole files: the settings file is missing or its
namedoes not match--model. - 404 model not found: the
openai/prefix is missing, or the id after it is wrong. - Variables ignored on Windows:
setxonly applies to new terminals. - 402 insufficient credits: add credit on the credits page.