Content updated: 2026-06-09Aider is a very practical terminal-based pair programming tool, suitable for making incremental code changes, reviewing diffs, adding context files, and fixing issues in rounds within a Git repository. When connecting to Crazyrouter, the most reliable way is to use the officially supported OpenAI-compatible configuration of Aider.
Overview
By using environment variables or~/.aider.conf.yml, Aider can send requests to Crazyrouter:
- Recommended protocol:
OpenAI-compatible API - Base URL:
https://api.crazyrouter.com/v1 - Authentication variable:
OPENAI_API_KEY - Recommended default model notation:
gpt-5.5
Who It’s For
- People who want to make incremental code changes and commits in the terminal
- Those who want clear control over context files, diffs, and commit rhythm
- Users who want to manage billing for Aider, Codex, and Claude Code separately
- Anyone who wants to connect Crazyrouter using the most direct OpenAI-compatible method first
Protocol Usage
Recommended protocol:OpenAI-compatible API
Aider officially supports the following configuration items:
OPENAI_API_KEYOPENAI_API_BASEopenai-api-keyopenai-api-base
gpt-5.5 and claude-opus-4-8. The same model ID should be filled in directly in Aider:
System Requirements and Prerequisites
Recommended initial whitelist:
gpt-5.5claude-opus-4-8gemini-3.1-pro
Complete Installation Paths by Operating System
Recommended Path for Windows
The most reliable path for Aider on Windows is:Git + Python + PowerShell installation of Aider + PowerShell: Set environment variables.
Recommended order:
- Install Git
- Install Python
- Use PowerShell to run Aider’s official installation script, or install
aider-installfirst - Set temporary environment variables with PowerShell
- Set persistent user-level environment variables with PowerShell
- Open a new terminal to confirm
aidercommand and variables are effective
aider --version cannot find the command, close and reopen PowerShell before trying again.
Recommended Path for macOS
The smoothest path for Aider on macOS is usually:Xcode Command Line Tools + Homebrew + Git + Python + Official Aider installation script + ~/.zshrc to persist environment variables.
Recommended order:
- Install Xcode Command Line Tools
- Install Homebrew (if you don’t already have it)
- Install Git and Python
- Run Aider’s official installation script, or install via
aider-install/uv - Write
~/.zshrc - Open a new terminal to verify
aidercommand and variable paths
Linux Instructions
Linux can generally follow the terminal path for macOS, except persistent environment variables are usually written to~/.bashrc. If this is your local development machine or first connection to a cloud server, prioritize using temporary variables in the current shell before deciding whether to write them persistently.
Complete Installation from Scratch
1
Step 1: Install Git
If the machine doesn’t have Git, install it first.It’s recommended to supplement:
- Windows PowerShell
- macOS
- Ubuntu / Debian
2
Step 2: Install Python and pip
The official Aider installer will use Python or automatically prepare its own Python runtime environment. For easier troubleshooting, confirm Python is available on your machine first.
- Windows PowerShell
- macOS
- Ubuntu / Debian
3
Step 3: Install Aider
The currently recommended one-click installation script from Aider is as follows.If you want to clearly see the installation process, you can follow the official Aider If your team already uses
- Windows PowerShell
- macOS / Linux
aider-install method:- Windows PowerShell
- macOS / Linux
uv uniformly, follow the official documentation for installation:4
Step 4: Create a dedicated Aider token in Crazyrouter
Create a token named
aider in the Crazyrouter backend, and initially only enable:gpt-5.5claude-opus-4-8gemini-3.1-pro
The whitelist here uses the original Crazyrouter model names; no need to write the
openai/ prefix.5
Step 5: Temporarily set environment variables in the current terminal
First configure temporarily, after successful testing then write persistent settings.
- macOS / Linux
- Windows PowerShell
6
Step 6: Write the environment variable to a persistent configuration
- Linux Bash
- macOS / Zsh
- Windows PowerShell
- Windows PowerShell
- macOS / Linux
7
Step 7: Optionally write to ~/.aider.conf.yml
If you don’t want to add parameters manually each time, you can write a configuration file.For greater security, you can keep only the key in an environment variable and only leave
- macOS / Linux
- Windows PowerShell
model and openai-api-base in the configuration file.8
Step 8: Prepare the Git repository and make the first snapshot
Aider provides the best experience in a Git repository. If the current directory is not a Git repository:If it’s an existing repository, check:
9
Step 9: Start Aider and complete the first verification
After entering the project directory, run:For first-time verification, follow this order:
Please only summarize the current repository structure, do not modify any filesPlease read the README and provide the minimal changes needed. Do not make direct changes yet.- Confirm diffs are displayed normally before making small changes
Recommended Model Configuration
It’s recommended to start with
gpt-5.5, then add claude-opus-4-8 or gemini-3.1-pro as needed by the scenario after successful testing.
Token Best Practices
Verification Checklist
-
git --versionis normal -
python --versionorpython3 --versionis normal -
aider --versionis normal -
OPENAI_API_KEYis set correctly -
OPENAI_API_BASEis set tohttps://api.crazyrouter.com/v1 -
~/.aider.conf.yml, if used, should use the Crazyrouter original model ID, for examplegpt-5.5 -
aider --model gpt-5.5can start normally - The first read-only or minor change task returns successfully
- Corresponding requests appear in the Crazyrouter backend logs
- Token quota and model whitelist meet expectations
Common Errors and Fixes
Performance and Cost Suggestions
- For first integrations, validate in a small repository first
- Use
gpt-5.5by default; addclaude-opus-4-8for cross-validation if needed - It is recommended to separate tokens for different project types for cost statistics
- Clean up context timely when sessions get long to avoid carrying irrelevant files repeatedly
- After each major change, review Aider generated diffs and Crazyrouter logs
FAQ
Which Base URL should I fill in for Aider?
Enterhttps://api.crazyrouter.com/v1.
Why shouldn’t the model name be written as openai/gpt-5.5?
Because Crazyrouter’s model names do not include the vendor prefix; the actual ID recognized on this site is the original model ID like gpt-5.5. openai/gpt-5.5 will be treated as a different model name, which does not exist on this site.
Should I use environment variables or a configuration file?
Either is fine. Using environment variables is faster to start; for long-term use, it is recommended to also add~/.aider.conf.yml.
Why do you recommend creating a Git snapshot first the first time?
Because Aider will modify files, generate diffs, and automatically commit or suggest commits. Making a snapshot in advance makes troubleshooting and rollbacks much easier.What is the first recommended model?
Start withgpt-5.5.
Does Aider have to be used in a Git repository?
It’s not absolutely required, but the experience is usually best in a Git repository, and reviewing modification results is much easier.If you want a very lightweight terminal tool, very suitable for daily incremental code improvements, Aider is still worth prioritizing in Crazyrouter’s application guide.