---
title: "Aider OpenAI compatible API: uncensored model setup"
canonical: https://uncensoredllm.ai/guides/aider
generated: 2026-11-09T16:02:05.791Z
source: https://uncensoredllm.ai/guides/aider
base_url: https://api.uncensoredllm.ai/v1
---

# Aider with an uncensored model

The base URL and key as environment variables or in .aider.conf.yml, the openai/ prefix on the model id, and the metadata file that ends the unknown-model warning. A weak model for commits, architect mode, the cost per edit turn and the errors.

Steps checked November 2, 2026 · prices as of November 9, 2026

Aider takes an OpenAI-compatible API through two environment variables and a model prefix. Set the base URL and the key, start it with `--model openai/` and an id from the models page, and an uncensored build edits files in the terminal. The same ids work in [OpenCode](https://uncensoredllm.ai/guides/opencode), [Cursor](https://uncensoredllm.ai/guides/cursor) and, through a router, in [Claude Code](https://uncensoredllm.ai/guides/claude-code).

## Where the settings are

Aider has no provider menu. It reads the OpenAI base URL and key from two environment variables, `OPENAI_API_BASE` and `OPENAI_API_KEY`, and takes the model on the command line with an `openai/` prefix. That is the whole of the OpenAI-compatible setup in aider’s docs.

The same values go in files. `.aider.conf.yml` holds any command-line option as a YAML key; aider loads it from your home directory, the root of the git repo and the current directory, in that order, and the file loaded last wins. `--config <file>` loads one file only. A `.env` file in the same three places takes environment variables, with `--env-file` for one somewhere else. Every flag also has an `AIDER_` environment variable, so `AIDER_MODEL` and `AIDER_OPENAI_API_BASE` work from a shell profile.

Two more files describe a model aider does not know: `.aider.model.metadata.json` (context window and cost) and `.aider.model.settings.yml` (edit format, weak model, repo map). Aider looks for both in the same three places, or where `--model-metadata-file` and `--model-settings-file` point. Inside the chat, `/model`, `/weak-model` and `/editor-model` switch models for the session, and `/settings` prints what is in effect.

## Steps

1. Create a key in the [console](https://app.uncensoredllm.ai/console). In the shell that will run aider, set the base URL and the key (Windows: `setx` instead of `export`, then open a new shell):

```bash
export OPENAI_API_BASE=https://api.uncensoredllm.ai/v1
export OPENAI_API_KEY=sk-ullm-live-…
```

1. Start aider in the project with the model id behind `openai/`. Any id on the [models page](https://uncensoredllm.ai/models) works the same way:

```bash
cd /to/your/project
aider --model openai/glm-5.3-uncensored
```

1. To stop typing the flags, put them in `.aider.conf.yml` at the git root. `weak-model` is the model aider uses for commit messages and chat history summaries; a fast build keeps that cost small. Leave the `openai-api-key` line out if the key stays in the environment:

```
# .aider.conf.yml, in the git root (or ~ for every project)
openai-api-base: https://api.uncensoredllm.ai/v1
openai-api-key: sk-ullm-live-…
model: openai/glm-5.3-uncensored
weak-model: openai/glm-5.3-flash-uncensored
```

1. At start, aider prints `Unknown context window size and costs, using sane defaults` for a model it has no record of. It still works; it just cannot count cost or window. To end the line and get the figures, add `.aider.model.metadata.json` next to the config, with the names carrying the same `openai/` prefix. The values below are the catalog’s own for the three ids, read when this page rendered:

```
{
  "openai/glm-5.3-uncensored": {
    "input_cost_per_token": 0.000000282,
    "output_cost_per_token": 0.000000846,
    "litellm_provider": "openai",
    "mode": "chat"
  },
  "openai/glm-5.3-flash-uncensored": {
    "input_cost_per_token": 0.00000010528,
    "output_cost_per_token": 0.00000036848,
    "litellm_provider": "openai",
    "mode": "chat"
  },
  "openai/deepseek-v4.1-flash-abliterated": {
    "input_cost_per_token": 0.00000084875,
    "output_cost_per_token": 0.0000016975,
    "litellm_provider": "openai",
    "mode": "chat"
  }
}
```

1. Optional: `.aider.model.settings.yml` fixes the edit format and the helper models per id, so a `/model` switch mid-session keeps them. `diff` is the search/replace format that returns only the changed lines:

```
- name: openai/glm-5.3-uncensored
  edit_format: diff
  weak_model_name: openai/glm-5.3-flash-uncensored
  editor_model_name: openai/deepseek-v4.1-flash-abliterated
  editor_edit_format: editor-diff
  use_repo_map: true
- name: openai/glm-5.3-flash-uncensored
  edit_format: diff
  use_repo_map: true
- name: openai/deepseek-v4.1-flash-abliterated
  edit_format: diff
  use_repo_map: true
```

1. Optional: architect mode. The main model proposes the change and a second request turns it into edits with the editor model. Two requests per turn, so it costs more, and it helps when a build plans well but fumbles the edit blocks. `/architect` in the chat does the same for one message:

```bash
aider --architect --model openai/glm-5.3-uncensored --editor-model openai/deepseek-v4.1-flash-abliterated
```

## What each setting does

- OPENAI_API_BASE: https://api.uncensoredllm.ai/v1 where aider sends every request; the /v1 at the end matters. openai-api-base in the YAML, --openai-api-base on the command line
- OPENAI_API_KEY: the whole sk-ullm- key the credential on each request. openai-api-key in the YAML, --openai-api-key on the command line; aider sends it as the OpenAI key, which is why this slot and not --api-key
- --model: openai/glm-5.3-uncensored the main chat model: the prefix routes the id to the base URL above; the id after it is exactly as the models page spells it
- --weak-model: openai/glm-5.3-flash-uncensored the model for commit messages and chat history summaries; defaults from the main model, which aider cannot do for an id it does not know
- --architect / --editor-model: openai/deepseek-v4.1-flash-abliterated architect mode splits a turn: the main model plans, the editor model writes the edit blocks; --editor-edit-format picks editor-diff or editor-whole
- .aider.model.metadata.json: openai/<id> → window and cost max_input_tokens, max_output_tokens, input_cost_per_token and output_cost_per_token per id; ends the unknown-model line and turns on the cost readout
- .aider.model.settings.yml: openai/<id> → edit_format… edit_format, weak_model_name, editor_model_name, use_repo_map and the rest of ModelSettings for an id aider has no built-in entry for
- --show-model-warnings: true by default prints the unknown-model line; --no-show-model-warnings silences it without a metadata file, and the cost readout stays off

## Picking a model

Aider sends OpenAI-format chat requests, and every build on the models page answers in that format. An edit turn carries the system prompt, the repo map (aider sizes it to about `--map-tokens`, 1k by default, and lets it grow when no files are in the chat), the files you added with `/add` and the conversation so far; the answer is a few search/replace blocks. Input tokens are most of the bill, so a build with a low input price costs the least per turn, and `/drop` and `/clear` cut the next turn’s cost directly.

Aider’s `diff` and `whole` formats are plain text, so a build that takes no tool calls still edits files. The last column matters when the same ids go into [OpenCode](https://uncensoredllm.ai/guides/opencode) or [Cursor](https://uncensoredllm.ai/guides/cursor), whose agent loops need tool calls.

| Model | One edit turn | Tool calls |
| --- | --- | --- |
| [GLM-5.3 Uncensored](https://uncensoredllm.ai/models/glm-5.3-uncensored) | $0.01 | [model page](https://uncensoredllm.ai/models/glm-5.3-uncensored) |
| [GLM-5.3 Flash Uncensored](https://uncensoredllm.ai/models/glm-5.3-flash-uncensored) | $0.0047 | [model page](https://uncensoredllm.ai/models/glm-5.3-flash-uncensored) |
| [DeepSeek V4.1 Flash Abliterated](https://uncensoredllm.ai/models/deepseek-v4.1-flash-abliterated) | $0.04 | [model page](https://uncensoredllm.ai/models/deepseek-v4.1-flash-abliterated) |
| [DeepSeek V4 Pro Uncensored](https://uncensoredllm.ai/models/deepseek-v4-pro-uncensored) | $0.04 | [model page](https://uncensoredllm.ai/models/deepseek-v4-pro-uncensored) |
| [GLM-5.3 Abliterated](https://uncensoredllm.ai/models/glm-5.3-abliterated) | $0.09 | [model page](https://uncensoredllm.ai/models/glm-5.3-abliterated) |
| [GLM-5.3 Flash Code Uncensored](https://uncensoredllm.ai/models/glm-5.3-flash-code-uncensored) | $0.25 | [model page](https://uncensoredllm.ai/models/glm-5.3-flash-code-uncensored) |

40,000 input and 1,200 output tokens at the catalog prices on 2026-11-09. Tool calls as the catalog publishes them; where it does not, the model page says.

| Model | Build | Input $/M | Output $/M |
| --- | --- | --- | --- |
| [GLM-5.3 Uncensored](https://uncensoredllm.ai/models/glm-5.3-uncensored) glm-5.3-uncensored | Uncensored | $0.282 | $0.846 |
| [GLM-5.3 Flash Uncensored](https://uncensoredllm.ai/models/glm-5.3-flash-uncensored) glm-5.3-flash-uncensored | Uncensored | $0.1053 | $0.3685 |
| [DeepSeek V4.1 Flash Abliterated](https://uncensoredllm.ai/models/deepseek-v4.1-flash-abliterated) deepseek-v4.1-flash-abliterated | Abliterated | $0.8488 | $1.6975 |
| [DeepSeek V4 Pro Uncensored](https://uncensoredllm.ai/models/deepseek-v4-pro-uncensored) deepseek-v4-pro-uncensored | Uncensored | $0.97 | $1.94 |
| [GLM-5.3 Abliterated](https://uncensoredllm.ai/models/glm-5.3-abliterated) glm-5.3-abliterated | Abliterated | $2.1825 | $4.365 |
| [GLM-5.3 Flash Code Uncensored](https://uncensoredllm.ai/models/glm-5.3-flash-code-uncensored) glm-5.3-flash-code-uncensored | Uncensored | $6.00 | $6.00 |

Prices per million tokens, read from the live catalog on 2026-11-09.

For coding specifically, [the uncensored coding AI guide](https://uncensoredllm.ai/guides/uncensored-coding-ai) compares the code builds and costs a full coding day on each. A strong build as `--model` and a fast one as `--weak-model` is the usual pair; the metadata file is what lets aider count the cost of the session.

## Check it

List the models your key can call; every id you put behind `openai/` should be in the answer:

```bash
curl https://api.uncensoredllm.ai/v1/models -H "Authorization: Bearer sk-ullm-live-…"
```

Then send one request the way aider does. `-i` prints the headers: `x-uplink-request-id` names the request, and on a non-streamed answer `x-uplink-charge` is what it cost in USD.

```bash
curl -i https://api.uncensoredllm.ai/v1/chat/completions \
  -H "Authorization: Bearer sk-ullm-live-…" \
  -H "Content-Type: application/json" \
  -d '{"model": "glm-5.3-uncensored", "messages": [{"role": "user", "content": "Reply with the single word ok."}]}'
```

In aider, the announce lines at start name the main model, its edit format and the weak model; `/settings` prints the full configuration and `/tokens` the size of the next request, file by file. Send one message with a file added. The request shows on the console’s usage page with its tokens and its charge.

## Errors and fixes

- `401 invalid_api_key`: the key is wrong or revoked, or `OPENAI_API_KEY` is not set in the shell that started aider. Export it again, or copy the key again from the console. A key under `api-key:` in the YAML does not reach this slot; use `openai-api-key:`.
- `404 model_not_found`: the id after `openai/` is not on the models page. Check the spelling against the page; the id is the whole string after the prefix.
- `402 insufficient_balance`: the balance does not cover the request. Top up in the console. `402 monthly_limit_reached` means the key hit the monthly spend limit you set on it.
- `403 scope_denied`: the key is limited to certain models and this is not one of them.
- `429 rate_limited`: the key hit its rate limit. The response carries `retry-after`.
- `Unknown context window size and costs, using sane defaults`: aider has no record of the id. Not a failure; aider assumes an unlimited window and a free model. The metadata file in step 4 supplies both, or `--no-show-model-warnings` drops the line.
- Aider suggests a similarly named model instead of starting with yours: the `openai/` prefix is missing. The prefix is what sends the id to the base URL; without it aider looks the name up in its own list.
- `Failed to apply edit to <file>`: the model did not follow the edit format. Aider’s own fixes, in order: a stronger build, `--edit-format whole`, architect mode with a second model on the edits, fewer files in the chat (`/drop`, `/clear`, and `/tokens` to see the size). Aider’s docs put the point where most models start slipping at about 25k tokens of context.
- Settings from `.aider.model.settings.yml` not applied: the `name` has to be the full string with the prefix, `openai/glm-5.3-uncensored`, not the bare id.

## Questions

### Does aider work with any OpenAI compatible API?

Yes. Aider sends OpenAI-format chat requests to OPENAI_API_BASE with OPENAI_API_KEY and routes any model written as openai/<id> there. This API is one such endpoint, so the two variables and the prefix are the whole setup; the YAML keys are the same values in a file.

### How do I stop the unknown context window size and costs warning?

Add .aider.model.metadata.json with an entry per openai/<id>: max_input_tokens, max_output_tokens, input_cost_per_token and output_cost_per_token. Aider then shows the session cost as it goes. --no-show-model-warnings hides the line without the figures.

### Which edit format should I use with these models?

Start with diff, the search/replace format that returns only the changed lines. If a build keeps failing to apply edits, switch to --edit-format whole, which returns the full file and costs more output tokens, or run --architect so a second model writes the edit blocks.

### What does an aider session cost?

Per token at the model’s price, from your prepaid balance, with no subscription. The table above costs one edit-sized turn on each build at the live price; the weak model takes the commit messages and summaries at its own, lower rate. See the models page.

Every model above is on the [uncensored model list](https://uncensoredllm.ai/models) with its live price per million tokens. [Per-token pricing](https://uncensoredllm.ai/pricing) sets the whole catalog side by side, and the [family directory](https://uncensoredllm.ai/uncensored) groups the builds by base model.

[Get a key](https://app.uncensoredllm.ai/console) Prepaid from $10, no subscription.

## New models and price changes, once a month.

New uncensored builds with their prices, price moves, and what the daily model check found.
