---
title: "Aider on an OpenAI compatible API, uncensored build"
canonical: https://unrestrictable.ai/guides/aider
generated: 2026-11-16T02:57:37.989Z
source: https://unrestrictable.ai/guides/aider
base_url: https://api.unrestrictable.ai/v1
---

# Run aider on an uncensored model

Two environment variables, the openai/ prefix, a metadata file for cost and window, a weak model for commits, architect mode, and what one edit turn costs.

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

Aider is the pair programmer that lives in your terminal and edits the repo directly. It speaks OpenAI's chat format, so an uncensored build from this catalog needs a base URL, a key and the `openai/` prefix on the model id, nothing more. Below: the two-command start, the config files, the cost readout and the errors. The ids carry over to [OpenCode](https://unrestrictable.ai/guides/opencode), [Cursor](https://unrestrictable.ai/guides/cursor) and, via a router, [Claude Code](https://unrestrictable.ai/guides/claude-code).

## What you need

- An API key from the [console](https://app.unrestrictable.ai/console). It begins with `sk-unr-` and draws on a prepaid balance, per token.
- Aider installed, and a project folder to open it in.
- A model id copied from the [models page](https://unrestrictable.ai/models). The examples below use `glm-5.3-uncensored`.
- To try a build before installing anything, chat with it at [/chat](https://unrestrictable.ai/chat), free each day with no account, or in Telegram through [the bot](https://unrestrictable.ai/telegram).

## Two commands to a first edit

Aider has no provider picker. It reads an OpenAI base URL and key from the environment, and treats any model written as `openai/<id>` as living at that URL. Export both values in the shell you will launch aider from (Windows: `setx`, then open a fresh shell):

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

Then open your project and name the build behind the prefix:

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

Ask for a change. Aider sends the request to this API, receives search/replace blocks and writes them into your files. Swap the id for any other on the models page and nothing else moves.

## Where aider looks for settings

Every flag can live in `.aider.conf.yml` as a YAML key. Aider reads that file from three places: your home directory, the root of the git repo and the folder you launched from, in that order, with a later file overriding an earlier one. `--config <file>` reads a single file and ignores the rest.

Environment variables have the same three homes in a `.env` file, or one file of your choosing through `--env-file`. Each flag also maps to an `AIDER_` variable, so `AIDER_MODEL` and `AIDER_OPENAI_API_BASE` can sit in a shell profile.

For a model aider has never heard of, two more files fill in what it would otherwise guess. `.aider.model.metadata.json` gives the context window and the prices; `.aider.model.settings.yml` gives the edit format, the weak model and the repo map. Both are searched in the same three places, or wherever `--model-metadata-file` and `--model-settings-file` point. Mid-session, `/model`, `/weak-model` and `/editor-model` change the builds, and `/settings` shows what aider is running with.

## Move the flags into files

1. Write the base URL, key and models into `.aider.conf.yml` at the repo root, and the command shrinks to `aider`. The `weak-model` line names the build for commit messages and history summaries, work a fast build does well for less. If the key already sits in the environment, drop the `openai-api-key` line:

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

1. On launch aider warns `Unknown context window size and costs, using sane defaults` for an id outside its own table. Edits still work; what you lose is the token budget and the running cost. Supply both in `.aider.model.metadata.json` beside the config, each entry keyed with the `openai/` prefix. The numbers here come straight from the catalog for the three ids, fetched when this page was built:

```
{
  "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` pins the edit format and the helper builds to each id, so they survive a `/model` switch. `diff` means search/replace blocks: only the lines that change come back:

```
- 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 splits each turn in two: the main build plans the change, then the editor build turns the plan into edit blocks. Twice the requests, so a higher bill, but it rescues a build that reasons well and botches the edit syntax. In the chat, `/architect` applies the same split to a single message:

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

## Setting by setting

- OPENAI_API_BASE: https://api.unrestrictable.ai/v1 every request goes here, and the trailing /v1 is required. In YAML: openai-api-base; on the command line: --openai-api-base
- OPENAI_API_KEY: the whole sk-unr- key sent as the bearer token on each call. YAML openai-api-key, flag --openai-api-key. Aider treats it as its OpenAI key, so --api-key is the wrong slot
- --model: openai/glm-5.3-uncensored the build that writes the code. openai/ routes it to the base URL; what follows must match the models page letter for letter
- --weak-model: openai/glm-5.3-flash-uncensored handles commit messages and history summaries. Aider normally derives it from the main model, which it cannot do for an unknown id
- --architect / --editor-model: openai/deepseek-v4.1-flash-abliterated the planner and the editor of a two-step turn; --editor-edit-format chooses editor-diff or editor-whole for the second step
- .aider.model.metadata.json: openai/<id> → window and cost per openai/<id>: max_input_tokens, max_output_tokens and the two per-token costs. Silences the unknown-model line and switches the cost counter on
- .aider.model.settings.yml: openai/<id> → edit_format… per openai/<id>: edit_format, weak_model_name, editor_model_name, use_repo_map and the other ModelSettings fields aider lacks for an id it does not ship
- --show-model-warnings: true by default on unless you pass --no-show-model-warnings, which hides the line but leaves the cost counter off

## Which build to run

Every build on the models page speaks the chat format aider sends. What a turn carries: the system prompt, the repo map (about `--map-tokens` worth, 1k unless you change it, larger while no files are in the chat), whatever you pulled in with `/add`, and the whole conversation so far. What comes back is a handful of search/replace blocks. The bill is mostly input tokens, so the input price decides the cost of a turn, and `/drop` or `/clear` shrinks the next one at once.

Because `diff` and `whole` are plain-text formats, a build without tool calling still edits files fine. The tool-call column is for later, when you reuse the id in [OpenCode](https://unrestrictable.ai/guides/opencode) or [Cursor](https://unrestrictable.ai/guides/cursor), whose agents cannot run without it.

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

One turn taken as 40,000 tokens in and 1,200 out, at catalog prices from 2026-11-16. The tool-call column repeats what the catalog publishes; where it publishes nothing, follow the link to the model page.

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

The usual pairing is a strong build under `--model` and a fast one under `--weak-model`; with the metadata file in place aider totals the session as you go. For a wider comparison of the code builds, and what a full day of coding costs on each, read [the uncensored coding AI guide](https://unrestrictable.ai/guides/uncensored-coding-ai).

## Prove the wiring

First ask the API which models your key can reach. Every id you plan to put behind `openai/` must appear:

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

Next, one chat request shaped like aider's own. With `-i` curl prints the response headers, which carry a request id and, when the answer is not streamed, the charge in USD:

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

Inside aider, the opening lines announce the main build, its edit format and the weak build. `/settings` dumps the whole configuration; `/tokens` breaks the next request down file by file. Add one file, send one message, and the call appears on the console's usage page with its token counts and charge.

## When something fails

- `401 invalid_api_key`: the key is mistyped or revoked, or the shell that launched aider never saw `OPENAI_API_KEY`. Export it once more, or paste a fresh copy from the console. In YAML the key belongs under `openai-api-key:`; an `api-key:` line lands somewhere else.
- `404 model_not_found`: whatever follows `openai/` is not an id on the models page. Compare it character by character; everything after the prefix is the id.
- `402 insufficient_balance`: not enough prepaid balance for this request. Top up in the console. `402 monthly_limit_reached` is different: the key reached the monthly cap you gave it.
- `403 scope_denied`: this key is restricted to a list of models, and the one you asked for is not on it.
- `429 rate_limited`: too many requests for this key. Wait the `retry-after` the response names.
- `Unknown context window size and costs, using sane defaults`: aider lacks an entry for the id. Nothing is broken; it proceeds as if the window were unlimited and the tokens free. Step 2 of the files section fixes it with real figures, or `--no-show-model-warnings` hides the message.
- Aider offers a model with a similar name and will not start with yours: you left off `openai/`. The prefix is the routing; a bare name is looked up in aider's built-in list instead.
- `Failed to apply edit to <file>`: the build broke the edit format. Aider's own ladder: a stronger build, then `--edit-format whole`, then architect mode with a separate editor build, then fewer files in the chat (`/drop`, `/clear`, with `/tokens` to measure). Aider's docs say most models begin to slip past roughly 25k tokens of context.
- `.aider.model.settings.yml` seems ignored: each `name` must carry the prefix, `openai/glm-5.3-uncensored`, never the id on its own.

## Questions

### Can aider talk to an OpenAI compatible API that is not OpenAI?

Yes. Point OPENAI_API_BASE at the endpoint, put the key in OPENAI_API_KEY, and write the model as openai/<id>. Aider routes every prefixed id to that base URL, which makes this API a drop-in; the YAML keys hold the same values when you prefer a file.

### Why does aider say unknown context window size and costs, and how do I fix it?

The id is not in aider’s built-in table. Give it one in .aider.model.metadata.json, keyed openai/<id>, with the window, the output cap and the two per-token prices. The warning stops and the running cost appears. --no-show-model-warnings only hides the line.

### Which aider edit format works best with these builds?

diff first: search/replace blocks that carry only the changed lines. When a build keeps failing to apply them, try --edit-format whole, which rewrites the entire file at a higher output cost, or --architect, which hands the edit blocks to a second build.

### How much does aider cost on this API?

Whatever the tokens come to at the model’s listed price, drawn from your prepaid balance; there is no subscription. The turn table above prices one edit-sized exchange per build at today’s rate, and the weak build bills commit messages and summaries at its own lower price. See the models page.

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

[Get a key](https://app.unrestrictable.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.
