All guides

Open sourceOpenAI-compatibleAider

Aider

Open-source AI pair programming in your terminal.

Aider works with almost any model. Use OpenAI or Anthropic keys directly, or set an OpenAI-compatible base URL to route through a cheaper provider.

Official docs

Setup steps

  1. 1

    Install Aider

    Requires Python 3.8 or newer. Installs the aider command via pip.

    bash
    python -m pip install aider-chat
  2. 2

    Option A: use a provider key

    Set the key for your model's provider, then pick a model with --model.

    bash / zsh
    export OPENAI_API_KEY="your-api-key"
    aider --model gpt-4o
  3. 3

    Option B: use a custom endpoint

    Set OPENAI_API_BASE to your provider's URL and prefix the model name with openai/.

    bash / zsh
    export OPENAI_API_BASE="https://api.example.com/v1"
    export OPENAI_API_KEY="your-api-key"
    aider --model openai/your-model-name
  4. 4

    Make it permanent

    Save the endpoint, key and model in a .env file in your project so you don't retype them.

    .env
    OPENAI_API_BASE=https://api.example.com/v1
    OPENAI_API_KEY=your-api-key
    AIDER_MODEL=openai/your-model-name
Tip: For OpenAI-compatible endpoints, prefix the model with openai/ so Aider treats it as OpenAI-style, e.g. --model openai/your-model-name.
Pick a cheaper model or provider first, then plug its key and endpoint into the steps above. Compare prices · Browse providers