Aider with DeepSeek, Claude or any OpenAI-compatible model

Aider is a free, open-source pair programmer that edits the files in your git repo from the terminal and commits each change. It works with any OpenAI-compatible API. We pointed it at Zurelay, made real edits with DeepSeek V4.1 Flash and Claude Sonnet 5.5, and fixed the three things Aider gets wrong about models it doesn't know.

· Zurelay guides · Prices update live

Set it up

  1. Install Aider. Aider 0.86 supports Python 3.10 to 3.12, and its own installer, aider-install, sets up a matching Python for it. We used pip install aider-chat in a Python 3.12 virtual environment.
terminal
python -m pip install aider-install
aider-install
  1. Point it at the API with two environment variables, and prefix every model with openai/, Claude's too. The weak model writes commit messages and summaries, so a cheap one is enough.
terminal
export OPENAI_API_BASE="https://api.zurelay.com/v1"
export OPENAI_API_KEY="zr_live_..."
aider --model openai/claude-sonnet-5-5 --weak-model openai/deepseek-v4.1-flash
# or all on DeepSeek
aider --model openai/deepseek-v4.1-flash --weak-model openai/deepseek-v4.1-flash
  1. Tell Aider about the models. These two files in your home folder fix its warning, its edit format and its cost display (next section). The prices are Zurelay's current ones, per token.
~/.aider.model.metadata.json
{
"openai/deepseek-v4.1-flash": {
"max_input_tokens": 1000000,
"input_cost_per_token": 0.00000003,
"output_cost_per_token": 0.00000012,
"cache_read_input_token_cost": 0.00000000074,
"litellm_provider": "openai",
"mode": "chat"
},
"openai/claude-sonnet-5-5": {
"max_input_tokens": 1000000,
"input_cost_per_token": 0.00000079,
"output_cost_per_token": 0.00000395,
"cache_read_input_token_cost": 0.000000079,
"litellm_provider": "openai",
"mode": "chat"
}
}
~/.aider.model.settings.yml
- name: openai/deepseek-v4.1-flash
edit_format: diff
use_repo_map: true
- name: openai/claude-sonnet-5-5
edit_format: diff
use_repo_map: true
weak_model_name: openai/deepseek-v4.1-flash
  1. Keep the setup in ~/.aider.conf.yml, so a plain aider starts with it. It holds your key, so keep it out of git.
~/.aider.conf.yml
model: openai/claude-sonnet-5-5
weak-model: openai/deepseek-v4.1-flash
openai-api-base: https://api.zurelay.com/v1
openai-api-key: zr_live_...

What Aider gets wrong about new models

Aider looks a model up by its full name, and in version 0.86.2 it knew neither openai/claude-sonnet-5-5 nor openai/deepseek-v4.1-flash. Without the files above:

  • It warns at every start: Unknown context window size and costs, using sane defaults, then asks whether to open its docs. A max_input_tokens entry in the metadata file is enough to stop it.
  • It uses the whole-file edit format, so the model sends back every file it changes in full. That costs more output tokens on big files and is slower. edit_format: diff has it send only search-and-replace blocks; both models applied them cleanly in our test. If a model's edits keep failing to apply, go back to whole for that model.
  • It shows no cost. With the prices in the metadata file, Aider's cost line matched our bill: it said $0.0036 for a Claude edit Zurelay billed $0.00357 for.

Claude: openai/ or anthropic/?

Aider can also reach Claude through Anthropic's format: --model anthropic/claude-sonnet-5-5 with ANTHROPIC_API_BASE=https://api.zurelay.com (no /v1) and ANTHROPIC_API_KEY set to the same key. It worked, and Aider knew the model that way. But with --cache-prompts it paid to write the prompt cache on both of our runs and never read from it, at about $0.0035 an edit. Through openai/, the second edit read 2,863 of its 3,682 prompt tokens from the cache without any setting, and cost $0.0025. We'd use openai/ for every model.

What it cost in our test

Edits to a small Python file in a fresh git repo, each committed by Aider. Every edit is two requests, the change on the main model and a commit message from DeepSeek V4.1 Flash. Zurelay billed:

ModelTaskRequestsPrompt tokens (cached)Cost
DeepSeek V4.1 FlashCreate hello.py (whole-file format)21,202 (0)$0.000057
DeepSeek V4.1 FlashEdit hello.py (diff format)23,273 (149)$0.00013
Claude Sonnet 5.5Wrap the code in main()23,891 (151)$0.0036
Claude Sonnet 5.5Rename main()24,175 (3,007)$0.0025

Aider's own prompt is small, about 2,800 to 3,700 tokens with the repo map, so a day of edits on DeepSeek costs cents. The two edits through anthropic/ aren't in the table.

Things to know

  • Aider's cost line doesn't count cache hits on openai/ models: it said $0.0045 for the edit we were billed $0.0025 for. Your Zurelay usage page shows the real figure.
  • On Windows, Aider's chat needs a real console. In Git Bash it printed Can't initialize prompt toolkit: Found xterm-256color; use PowerShell, Command Prompt or Windows Terminal. One-shot --message runs work anywhere.
  • Aider reads .aider.conf.yml, .aider.model.settings.yml and .aider.model.metadata.json from your home folder, the root of your git repo and the current folder. We tested the home folder.

Prices for the models you'd pair with

Per 1M tokens, the lab's list price and Zurelay's:

ModelInputOutputOn Zurelay (in / out)
DeepSeek V4.1 Flash$0.30$1.20$0.03 / $0.12
Claude Sonnet 5.5$2.00$10.00$0.79 / $3.95
Claude Opus 5.5$4.00$20.00$1.40 / $7.00
GPT-6.1 Terra$1.00$5.00$0.25 / $1.25
Gemini 3.8 Flash$0.75$3.75$0.22 / $1.10
Kimi K3.1 Pro$2.00$10.00$0.80 / $4.00
GLM-5.3$1.40$4.40$0.38 / $1.21

Tested on November 3, 2026 with Aider 0.86.2 on Python 3.12, on Windows, against Zurelay's API. The short setup is in Aider in the docs. Aider's own documentation: OpenAI-compatible APIs and model settings.

Every model on one OpenAI-compatible key, below list price. Credit from $10, no subscription.Get your API key

FAQ

Questions people ask

Anything else? Ask our team and we’ll answer by email.

How do I use Aider with an OpenAI-compatible API?

Set OPENAI_API_BASE to the provider's base URL, including /v1, and OPENAI_API_KEY to its key, then start Aider with the model name prefixed by openai/, for example aider --model openai/deepseek-v4.1-flash.

Why does Aider say Unknown context window size and costs?

Aider doesn't have the model in its list. It still works with defaults. Add the model to ~/.aider.model.metadata.json with max_input_tokens, and its prices per token if you want Aider's cost line, and the warning stops.

Which edit format should I use in Aider?

diff for capable models such as Claude, GPT and DeepSeek: the model sends only the lines it changes. Aider picks whole, which resends entire files, for models it doesn't know. Set edit_format per model in ~/.aider.model.settings.yml.

Does prompt caching work in Aider?

Through an OpenAI-compatible API it depends on the provider. On Zurelay, Claude Sonnet 5.5 read 2,863 of 3,682 prompt tokens from the cache on the second edit with no setting. Aider's --cache-prompts flag only applies to models reached in Anthropic's format.

Can Aider use Claude without an Anthropic key?

Yes, through any API that serves Claude in OpenAI's format: set OPENAI_API_BASE and OPENAI_API_KEY to that provider and start Aider with --model openai/claude-sonnet-5-5.

Which Python version does Aider need?

Aider 0.86.2 supports Python 3.10 to 3.12. The aider-install installer sets up a matching Python on its own.

More guides

Stop paying list price.
Start saving today.

Create a key in seconds, point the SDK you already use at Zurelay, and every request costs up to 90% less from the first token.