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

# Aider

> Connect Aider to NoMask from your terminal.

Use NoMask with Aider to discuss and edit files from your terminal.

## Before you start

* Create a key on the [API Keys page](https://nomask.ai/api/keys) and add funds to your API balance.
* Choose a text model with **Function calling** and streaming on the [Models page](https://nomask.ai/models). Copy its exact model ID.
* Use the connection values below. Replace key placeholders locally; keep secrets out of project files and source control.

| Setting | Value |
| - | - |
| **API base URL** | `https://api.nomask.ai/v1` |
| **Model ID** | `your-model-id` |
| **API key** | Your NoMask API key |

> [!NOTE]
>
> Replace `your-model-id` throughout the examples with the exact ID of a text model that supports function calling and streaming. Check the [Models page](https://nomask.ai/models) for current availability and limits.

Examples use your selected model. If you change it, also update context, output and image settings to match that model. These guides cover text models; Image Studio models use separate image endpoints.

## Install and configure

### 1. Install Aider

With Python 3.8–3.13 installed, run the installer. It creates a separate environment for Aider.

```bash theme={"system"}
python -m pip install aider-install
aider-install
aider --version
```

### 2. Set your API key

Aider reads the compatible connection key from `OPENAI_API_KEY`. Set it in the terminal used to launch Aider.

> [tab] macOS / Linux / WSL
>
> ```bash theme={"system"}
> export OPENAI_API_KEY="YOUR_NOMASK_API_KEY"
> ```

> [tab] Windows PowerShell
>
> ```powershell theme={"system"}
> $env:OPENAI_API_KEY = "YOUR_NOMASK_API_KEY"
> ```

### 3. Save your project settings

Create `.aider.conf.yml` in your project directory:

```yaml theme={"system"}
model: "openai/your-model-id"
weak-model: "openai/your-model-id"
editor-model: "openai/your-model-id"
openai-api-base: "https://api.nomask.ai/v1"
```

`openai/` tells Aider to use the compatible API. Keep the full NoMask ID after that prefix. The weak and editor model settings keep summaries, commit messages and editing tasks on the same selected model.

> [!NOTE]
>
> Aider may warn that a custom model has unknown context or pricing metadata. Check its NoMask model card for the actual limits and prices. An unknown-model warning alone does not mean the connection failed.

## Launch and test

Open your project and load the settings file explicitly:

```bash theme={"system"}
cd path/to/your-project
aider --config .aider.conf.yml
```

* Confirm the startup summary shows `openai/your-model-id`.
* Enter `/ask Reply with exactly NOMASK_OK.` to test without editing a file.
* Enter `/add nomask-test.txt` and accept creating the file if asked. Then enter `/code Put NOMASK_OK on the first line of nomask-test.txt.`
* Use `/diff` to inspect the change.

If edits fail to apply, try `aider --config .aider.conf.yml --edit-format whole` with a small file. This simpler format returns the entire updated file and can use more output tokens.

If the API key is missing, check `OPENAI_API_KEY` in the same terminal. Keep the base URL at the API root and preserve the `openai/` prefix in all three model settings.

## Troubleshooting

* **401:** check that your key is active and available to the process running the tool. Restart the tool after changing environment variables.
* **402:** add funds to your API balance or reduce the requested output.
* **404:** check the exact model ID and base URL. Direct connections use Chat Completions, not Responses or Anthropic Messages.
* **429:** wait for `Retry-After`. API keys share account limits; creating another key does not reset usage. Check the key's monthly spending cap too.
* **Context or tool errors:** start a shorter task, lower the output limit and confirm the model supports function calling. A plain text reply alone does not confirm file-editing tools work.

Check [API Overview](https://nomask.ai/api/overview) for usage and recent errors. Include the request ID when contacting support; never send your key. See [Errors](https://docs.nomask.ai/errors.md) and [Rate Limits](https://docs.nomask.ai/rate-limits.md).

## Official references

Setup checked against the documentation below. Tool versions may change their settings or configuration format.

* [Aider installation](https://aider.chat/docs/install.html)
* [Aider compatible API setup](https://aider.chat/docs/llms/openai-compat.html)
* [Aider YAML configuration](https://aider.chat/docs/config/aider_conf.html)
* [Aider model and helper options](https://aider.chat/docs/config/options.html)
* [Aider in-chat commands](https://aider.chat/docs/usage/commands.html)
* [Aider edit formats](https://aider.chat/docs/more/edit-formats.html)


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