# Aider Integration Guide

Aider is a command-line AI pair programming tool that works directly in your terminal to make changes to your Git repository. This guide explains how to connect it to models via the UModelverse platform.

## **System Requirements**

| Platform | Requirements |
| --- | --- |
| Windows | Windows 10 or Windows 11 |
| macOS | macOS 10.15 (Catalina) or later |
| Linux | Major distributions (Ubuntu, Debian, etc.) |

All platforms require: Python 3.8+, Git, and a network connection.

## **1. Install Aider**

The recommended approach is to use the official installer script:

```
python -m pip install aider-install && aider-install
```

Or install directly via pip:

```
python -m pip install aider-chat
```

After installation, verify it by running:

```
aider --version
```

## **2. Configure the UModelverse API**

### 2.1 Obtain an API Key

Visit the [UModelverse Console](https://console.ucloud.cn/modelverse/api) to get your API key. For available models, see the [supported models](https://api-us-ca.umodelverse.ai/v1/models) list on the UModelverse platform.

### 2.2 Set Environment Variables

Aider connects via an OpenAI-compatible interface. Set the following two environment variables (replace `YOUR_API_KEY` with your actual key).

macOS / Linux:

```
export OPENAI_API_BASE=https://api-us-ca.umodelverse.ai/v1
export OPENAI_API_KEY=YOUR_API_KEY
```

Windows (PowerShell):

```
$env:OPENAI_API_BASE="https://api-us-ca.umodelverse.ai/v1"
$env:OPENAI_API_KEY="YOUR_API_KEY"
```

## **3. Start Aider**

Navigate to your project directory and use `--model` to specify a model (OpenAI-compatible models require the `openai/` prefix):

```
cd your-project-folder
aider --model openai/qwen3.7-max
```

> The model name after `openai/` can be replaced with any model from the [supported models](https://api-us-ca.umodelverse.ai/v1/models) list on the UModelverse platform, for example `openai/claude-sonnet-4-6`.

You can also write the environment variables and default model into `~/.aider.conf.yml` to avoid repeating the setup each time:

```
openai-api-base: https://api-us-ca.umodelverse.ai/v1
openai-api-key: YOUR_API_KEY
model: openai/qwen3.7-max
```

## **Troubleshooting**

### Authentication failure or connection error?

Check each of the following:

1.  `OPENAI_API_KEY` comes from the UModelverse platform — copy it in full with no extra spaces.
    
2.  `OPENAI_API_BASE` is set to `https://api-us-ca.umodelverse.ai/v1`.
    
3.  The model specified with `--model` includes the `openai/` prefix and is one of the [supported models](https://api-us-ca.umodelverse.ai/v1/models) on the UModelverse platform.
    
4.  After changing environment variables, open a new terminal window before running `aider`.
