> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://respan.ai/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://respan.ai/docs/_mcp/server.

# Aider (gateway)

> Set up Aider with the Respan gateway.

Route [Aider](https://aider.chat)'s LLM calls through the Respan gateway for automatic logging, caching, and model switching. Aider supports OpenAI-compatible endpoints, so only your `RESPAN_API_KEY` is needed.

## Setup

#### Install Aider

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

#### Set environment variables

Add to your shell profile (`.bashrc`, `.zshrc`, or PowerShell `$PROFILE`):

```bash
export OPENAI_API_BASE="https://api.respan.ai/api"
export OPENAI_API_KEY="YOUR_RESPAN_API_KEY"
```

No separate OpenAI API key needed. The Respan gateway handles provider authentication.

#### Run Aider

Prefix the model with `openai/` so Aider uses the OpenAI-compatible route:

```bash
aider --model openai/gpt-4o
```

All LLM calls now route through Respan.

## Switch models

Change the `--model` flag to use any of the 1000+ models available through the gateway. Keep the `openai/` prefix so calls go through the OpenAI-compatible endpoint.

```bash
aider --model openai/gpt-4o
aider --model openai/claude-sonnet-4-5-20250929
aider --model openai/gemini/gemini-3.5-flash
```

See the [full model list](https://platform.respan.ai/platform/models).