Skip to main content

Aider Setup

Aider is an AI pair programming tool that runs in your terminal, allowing you to edit code in your local Git repository.

Prerequisites

  • Python 3.8+ installed
  • Your API key and endpoint URL from admin

Installation

python -m pip install aider-install
aider-install

Setup

1

Set Environment Variables

Add to your ~/.zshrc or ~/.bashrc:
export ANTHROPIC_API_KEY="your-api-key"
export ANTHROPIC_BASE_URL="YOUR_ENDPOINT_URL"
2

Reload Shell

source ~/.zshrc
3

Run Aider

aider --model sonnet

Alternative: Project Config

Create a .env file in your project root:
ANTHROPIC_API_KEY=your-api-key
ANTHROPIC_BASE_URL=YOUR_ENDPOINT_URL
AIDER_MODEL=sonnet
Then just run aider without flags.

Command Line Usage

# Use Sonnet (recommended for coding)
aider --model sonnet

# Use Opus for complex tasks
aider --model opus

# Specify API key inline (not recommended for security)
aider --model sonnet --api-key anthropic=your-key

Model Aliases

Aider uses short aliases for models:
AliasFull Model
sonnetclaude-sonnet-4-5-thinking
opusclaude-opus-4-5-thinking

Troubleshooting

  • Check environment variable is set: echo $ANTHROPIC_API_KEY
  • Restart your terminal after adding to shell config
  • Verify ANTHROPIC_BASE_URL is set correctly
  • Test: curl YOUR_ENDPOINT_URL/health
  • Use sonnet or opus aliases
  • Or full model name: claude-sonnet-4-5-thinking