# Aider setup

Aider is a terminal pair-programming tool that edits files in your git repository. It talks to OpenAI-compatible APIs, so it runs on Claudech with two environment variables.

## Before you start

- **A Claudech API key** from [API keys](https://claudech.com/api-keys). API access unlocks after your first purchase.

## Quick start

**macOS / Linux**

```bash
export OPENAI_API_BASE=https://api.claudech.com/v1
export OPENAI_API_KEY=sk-...
aider --model openai/claude-opus-5-5 --weak-model openai/claude-sonnet-5
```

**Windows (PowerShell)**

```powershell
$env:OPENAI_API_BASE = "https://api.claudech.com/v1"
$env:OPENAI_API_KEY = "sk-..."
aider --model openai/claude-opus-5-5 --weak-model openai/claude-sonnet-5
```

The `openai/` prefix tells Aider to use the OpenAI-compatible endpoint; the part after it is the Claudech model id. The weak model handles commit messages and chat summaries, so a fast model there saves time and tokens.

## Make it permanent

Put the same settings in `.aider.conf.yml` in your home directory or repository:

```yaml
openai-api-base: https://api.claudech.com/v1
openai-api-key: sk-...
model: openai/claude-opus-5-5
weak-model: openai/claude-sonnet-5
```

## Things to know

- Aider may warn that the model's context window and costs are unknown. The warning is harmless: Claudech models accept 1M tokens of context, and your [Usage](https://claudech.com/usage) page shows the real cost of every request.
- For hard problems, switch the main model with `/model openai/claude-fable-5-1` inside a session.

## Troubleshooting

| Symptom | Fix |
| --- | --- |
| `401` or "invalid API key" | Re-copy the key without spaces; check it is active under **API keys** |
| Requests go to OpenAI | `OPENAI_API_BASE` is not set in this terminal |
| `404 model_not_found` | Keep the `openai/` prefix and use the Claudech id after it |
| `402 insufficient_balance` | Top up under [Billing](https://claudech.com/billing) |

See [all integrations](https://claudech.com/docs/integrations) for other tools. Claudech is an independent service and is not affiliated with the makers of Aider.

---

Source: https://claudech.com/docs/integrations/aider
