Skip to main content
Aider is a practical terminal pair-programming tool that works especially well for small iterative code changes, diff review, explicit context-file control, and repeated fix cycles inside a git repo. For Crazyrouter, the safest path is Aider’s officially supported OpenAI-compatible setup.

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
If your main workflow is read code -> edit a few places -> inspect the diff -> refine once more, Aider is often one of the lightest and easiest tools to operationalize.

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_KEY
  • OPENAI_API_BASE
  • openai-api-key
  • openai-api-base
For Crazyrouter, use:
OPENAI_API_BASE=https://crazyrouter.com/v1
One important accuracy detail: in Aider’s official OpenAI-compatible docs, model names are typically written as openai/<model-name>. So Crazyrouter’s gpt-5.4 should usually be entered in Aider as:
openai/gpt-5.4
This is one of the most important corrections in this doc upgrade. In your Crazyrouter token allowlist, keep the raw model id such as gpt-5.4. But in Aider commands and ~/.aider.conf.yml, prefer the openai/... model form.

Prerequisites

ItemNotes
Crazyrouter accountCreate one at crazyrouter.com
Crazyrouter tokenCreate a dedicated token for Aider
GitPrefer git 2.23+
PythonIf 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
AiderUse a current stable version
Git repoAider generally works best inside a git repo
Allowed modelsAllow at least one coding-friendly model
Suggested starter allowlist:
  • gpt-5.4
  • claude-sonnet-4-6
  • gemini-3-pro-preview

Full Install Path By Operating System

The most reliable Windows setup is: Git + Python + PowerShell install flow for Aider + PowerShell environment variables. Recommended order:
  1. Install Git
  2. Install Python
  3. Install Aider from the official PowerShell installer, or use aider-install
  4. Set temporary env vars in PowerShell
  5. Persist user-level env vars in PowerShell
  6. Open a fresh terminal and verify both the command and variables
Recommended verification commands:
git --version
python --version
pip --version
aider --version
where.exe git
where.exe python
where.exe aider
If aider --version is not found, close and reopen PowerShell and try again. The smoothest macOS setup is usually: Xcode Command Line Tools + Homebrew + Git + Python + Aider official installer + ~/.zshrc for persistent env vars. Recommended order:
  1. Install Xcode Command Line Tools
  2. Install Homebrew if needed
  3. Install Git and Python
  4. Run Aider’s official installer, or install via aider-install or uv
  5. Persist env vars in ~/.zshrc
  6. Open a fresh terminal and verify the executable path
Recommended verification commands:
git --version
python3 --version
pip3 --version
aider --version
which git
which python3
which aider

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

winget install --id Git.Git -e --source winget
git --version
where.exe git
Recommended one-time identity setup:
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
git config --global init.defaultBranch main

2. Install Python and pip

winget install Python.Python.3.12
python --version
pip --version
where.exe python

3. Install Aider

Aider’s current official one-line installers are:
powershell -ExecutionPolicy ByPass -c "irm https://aider.chat/install.ps1 | iex"
aider --version
where.exe aider
If you prefer a more explicit step-by-step install, Aider’s official aider-install flow is also valid:
python -m pip install aider-install
aider-install
aider --version
If your team already standardizes on uv, Aider’s docs also allow:
python -m pip install uv
uv tool install --force --python python3.12 --with pip aider-chat@latest
aider --version
Avoid starting with a plain system-wide pip install aider-chat. Aider’s own installers, aider-install, or uv are usually safer and easier to debug.

Quick Start

1

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.
2

Set the environment variables

export OPENAI_API_KEY=sk-xxx
export OPENAI_API_BASE=https://crazyrouter.com/v1
echo $OPENAI_API_KEY
echo $OPENAI_API_BASE
3

Persist the environment variables

echo 'export OPENAI_API_KEY=sk-xxx' >> ~/.bashrc
echo 'export OPENAI_API_BASE=https://crazyrouter.com/v1' >> ~/.bashrc
source ~/.bashrc
echo $OPENAI_API_BASE
4

Optionally add a config file

Add this to ~/.aider.conf.yml:
model: openai/gpt-5.4
openai-api-base: https://crazyrouter.com/v1
If you prefer a safer secret-handling pattern, keep the key only in environment variables and store only model plus openai-api-base in the config file.
5

Prepare the repo before the first real run

If this folder is not a Git repo yet:
git init
git add .
git commit -m "chore: initial snapshot before Aider"
If it is already an existing repo, at least inspect the current state first:
git status
6

Launch Aider inside your repo

aider --model openai/gpt-5.4
7

Run the first validation

Start with a low-risk task such as: Check the README for typos and suggest the smallest safe edits. Confirm Aider can read files and respond sensibly before using it for real code changes.
Use caseRecommended Aider model stringRaw Crazyrouter modelWhy
default coding driveropenai/gpt-5.4gpt-5.4verified successfully in production on March 23, 2026, and best for the OpenAI-compatible Aider baseline
Claude-style alternativeopenai/claude-sonnet-4-6claude-sonnet-4-6good for long-context explanation and steady multi-turn collaboration
Gemini fallback pathopenai/gemini-3-pro-previewgemini-3-pro-previewuseful as a second compatibility-validation path
Recommended rollout: start with 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

SettingRecommendationNotes
dedicated tokenRequiredDo not share the Aider token with other IDE or CLI tools
model allowlistStrongly recommendedKeep the model set small to avoid accidental high-cost switching
IP restrictionSituationalConsider it on fixed servers; be careful on mobile dev machines
quota capStrongly recommendedLong sessions and repeated repair loops can add up quickly
environment splitRecommendedSeparate local development, remote hosts, and CI
leak responseRotate immediatelyIf .aider.conf.yml, shell history, or recordings expose the key, rotate it

Verification Checklist

  • git --version works
  • python --version or python3 --version works
  • aider --version works
  • OPENAI_API_KEY is set correctly
  • OPENAI_API_BASE is https://crazyrouter.com/v1
  • if ~/.aider.conf.yml is used, the model string is written as openai/...
  • 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

SymptomLikely causeFix
401 unauthorizedwrong, expired, or incomplete API keygenerate a new token and set it again
403 or model not allowedthe token does not allow the selected modelallow that model in Crazyrouter token settings
404wrong base URL or missing /v1use https://crazyrouter.com/v1
model not foundwrong model string or missing the openai/ prefix in Aiderswitch back to openai/gpt-5.4, openai/claude-sonnet-4-6, or another confirmed openai/... model string
Aider launches but performs poorlythe model is too weak or the context is too noisyreturn to gpt-5.4 and reduce the context files
config file and env vars behave inconsistentlythe two configuration sources conflictpick one primary source and restart Aider
cost rises too quicklylong sessions and too many context filesclear or restart the session and shrink the context

Performance And Cost Tips

  • validate on a small repo first
  • keep openai/gpt-5.4 as the main model and add openai/claude-sonnet-4-6 only 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?

Use https://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 with openai/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.