# Connect Aider to WanAPIs

> Point Aider's OPENAI_API_BASE at WanAPIs and call many models as openai/<model>. Pay per token — a good fit for AI pair programming in the terminal.

Web page: https://wanapi.ai/docs/aider

Aider is an AI pair-programming tool for the terminal. It's built on litellm and supports OpenAI-compatible endpoints, so setting OPENAI_API_BASE to WanAPIs is all it takes.

## Setup steps

### 1. Get an API key

Create an account in the WanAPIs console and generate an API key starting with sk-.

### 2. Set the environment variables

Export the base URL and key (add them to ~/.zshrc to make them permanent).

**shell**

```
export OPENAI_API_BASE="https://api.wanapis.com/v1"
export OPENAI_API_KEY="sk-xxx"
```

### 3. Launch with a model

Start Aider with the model name prefixed by openai/.

**shell**

```
aider --model openai/gpt-5.5
```

## FAQ

### Why does the model name need the openai/ prefix?

Aider is built on litellm, where the openai/ prefix means "use the OpenAI-compatible route". Combined with OPENAI_API_BASE, that route points at WanAPIs.

### Can I use Claude models?

Yes. Use the form openai/claude-... with the model name. See the model marketplace for the list.

---

Generated by the WanAPIs website and kept in sync with the web page. All guides in Markdown: https://wanapi.ai/docs/index.md
