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-install3. 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-5Windows:
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-5The 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-solThe 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.comSee 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
- CC Switch one-click setup (Claude Code & Codex) — The easiest way: import TokenMilo into Claude Code and Codex with one click.
- Codex CLI setup — Use OpenAI Codex CLI and the Codex IDE extension with GPT-6 via a custom provider.
- Claude Code setup — Run Claude Code with a TokenMilo key on macOS, Linux and Windows.
- DeepSeek Harness (dsh) setup with Claude & GPT — Add TokenMilo as a custom provider in DeepSeek’s open-source agent harness.
- OpenCode setup — Add TokenMilo as a custom provider in the OpenCode terminal agent.
- OpenClaw setup — Run the OpenClaw personal agent on Claude and GPT via TokenMilo.
Need an API key?
Sign up at TokenMilo, top up, and create a key in the console in under a minute.