Overview
With environment variables or~/.aider.conf.yml, Aider can send requests to Crazyrouter:
- recommended protocol:
OpenAI-compatible API - base URL:
https://crazyrouter.com/v1 - auth variable:
OPENAI_API_KEY - recommended default model string:
openai/gpt-5.4
Best For
- users who want small-step code edits from the terminal
- workflows that need explicit control over context files, diffs, and commit cadence
- teams that want Aider billed separately from Codex or Claude Code
- users who want the simplest OpenAI-compatible Crazyrouter setup path
Protocol Used
Recommended protocol:OpenAI-compatible API
Aider officially supports these settings:
OPENAI_API_KEYOPENAI_API_BASEopenai-api-keyopenai-api-base
openai/<model-name>. So Crazyrouter’s gpt-5.4 should usually be entered in Aider as:
Prerequisites
| Item | Notes |
|---|---|
| Crazyrouter account | Create one at crazyrouter.com |
| Crazyrouter token | Create a dedicated token for Aider |
| Git | Prefer git 2.23+ |
| Python | If you use the aider-install path, make sure you have Python 3.8-3.13; if you use the official one-line installer, it can provision Python 3.12 as needed |
| Aider | Use a current stable version |
| Git repo | Aider generally works best inside a git repo |
| Allowed models | Allow at least one coding-friendly model |
gpt-5.4claude-sonnet-4-6gemini-3-pro-preview
Full Install Path By Operating System
Recommended Windows Path
The most reliable Windows setup is:Git + Python + PowerShell install flow for Aider + PowerShell environment variables.
Recommended order:
- Install Git
- Install Python
- Install Aider from the official PowerShell installer, or use
aider-install - Set temporary env vars in PowerShell
- Persist user-level env vars in PowerShell
- Open a fresh terminal and verify both the command and variables
aider --version is not found, close and reopen PowerShell and try again.
Recommended macOS Path
The smoothest macOS setup is usually:Xcode Command Line Tools + Homebrew + Git + Python + Aider official installer + ~/.zshrc for persistent env vars.
Recommended order:
- Install Xcode Command Line Tools
- Install Homebrew if needed
- Install Git and Python
- Run Aider’s official installer, or install via
aider-installoruv - Persist env vars in
~/.zshrc - Open a fresh terminal and verify the executable path
Linux Note
Linux can generally follow the same terminal flow as macOS, except persistent variables usually belong in~/.bashrc. For a first pass, it is safer to validate with temporary env vars before making the setup permanent.
Detailed Install Walkthrough
Before connecting Aider to Crazyrouter, make sure the local toolchain is ready.1. Install Git
- Windows PowerShell
- macOS
- Ubuntu / Debian
2. Install Python and pip
- Windows PowerShell
- macOS
- Ubuntu / Debian
3. Install Aider
Aider’s current official one-line installers are:- Windows PowerShell
- macOS / Linux
aider-install flow is also valid:
- Windows PowerShell
- macOS / Linux
uv, Aider’s docs also allow:
Quick Start
Create an Aider-specific token
In Crazyrouter, create a token named something like
aider. Start by allowing only models such as gpt-5.4, claude-sonnet-4-6, and gemini-3-pro-preview.The allowlist here uses Crazyrouter’s raw model ids. Do not add the
openai/ prefix in the Crazyrouter token allowlist itself.Optionally add a config file
Add this to If you prefer a safer secret-handling pattern, keep the key only in environment variables and store only
~/.aider.conf.yml:model plus openai-api-base in the config file.Prepare the repo before the first real run
If this folder is not a Git repo yet:If it is already an existing repo, at least inspect the current state first:
Recommended Model Setup
| Use case | Recommended Aider model string | Raw Crazyrouter model | Why |
|---|---|---|---|
| default coding driver | openai/gpt-5.4 | gpt-5.4 | verified successfully in production on March 23, 2026, and best for the OpenAI-compatible Aider baseline |
| Claude-style alternative | openai/claude-sonnet-4-6 | claude-sonnet-4-6 | good for long-context explanation and steady multi-turn collaboration |
| Gemini fallback path | openai/gemini-3-pro-preview | gemini-3-pro-preview | useful as a second compatibility-validation path |
openai/gpt-5.4. Then add openai/claude-sonnet-4-6 or openai/gemini-3-pro-preview only after the baseline path is stable.
Token Setup Best Practices
| Setting | Recommendation | Notes |
|---|---|---|
| dedicated token | Required | Do not share the Aider token with other IDE or CLI tools |
| model allowlist | Strongly recommended | Keep the model set small to avoid accidental high-cost switching |
| IP restriction | Situational | Consider it on fixed servers; be careful on mobile dev machines |
| quota cap | Strongly recommended | Long sessions and repeated repair loops can add up quickly |
| environment split | Recommended | Separate local development, remote hosts, and CI |
| leak response | Rotate immediately | If .aider.conf.yml, shell history, or recordings expose the key, rotate it |
Verification Checklist
-
git --versionworks -
python --versionorpython3 --versionworks -
aider --versionworks -
OPENAI_API_KEYis set correctly -
OPENAI_API_BASEishttps://crazyrouter.com/v1 - if
~/.aider.conf.ymlis used, the model string is written asopenai/... -
aider --model openai/...launches correctly - the first read-only or small-change task succeeds
- Crazyrouter logs show the matching request
- token quota and model allowlist match your intended setup
Common Errors And Fixes
| Symptom | Likely cause | Fix |
|---|---|---|
401 unauthorized | wrong, expired, or incomplete API key | generate a new token and set it again |
403 or model not allowed | the token does not allow the selected model | allow that model in Crazyrouter token settings |
404 | wrong base URL or missing /v1 | use https://crazyrouter.com/v1 |
model not found | wrong model string or missing the openai/ prefix in Aider | switch back to openai/gpt-5.4, openai/claude-sonnet-4-6, or another confirmed openai/... model string |
| Aider launches but performs poorly | the model is too weak or the context is too noisy | return to gpt-5.4 and reduce the context files |
| config file and env vars behave inconsistently | the two configuration sources conflict | pick one primary source and restart Aider |
| cost rises too quickly | long sessions and too many context files | clear or restart the session and shrink the context |
Performance And Cost Tips
- validate on a small repo first
- keep
openai/gpt-5.4as the main model and addopenai/claude-sonnet-4-6only when you need cross-vendor validation - split tokens by project type so cost tracking stays clear
- clear context when the session becomes too long or drifts away from the task
- after larger edits, review both the Aider diff and Crazyrouter logs
FAQ
What base URL should I use for Aider?
Usehttps://crazyrouter.com/v1.
Why should the model name usually be openai/gpt-5.4 instead of just gpt-5.4?
Because Aider’s official OpenAI-compatible guidance uses the openai/<model-name> pattern. In Crazyrouter token settings, keep the raw model id. In Aider commands and config, prefer the openai/... form.
Should I prefer env vars or a config file?
Both work. Environment variables are faster for a first setup;~/.aider.conf.yml is useful once the setup becomes permanent.
Which model should I try first?
Start withopenai/gpt-5.4.
Does Aider have to run inside a git repo?
Not strictly, but the experience is usually best inside a git repo because change review is easier and safer.Why should I avoid allowing too many models at first?
Because multi-turn sessions make troubleshooting, budget control, and stability harder when the model surface area is too broad.If you want a very lightweight terminal tool for day-to-day small-step coding, Aider still deserves a strong place in the Crazyrouter application guides.