Aider

About

Aiderarrow-up-right is a command-line pair programming tool that connects to OpenAI-compatible APIs. It lets you chat with models to edit your codebase, auto-commit changes, and build software collaboratively from the terminal.

This guide explains how to connect AI/ML API to Aider using the OpenAI-compatible flow. You’ll get a clean setup with one endpoint, support for slashes in model names, and full compatibility with all chat-completion models.


Quick Setup

Field
Value

Base URL

https://api.aimlapi.com/v1

API Key

Your AI/ML API key (create at aimlapi.com/app/keysarrow-up-right)

Model

openai/anthropic/claude-3.7-sonnet (openai/<your_full_model_id>)

Command Example

aider --model openai/chatgpt-4o-latest

circle-check

Installation

βœ… Prerequisites


1️⃣ Install Aider

Install Aider via terminal

2️⃣ Configure AI/ML API credentials

Mac/Linux

Windows (PowerShell)


3️⃣ Run Aider with AI/ML API

Move into your project directory:

Then launch Aider with your preferred model:

Running Aider with AI/ML API model
Running Aider with AI/ML API model

4️⃣ Model Prefix Rule

Aider automatically routes requests to your OPENAI_API_BASE. To connect to AI/ML API, always prefix your model with openai/.

Pattern:

Examples:

  • openai/chatgpt-4o-latest

  • openai/deepseek/deepseek-chat

  • openai/anthropic/claude-3.7-sonnet

  • openai/google/gemini-1.5-pro


Example Aider Session

Aider will:

  1. Load your project map.

  2. Analyze the repo.

  3. Apply AI-suggested edits.

  4. Commit changes automatically.

Aider researching your repo
Aider researching your repo
Aider working on code changes
Aider working on code changes

Common Pitfalls


πŸ“š References

Last updated

Was this helpful?