> ## 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.

> ## Agent Instructions
> The Venice API is OpenAI-compatible: use any OpenAI SDK with the base URL `https://api.venice.ai/api/v1` and a Venice API key, or pay per request from a USDC wallet through x402 with no account.
> Read model IDs from `GET /models` or `GET /models/traits` at runtime instead of hardcoding them from memory or from these pages. Models are added and retired often.
> Every model's price is in https://docs.venice.ai/pricing.md. Quote video and audio jobs with `POST /video/quote` or `POST /audio/quote` before you queue them.
> Search these docs from an MCP client at https://docs.venice.ai/mcp. The full agent guide is https://docs.venice.ai/agents.md.

# Aider

> Configure Aider for terminal AI pair programming with private Venice chat models via the OpenAI-compatible base URL and an openai/ model prefix.

[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/`.

> [card] Terminal Pair Programming
>
> Edit your git repo with Venice models from the CLI

> [card] OpenAI Compatible
>
> Uses Venice's `/chat/completions` endpoint

> [card] Any Text Model
>
> Swap in any Venice text model ID

***

## Prerequisites

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

***

## Setup

**1. 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.

**2. 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.

**3. 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/z-ai-glm-5-3-flash
```

Other good starting models:

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

Browse all text model IDs in the [model catalog](https://docs.venice.ai/models/text.md).

***

## 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/z-ai-glm-5-3-flash
```

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.

> [!NOTE]
>
> 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.

***

## 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/z-ai-glm-5-3-flash
```

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/api_keys/rate_limits \
  -H "Authorization: Bearer $OPENAI_API_KEY"
```

This endpoint requires a valid key, so a `401` here isolates the problem to the key. `GET /models` is not a key test, because it returns the catalog whether or not a key is sent.

***

## Choosing Models

| Use case | Example model ID | Aider flag |
| - | - | - |
| Strong coding / refactoring | `z-ai-glm-5-3-flash` | `--model openai/z-ai-glm-5-3-flash` |
| Fast iteration | `minimax-m25` | `--model openai/minimax-m25` |
| Long-context coding | `kimi-k2-6` | `--model openai/kimi-k2-6` |
| Uncensored chat | `venice-uncensored-1-2` | `--model openai/venice-uncensored-1-2` |

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](https://docs.venice.ai/api-reference/endpoint/models/traits.md) 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.

***

## Troubleshooting

> [accordion] 401 or authentication error
>
> Confirm `OPENAI_API_KEY` is a Venice key from [venice.ai/settings/api](https://venice.ai/settings/api?utm_source=venice-api-documentation), with no extra whitespace. On Windows after `setx`, restart the terminal.

> [accordion] Model not found or empty response
>
> Confirm the model ID exists in the [text model catalog](https://docs.venice.ai/models/text.md) and that you launched Aider with the `openai/` prefix, for example `openai/z-ai-glm-5-3-flash`.

> [accordion] 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] 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] Still stuck? See what the agent sends
>
> Run the [local debugging proxy](https://docs.venice.ai/learn/local-debug-proxy.md) between Aider and Venice to log every request and response, including the model ID, tools, and error body the agent actually sent, plus the last four characters of the key it used.

***

## Resources

> [card] [Venice Text Models](https://docs.venice.ai/models/text.md)
>
> Browse available Venice model IDs

> [card] [Aider OpenAI-compatible docs](https://aider.chat/docs/llms/openai-compat.html)
>
> Official Aider provider setup

> [card] [Aider config with .env](https://aider.chat/docs/config/dotenv.html)
>
> Persist API keys and model settings

> [card] [Venice API Reference](https://docs.venice.ai/api-reference/api-spec.md)
>
> Full endpoint and parameter docs


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.