Aider setup

Aider is the classic terminal AI pair programmer. Set two environment variables and it runs on TokenMilo’s Claude or GPT.

Updated 2026-11-16

1. Get an API key

Sign up in the TokenMilo console, top up and create a key under API Keys.

2. Install Aider

python -m pip install aider-install
aider-install

3. Use Claude (recommended)

export ANTHROPIC_API_BASE=https://api.tokenmilo.com
export ANTHROPIC_API_KEY=sk-your-tokenmilo-key
aider --model anthropic/claude-sonnet-5-5

Windows:

setx ANTHROPIC_API_BASE "https://api.tokenmilo.com"
setx ANTHROPIC_API_KEY "sk-your-tokenmilo-key"
# reopen the terminal, then:
aider --model anthropic/claude-sonnet-5-5

The base URL has no /v1.

4. Use GPT

export OPENAI_API_BASE=https://api.tokenmilo.com/v1
export OPENAI_API_KEY=sk-your-tokenmilo-key
aider --model openai/gpt-6.1-sol

The base URL includes /v1.

5. Save it permanently

Create .aider.conf.yml in your home directory or project root, then just run aider:

# ~/.aider.conf.yml
model: anthropic/claude-sonnet-5-5
anthropic-api-key: sk-your-tokenmilo-key
set-env:
  - ANTHROPIC_API_BASE=https://api.tokenmilo.com

See the model list for other model IDs, and Usage Logs in the console for costs.

FAQ

What does “Unknown context window size and costs” mean?

Aider shows it for model names it doesn’t know yet. It is safe to ignore; hide it with --no-show-model-warnings.

Why the anthropic/ and openai/ prefixes?

The prefix tells Aider which API to use. anthropic/ uses the native Anthropic API with prompt caching; openai/ uses the OpenAI-compatible API.

Should ANTHROPIC_API_BASE include /v1?

No. Aider appends /v1/messages itself, so https://api.tokenmilo.com is enough (https://api.tokenmilo.com/v1 also works). The OpenAI base includes /v1.

Related guides

Need an API key?

Sign up at TokenMilo, top up, and create a key in the console in under a minute.

Get API key See all models