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

# Aider

> Use derestricted.ai with Aider's OpenAI-compatible model connection.

Aider can work with `derestricted-llm` through the Chat Completions API.

## Before you start

[Install Aider](https://aider.chat/docs/install.html) and create a key in the [console](https://derestricted.ai/console/). New verified accounts receive \$5 in starting credit.

## Configure the connection

Set these variables in the terminal where you will run Aider:

```bash theme={"system"}
export DERESTRICTED_API_KEY="glmk_YOUR_API_KEY"
export OPENAI_API_KEY="$DERESTRICTED_API_KEY"
export OPENAI_API_BASE="https://api.derestricted.ai/v1"
```

Aider uses `OPENAI_API_BASE` for a compatible service. Its model argument requires an `openai/` prefix to select the protocol; the model sent to derestricted.ai is `derestricted-llm`. See Aider's [compatible API guide](https://aider.chat/docs/llms/openai-compat.html).

## Start Aider

From your project directory:

```bash theme={"system"}
aider --model openai/derestricted-llm
```

Add a small file to the conversation and ask for a focused change. Review the resulting diff as part of your normal development workflow.

## If something fails

* **Unknown model warning:** Aider may not have built-in context or pricing metadata for this model. That warning alone does not indicate an authentication failure. See Aider's [model warnings](https://aider.chat/docs/llms/warnings.html).
* **Authentication or connection error:** launch Aider from the terminal containing the exports above; check that the base URL includes `/v1`.
* **Large request:** include fewer files or start a shorter conversation. Local token estimates do not override the gateway's request limits.
* **Credits or rate limits:** check the [console](https://derestricted.ai/console/) and the [error guide](/api/errors).
