Skip to content

Integrations

Aider

Aider in the terminal with AI Tokens: two environment variables, the openai/ prefix on the model, and two small files that tell Aider the context window and the edit format.

Last updated: 2026-11-03

Settings

bash
export OPENAI_API_BASE=https://api.aitokens.ch/v1
export OPENAI_API_KEY="sk-at-…"

aider --model openai/mistral-medium-3.5-128b

The openai/ prefix tells Aider to use the OpenAI-compatible API at OPENAI_API_BASE. The model id after it is the one in the catalogue.

The context window and the edit format

Aider does not know AI Tokens's models, and without help it warns that it does not know their context window. Two files in the root of your repository (or in your home directory) fix that.

.aider.model.metadata.json:

json
{
  "openai/mistral-medium-3.5-128b": {
    "max_input_tokens": 262144,
    "max_output_tokens": 32768,
    "litellm_provider": "openai",
    "mode": "chat"
  }
}

.aider.model.settings.yml:

yaml
- name: openai/mistral-medium-3.5-128b
  edit_format: diff
  use_repo_map: true

For another model, add an entry to each file with its id and the context window from Which model.

With edit_format: diff the model sends the lines it changes; with whole it sends every file it edits in full.

Which model

mistral-medium-3.5-128b, with 262,144 tokens of context. Aider sends only the files you add to the chat.

The others are in Which model.

Limits

  • 32,768 output tokens per answer. With edit_format: diff that is rarely reached; with whole a large file can be cut.
  • Commit messages are written by the same model, one more request per commit, unless you name another with --weak-model.

Search the docs

Type to search…