Aider
Aider
AI pair programming in the terminal, built around git. Its OpenAI-compatible client reaches Actualyze with two settings.
Aider talks to Actualyze over the OpenAI Chat Completions API, through its client for OpenAI-compatible endpoints. You give it the base URL and your Actualyze API key, and name the model with an openai/ prefix. Aider doesn't discover models from Actualyze: it never calls the / endpoint, so it doesn't see the model list or the context windows it carries. You choose the model ID yourself, and you can give Aider the model's limits in a small metadata file.
Before you start
- An Actualyze API key with the inference scope and read-write permission. Workspace Admins, Members and FinOps Managers who belong to a team can create one: in the Actualyze app, select API Keys under ADMIN in the sidebar (every role that can hold keys sees this page, not only admins), then select Create API Key. Keep the default Read & Write permission. The key's budget is the one your Aider usage draws down.
- The ID of a model your key can call: a catalog model ID or a Virtual Model slug. Choose a model shows how to list them.
Install
If Aider isn't installed yet, Aider's installer sets it up in its own Python environment:
python -m pip install aider-install
aider-installAider's installation guide covers the one-line installers for macOS, Linux and Windows, and installs with uv or pipx.
Connect to Actualyze
Add these lines to your shell profile, then open a new terminal:
export OPENAI_API_BASE="https://app.actualyze.ai/openai/v1"
export OPENAI_API_KEY="<your-actualyze-api-key>"Then start Aider in your project with a model your key can call:
cd /path/to/your/project
aider --model openai/<model-id>OPENAI_is the OpenAI-compatible endpoint. Keep the trailingAPI_ BASE /: Aider appendsopenai/ v1 /itself.chat/ completions OPENAI_carries your Actualyze API key.API_ KEY - On Windows, set both with
setx OPENAI_andAPI_ BASE … setx OPENAI_, then restart the shell.API_ KEY …
Other tools in the same shell read OPENAI_ too. If one of them should use a different key, put the settings in Aider's config file instead.
In a config file
Aider reads .aider.conf.yml from your home directory, the root of your git repo, and the current directory, in that order. Later files win.
model: openai/<model-id>
openai-api-base: https://app.actualyze.ai/openai/v1
openai-api-key: <your-actualyze-api-key>With model set here, aider alone starts on that model.
Warning
The file holds your API key in plain text. Keep a repo-level .aider.conf.yml out of version control, and prefer the one in your home directory on shared machines.
Choose a model
Put a catalog model ID or Virtual Model slug after openai/. The prefix tells Aider which client to use; the ID itself is what reaches Actualyze. Aider's / command and --list-models option search the model list Aider takes from LiteLLM, not Actualyze. To see the models your key can call, ask the endpoint:
curl https://app.actualyze.ai/openai/v1/models \
-H "Authorization: Bearer <your-actualyze-api-key>"Each entry carries context_ and max_ (null when the catalog has no value). Aider doesn't read these fields. The Model Catalog in the Actualyze app shows the same limits.
Register the context window
Aider takes model limits from LiteLLM's model list. That list covers OpenAI model IDs, so openai/ followed by an OpenAI model ID already has limits. For any other ID, Virtual Model slugs included, Aider warns at startup that it doesn't know the model's context window or costs. Requests still work, but Aider then sizes its own context small: it summarizes chat history once it passes 1,024 tokens and gives the repository map 1,024 tokens. With the context window registered, both scale up with it, and Aider warns you before sending a chat that won't fit. To give Aider the model's real limits, create .aider.model.metadata.json in your home directory, your repo root or the current directory, or pass a file with --model-metadata-file:
{
"openai/<model-id>": {
"max_tokens": 64000,
"max_input_tokens": 200000,
"max_output_tokens": 64000,
"litellm_provider": "openai",
"mode": "chat"
}
}- The key is the same
openai/you pass to<model-id> --model. Its prefix must matchlitellm_.provider - The numbers above are placeholders. Copy
max_from the model'sinput_ tokens context_, andwindow max_andoutput_ tokens max_from itstokens max_.output_ tokens - Leave out the cost fields. Actualyze meters each request against the key's budget either way.
Model settings
Aider picks edit settings by model name. An ID that contains a model family Aider knows gets that family's settings. Any other ID, such as a Virtual Model slug, gets the whole edit format, where the model rewrites the entire file for every change, and no repository map. For a capable coding model, override both in .aider.model.settings.yml, which Aider looks for in the same three places:
- name: openai/<model-id>
edit_format: diff
use_repo_map: trueTroubleshooting
- A warning about unknown context window size and costs: Aider has no metadata for the model. Register it as shown above.
402: a spend limit stopped the request before any model ran, so nothing was charged. The message says which limit: usually the key's budget, or the key's own monthly limit.401: the key was rejected. It may be mistyped, revoked or expired, lack the inference scope, or belong to someone who is no longer on the key's team.403: the request was refused. If the message says read-write permission is required, the key is read-only; create a read-write key. Otherwise your team can't use the model you asked for; check its access in the Model Catalog or pick another.402sayingBudget required: the key's budget was deleted, archived or retired, or you no longer have access to it. Create a new key bound to a budget you can use.- Every request fails right after setup: check the base URL. It must end in
/.openai/ v1 401or failed requests even though your shell profile is right: Aider loads.envfiles from your home directory, the repo root and the current directory, and anOPENAI_orAPI_ KEY OPENAI_in one of them replaces your shell's value. Remove it there, or setAPI_ BASE openai-api-keyandopenai-api-basein.aider.conf.yml, which Aider applies after.envfiles.- Model not found: the ID after
openai/doesn't match a catalog model or Virtual Model your workspace serves.
Reference
| Setting | Value |
|---|---|
OPENAI_ or openai-api-base | https:// |
OPENAI_ or openai-api-key | Your Actualyze API key |
--model or model | openai/ followed by a catalog model ID or Virtual Model slug |
.aider.model.metadata.json | The model's context window and output limit |
Requests you cancel mid-stream still draw down the usage they consumed.
For Aider's own settings, see its documentation on OpenAI-compatible APIs, the YAML config file and advanced model settings.