Skip to content

Aider

Set two environment variables and every call Aider makes, edits, summaries and commit messages alike, is governed: checked against your policies, charged to your team and recorded in Request logs. Aider can then use Claude or Gemini through the same OpenAI-format address.

What it is

Aider is a coding assistant that runs in your terminal and edits the files in your git repository. It reaches models through an OpenAI-compatible setting, which the gateway answers at /v1. It calls the gateway from your machine.

The two settings

Setting Environment variable Command-line option .aider.conf.yml key Value
Base address OPENAI_API_BASE --openai-api-base openai-api-base https://<your-gateway>/v1
Key OPENAI_API_KEY --openai-api-key openai-api-key Your Vidai key (starts vk_)

Here OPENAI_API_BASE is the right name: it's the variable Aider reads (the OpenAI SDK itself uses OPENAI_BASE_URL). If OPENAI_BASE_URL is also set in your shell, it wins over OPENAI_API_BASE: unset it or set both to the gateway. Aider sends the key as Authorization: Bearer. The gateway's address is under Connect your app on the Keys page and in System › Settings › Gateway; the key comes from Keys › Issue a key (its secret is shown once).

export OPENAI_API_BASE="https://<your-gateway>/v1"
export OPENAI_API_KEY="vk_…"
aider --model openai/gpt-4.1
# in the repository, or ~/.aider.conf.yml for every repository
openai-api-base: https://<your-gateway>/v1
model: openai/gpt-4.1
weak-model: openai/gpt-4o-mini
# keep the key out of the file: set OPENAI_API_KEY in your shell

A minimal call

aider --model openai/gpt-4o-mini --message "Reply with exactly: ok" --no-git

The openai/ prefix tells Aider to speak the OpenAI format; the part after it is the model name the gateway sees. --model openai/claude-sonnet-4.5 or openai/gemini-3.5-flash work the same way: the gateway translates the request for that provider and answers in the OpenAI shape.

Streaming

Aider streams by default; a stream from Claude or Gemini arrives as OpenAI chunks. Vidai records tokens and cost either way.

Tool calls

Aider asks for edits as text in its own edit formats rather than through tool calls, so nothing depends on tool translation; the edit format (--edit-format) makes no difference to the gateway.

Reading what the gateway did

Aider doesn't print response headers. Look the call up in Request logs: filter on Key, Model or Path (/v1/chat/completions). Edits, the weak model's summaries and commit messages show as separate calls, so you can see what each one costs.

Errors

Aider prints the gateway's error message. Common ones while setting up: 401 invalid_api_key (the key is wrong, or a provider's key), 403 model_not_allowed (your key may not call that model), 404 model_not_found (check the name after openai/), 429 (a limit on the key or team). The full list is in Headers and errors.

Model names

After the openai/ prefix, use the names your organisation approved under Models in the Control room. Aider uses up to three models:

Option Used for
--model The main chat and edits
--weak-model Commit messages and summarising chat history
--editor-model Editor tasks in architect mode

Set the weak model yourself (for example openai/gpt-4o-mini): for a model name it doesn't know, Aider can't pick a matching cheaper one. Aider also warns that it doesn't know the context window or price of a gateway name; the warning is harmless. To silence it, describe the model in .aider.model.metadata.json. Vidai prices every call itself, in Request logs; the cost Aider prints is its own estimate.

What goes through the gateway

Aider feature Through the gateway
Chat, edits, architect and editor models Yes
Commit messages and history summaries (weak model) Yes
Voice input (/voice) Yes, always as whisper-1 at /v1/audio/transcriptions: it works only if your organisation approved whisper-1, served by OpenAI or Azure OpenAI (audio is same-format only)

Check it works in a minute

Run the minimal call above. A reply of "ok" means the address and key are right; the call shows in Request logs within seconds.

Good to know

  • Aider retries on rate limits and connection errors itself, and a fallback chain may already have tried another model before you see an error. A 429 from the gateway has no Retry-After, so Aider backs off on its own schedule.
  • Issue one key per developer so Request logs and cost reports show whose Aider made each call.
  • Aider's docs: OpenAI-compatible APIs, options.