> ## Documentation Index
> Fetch the complete documentation index at: https://docs.venice.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Aider

> Configure Aider to pair-program in your terminal with Venice models through Aider's OpenAI-compatible API settings.

[Aider](https://aider.chat/) is an AI pair-programming tool that edits your local git repo from the terminal. Venice works through Aider's [OpenAI-compatible API](https://aider.chat/docs/llms/openai-compat.html) support — set the Venice base URL and API key, then prefix the model ID with `openai/`.

<CardGroup cols={3}>
  <Card title="Terminal Pair Programming" icon="terminal">
    Edit your git repo with Venice models from the CLI
  </Card>

  <Card title="OpenAI Compatible" icon="plug">
    Uses Venice's `/chat/completions` endpoint
  </Card>

  <Card title="Any Text Model" icon="microchip">
    Swap in any Venice text model ID
  </Card>
</CardGroup>

***

## Prerequisites

* A Venice API key from [venice.ai/settings/api](https://venice.ai/settings/api)
* Python 3.9+ available on your machine
* A git repository to work in

***

## Setup

<Steps>
  <Step title="Install Aider">
    Install Aider with the official installer:

    ```bash theme={"system"}
    python -m pip install aider-install
    aider-install
    ```

    See the [Aider install docs](https://aider.chat/docs/install.html) if you prefer another install method.
  </Step>

  <Step title="Configure Venice as the OpenAI endpoint">
    Point Aider at Venice by setting the OpenAI-compatible base URL and your Venice API key.

    **Mac / Linux:**

    ```bash theme={"system"}
    export OPENAI_API_BASE=https://api.venice.ai/api/v1
    export OPENAI_API_KEY=your-venice-api-key
    ```

    **Windows (PowerShell):**

    ```powershell theme={"system"}
    $env:OPENAI_API_BASE = "https://api.venice.ai/api/v1"
    $env:OPENAI_API_KEY = "your-venice-api-key"
    ```

    **Windows (Command Prompt, persisted):**

    ```bat theme={"system"}
    setx OPENAI_API_BASE https://api.venice.ai/api/v1
    setx OPENAI_API_KEY your-venice-api-key
    ```

    Restart the terminal after `setx` so the new variables are available.
  </Step>

  <Step title="Start Aider with a Venice model">
    From your project directory, prefix the Venice model ID with `openai/`:

    ```bash theme={"system"}
    cd /to/your/project

    aider --model openai/zai-org-glm-5-1
    ```

    Other good starting models:

    ```bash theme={"system"}
    aider --model openai/kimi-k2-5
    aider --model openai/minimax-m25
    aider --model openai/venice-uncensored
    ```

    Browse all text model IDs in the [model catalog](/models/text).
  </Step>
</Steps>

***

## Persist Configuration with `.env`

For a project-local setup, create a `.env` file in your git repo root:

```bash theme={"system"}
OPENAI_API_BASE=https://api.venice.ai/api/v1
OPENAI_API_KEY=your-venice-api-key
AIDER_MODEL=openai/zai-org-glm-5-1
```

Then start Aider normally:

```bash theme={"system"}
aider
```

Aider also reads `.env` from your home directory. Repo-root values take priority over home-directory values. Keep this file out of git — add `.env` to `.gitignore` if it is not ignored already.

<Info>
  You can also set `AIDER_OPENAI_API_BASE` and `AIDER_OPENAI_API_KEY`. Official Aider docs still document `OPENAI_API_BASE` and `OPENAI_API_KEY` for OpenAI-compatible providers.
</Info>

***

## Persist Configuration with YAML

You can store the same settings in `.aider.conf.yml` in your repo root or home directory:

```yaml theme={"system"}
openai-api-base: https://api.venice.ai/api/v1
openai-api-key: your-venice-api-key
model: openai/zai-org-glm-5-1
```

Then run:

```bash theme={"system"}
aider
```

***

## Verify the Setup

After Aider starts, ask it something small that proves the model is reachable:

```txt theme={"system"}
Reply with one sentence confirming you are running through Venice.
```

If the endpoint and key are correct, Aider streams a response from the selected Venice model.

You can also confirm the API key outside Aider:

```bash theme={"system"}
curl https://api.venice.ai/api/v1/models \
  -H "Authorization: Bearer $OPENAI_API_KEY"
```

***

## Choosing Models

| Use case                    | Example model ID    | Aider flag                         |
| --------------------------- | ------------------- | ---------------------------------- |
| Strong coding / refactoring | `zai-org-glm-5-1`   | `--model openai/zai-org-glm-5-1`   |
| Fast iteration              | `minimax-m25`       | `--model openai/minimax-m25`       |
| Long-context coding         | `kimi-k2-5`         | `--model openai/kimi-k2-5`         |
| Uncensored chat             | `venice-uncensored` | `--model openai/venice-uncensored` |

Always prefix Venice model IDs with `openai/` when launching Aider. Without that prefix, Aider will not route the request through the OpenAI-compatible provider path.

Discover current model IDs at runtime:

```bash theme={"system"}
curl https://api.venice.ai/api/v1/models \
  -H "Authorization: Bearer $OPENAI_API_KEY"
```

Or check [GET /models/traits](/api-reference/endpoint/models/traits) for defaults such as `text:default`.

***

## Config Notes

* Keep `OPENAI_API_BASE` set to `https://api.venice.ai/api/v1`. Do not append `/chat/completions`; Aider adds the chat path itself.
* Use a Venice API key in `OPENAI_API_KEY`. Do not use an OpenAI key with the Venice base URL.
* Aider may warn that the model has an unknown context window or cost. That warning is expected for many Venice model IDs and is usually safe to ignore. See [Aider model warnings](https://aider.chat/docs/llms/warnings.html).
* Prefer capable coding/reasoning models for multi-file edits. Smaller or non-coding models may struggle with Aider's edit formats.

<Warning>
  Setting `OPENAI_API_BASE` and `OPENAI_API_KEY` in your shell also affects other tools that read those variables. Prefer a project `.env` or `.aider.conf.yml` if you use OpenAI elsewhere in the same environment.
</Warning>

***

## Troubleshooting

<AccordionGroup>
  <Accordion title="401 or authentication error">
    Confirm `OPENAI_API_KEY` is a Venice key from [venice.ai/settings/api](https://venice.ai/settings/api), with no extra whitespace. On Windows after `setx`, restart the terminal.
  </Accordion>

  <Accordion title="Model not found or empty response">
    Confirm the model ID exists in the [text model catalog](/models/text) and that you launched Aider with the `openai/` prefix, for example `openai/zai-org-glm-5-1`.
  </Accordion>

  <Accordion title="Requests still go to OpenAI">
    Check that `OPENAI_API_BASE` is exactly `https://api.venice.ai/api/v1` in the same shell session. Print it with `echo $OPENAI_API_BASE` (or `$env:OPENAI_API_BASE` in PowerShell).
  </Accordion>

  <Accordion title="Unknown context window / costs warning">
    Expected for many Venice models. Aider falls back to sane defaults. To silence it, add model metadata as described in [Aider advanced model settings](https://aider.chat/docs/config/adv-model-settings.html).
  </Accordion>
</AccordionGroup>

***

## Resources

<CardGroup cols={2}>
  <Card title="Venice Text Models" icon="list" href="/models/text">
    Browse available Venice model IDs
  </Card>

  <Card title="Aider OpenAI-compatible docs" icon="book" href="https://aider.chat/docs/llms/openai-compat.html">
    Official Aider provider setup
  </Card>

  <Card title="Aider config with .env" icon="gear" href="https://aider.chat/docs/config/dotenv.html">
    Persist API keys and model settings
  </Card>

  <Card title="Venice API Reference" icon="code" href="/api-reference/api-spec">
    Full endpoint and parameter docs
  </Card>
</CardGroup>
