Aider on a security model: the OpenAI compatible API setup

Point aider at the API with two environment variables or .aider.conf.yml, prefix the model id with openai/, and silence the unknown-model line with a metadata file. Weak model, architect mode, what an edit turn costs and the errors you will meet.

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

You run aider because it edits files from the terminal without ceremony. The problem is the model behind it: ask a stock assistant to review a proof of concept against a host in your scope and it declines. Aider will use any OpenAI-compatible API, so swap the model. Set two environment variables, start aider with --model openai/ plus an id from the models page, and a security-tuned or uncensored build does the editing. The same ids drop into OpenCode, Cursor and Claude Code; the short version of this page is at /agents/aider.

What you need

A key from the console with credit on it, aider installed, and a repository you are allowed to work in: your own tooling, a client codebase under an engagement, or the files from a CTF challenge. Nothing else. Aider has no provider picker; it treats this API as an OpenAI endpoint at a different address.

Two environment variables do the routing. OPENAI_API_BASE is the address, OPENAI_API_KEY the credential, and the model goes on the command line behind an openai/ prefix. That prefix is the whole trick: it tells aider to send the id to the base URL rather than look it up in its built-in list.

Everything the command line takes can live in a file instead. .aider.conf.yml takes each option as a YAML key and is read from three places, your home directory, then the git root, then the directory you launched from, with the later file overriding the earlier one. --config <file> reads a single file and nothing else. A .env in the same three places carries environment variables, --env-file names one elsewhere, and every flag doubles as an AIDER_ variable (AIDER_MODEL, AIDER_OPENAI_API_BASE), which is handy in a shell profile on a testing VM.

A model aider has never heard of gets two more files: .aider.model.metadata.json for the window and the price, and .aider.model.settings.yml for the edit format and the helper models. Both are searched for in the same three directories or wherever --model-metadata-file and --model-settings-file point. Mid-session, /model, /weak-model and /editor-model swap models, and /settings shows the live configuration.

First reply in two commands

  1. Export the base URL and the key in the shell that will run aider. On Windows use setx in place of export and open a fresh shell afterwards:
shell
1export OPENAI_API_BASE=https://api.pentestllm.ai/v1
2export OPENAI_API_KEY=sk-ptl-live-…
  1. Launch aider inside the repository with the id behind openai/. Every id on the models page goes in the same slot:
shell
1cd /to/your/project
2aider --model openai/glm-5.3-uncensored

That is enough to work. /add the handler you are reviewing and ask where the input reaches a sink, or add a proof of concept for a target in scope and ask for a line-by-line read before you run it. If you would rather see the model answer before installing anything, the home page gives a few demo turns with no account, and the playground runs the same catalog from a browser.

  1. Move the flags into .aider.conf.yml at the git root so you stop retyping them. weak-model is the build aider uses for commit messages and for summarising old chat history; a fast id keeps those calls cheap. Drop the openai-api-key line if the key is already exported:
.aider.conf.yml
1# .aider.conf.yml, in the git root (or ~ for every project)
2openai-api-base: https://api.pentestllm.ai/v1
3openai-api-key: sk-ptl-live-…
4model: openai/glm-5.3-uncensored
5weak-model: openai/glm-5.3-flash-uncensored
  1. On start, aider prints Unknown context window size and costs, using sane defaults because the id is not in its table. It runs anyway; it just cannot show you cost or window. Give it the figures in .aider.model.metadata.json beside the config, each entry named with the openai/ prefix. The block below holds the catalog values for the three ids at the moment this page was built:
.aider.model.metadata.json
1{
2 "openai/glm-5.3-uncensored": {
3 "input_cost_per_token": 0.000000282,
4 "output_cost_per_token": 0.000000846,
5 "litellm_provider": "openai",
6 "mode": "chat"
7 },
8 "openai/glm-5.3-flash-uncensored": {
9 "input_cost_per_token": 0.00000010528,
10 "output_cost_per_token": 0.00000036848,
11 "litellm_provider": "openai",
12 "mode": "chat"
13 },
14 "openai/deepseek-v4.1-flash-abliterated": {
15 "input_cost_per_token": 0.00000084875,
16 "output_cost_per_token": 0.0000016975,
17 "litellm_provider": "openai",
18 "mode": "chat"
19 }
20}
  1. Optional: pin edit format and helper models per id in .aider.model.settings.yml, so they survive a /model switch. diff is the search/replace format, which returns changed lines and nothing else:
.aider.model.settings.yml
1- name: openai/glm-5.3-uncensored
2 edit_format: diff
3 weak_model_name: openai/glm-5.3-flash-uncensored
4 editor_model_name: openai/deepseek-v4.1-flash-abliterated
5 editor_edit_format: editor-diff
6 use_repo_map: true
7- name: openai/glm-5.3-flash-uncensored
8 edit_format: diff
9 use_repo_map: true
10- name: openai/deepseek-v4.1-flash-abliterated
11 edit_format: diff
12 use_repo_map: true
  1. Optional: architect mode, where the main model writes the plan; a second request hands that plan to the editor model, which produces the edit blocks. Two requests per turn, so the bill goes up, but it rescues a build that reasons well and botches the edit syntax. /architect in the chat applies it to one message:
shell
1aider --architect --model openai/glm-5.3-uncensored --editor-model openai/deepseek-v4.1-flash-abliterated

Each setting, one line

OPENAI_API_BASE
https://api.pentestllm.ai/v1
the address every request goes to, including the trailing /v1. In YAML it is openai-api-base; on the command line --openai-api-base
OPENAI_API_KEY
the whole sk-ptl- key
the bearer credential. YAML openai-api-key, flag --openai-api-key. Aider treats it as the OpenAI key, so it has to sit in this slot rather than --api-key
--model
openai/glm-5.3-uncensored
the main chat model. The prefix sends the request to the base URL; what follows it must match the models page character for character
--weak-model
openai/glm-5.3-flash-uncensored
handles commit messages and history summaries. Aider derives a default from the main model, which it cannot do for an id it does not know, so set it
--architect / --editor-model
openai/deepseek-v4.1-flash-abliterated
architect mode: the main model plans the change, the editor model writes the blocks. --editor-edit-format chooses 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 for each id. Kills the unknown-model warning and switches on the running cost
.aider.model.settings.yml
openai/<id> → edit_format…
edit_format, weak_model_name, editor_model_name, use_repo_map and the other ModelSettings keys for an id aider ships no entry for
--show-model-warnings
true by default
controls the unknown-model line. --no-show-model-warnings hides it with no metadata file, but then the cost readout stays dark

Choosing the build

Aider speaks OpenAI chat requests, and every build in the catalog answers them. Picture one edit turn late in a review session: the system prompt, the repo map (aider holds it near --map-tokens, 1k by default, and lets it swell when the chat has no files), the files you brought in with /add and the whole conversation go up; a handful of search/replace blocks come back. Input dominates the cost, which is why a build with a cheap input rate wins per turn and why /drop and /clear are the fastest way to cut the next request.

Both diff and whole are plain text, so a build with no tool calling still edits files under aider. The tool-call column is there for when you reuse the same ids in OpenCode or Cursor, whose agent loops depend on tool calls.

ModelOne edit turnTool calls
GLM-5.3 Uncensored$0.01model page
GLM-5.3 Flash Uncensored$0.0047model page
DeepSeek V4.1 Flash Abliterated$0.04model page
DeepSeek V4 Pro Uncensored$0.04model page
GLM-5.3 Abliterated$0.09model page
GLM-5.3 Flash Code Uncensored$0.25model page

Costed at 40,000 input tokens and 1,200 output tokens, catalog prices of 2026-11-17. The tool-call column repeats what the catalog publishes; a blank means the model page has the answer.

Uncensored models and their prices per million tokens
GLM-5.3 Uncensoredglm-5.3-uncensoredUncensored$0.282$0.846
GLM-5.3 Flash Uncensoredglm-5.3-flash-uncensoredUncensored$0.1053$0.3685
DeepSeek V4.1 Flash Abliterateddeepseek-v4.1-flash-abliteratedAbliterated$0.8488$1.6975
DeepSeek V4 Pro Uncensoreddeepseek-v4-pro-uncensoredUncensored$0.97$1.94
GLM-5.3 Abliteratedglm-5.3-abliteratedAbliterated$2.1825$4.365
GLM-5.3 Flash Code Uncensoredglm-5.3-flash-code-uncensoredUncensored$6.00$6.00

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

For a whole day of exploit development or tooling work, the uncensored coding AI guide puts the code builds next to each other with a day’s cost on each. The common pairing is a strong id as --model and a fast one as --weak-model; the metadata file is what lets aider tally the session as you go.

Prove it works

Ask the API which models your key may call. Each id you plan to put behind openai/ has to appear in this list:

shell
1curl https://api.pentestllm.ai/v1/models -H "Authorization: Bearer sk-ptl-live-…"

Next, fire one request shaped like aider’s own. The -i flag shows the response headers, which carry the request id and, when the answer is not streamed, the charge in USD.

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

Inside aider, the opening lines name the main model, the edit format in use and the weak model. /settings dumps the full configuration; /tokens sizes the next request file by file, useful before you add a large scan output. Send one message with a file attached, then open the console’s usage page: the request is there with its token counts and its charge.

When it breaks

  • 401 invalid_api_key: wrong or revoked key, or OPENAI_API_KEY was never exported in the shell that launched aider. Re-export it or paste it fresh from the console. A key under api-key: in the YAML lands in the wrong slot; it has to be openai-api-key:.
  • 404 model_not_found: whatever follows openai/ is not an id on the models page. Compare it character by character; the id is everything after the prefix.
  • 402 insufficient_balance: not enough credit for this request; top up in the console. 402 monthly_limit_reached: the key reached the monthly cap you gave it.
  • 403 scope_denied: this key is restricted to a set of models and the one you asked for is outside it.
  • 429 rate_limited: the key is over its rate limit. Read retry-after on the response.
  • Unknown context window size and costs, using sane defaults: aider has no entry for the id. Not an error; it assumes a boundless window and a free model. Step 4’s metadata file fixes both, or --no-show-model-warnings hides the line.
  • Aider offers a look-alike model name instead of starting on yours: you left off openai/. Without the prefix aider searches its own catalog; with it, the id goes to the base URL.
  • Failed to apply edit to <file>: the model broke the edit format. Aider’s own remedies, in order: a stronger build, --edit-format whole, architect mode so a second model handles the edits, and fewer files in the chat (/drop, /clear, with /tokens to measure). Aider’s docs mark roughly 25k tokens of context as the point where many models start to slip.
  • .aider.model.settings.yml seems ignored: name must be the prefixed string, openai/glm-5.3-uncensored, not the bare id.

Questions

Yes. Point OPENAI_API_BASE at the endpoint, put the key in OPENAI_API_KEY, and write the model as openai/<id>; aider sends OpenAI-format chat requests there. This API is such an endpoint, so those two variables plus the prefix are the complete setup, and the YAML keys hold the same values on disk.

Create .aider.model.metadata.json with one entry per openai/<id> carrying max_input_tokens, max_output_tokens, input_cost_per_token and output_cost_per_token. With those in place aider reports the running session cost. --no-show-model-warnings only hides the line and gives you no figures.

Begin with diff, the search/replace format: it sends back changed lines only. If a build keeps producing edits aider cannot apply, move to --edit-format whole, which returns the complete file at a higher output cost, or run --architect so a separate editor model writes the blocks.

Tokens at the model’s listed price, drawn from prepaid credit, no subscription required. The table above prices one edit-sized turn per build at the live rate; commit messages and summaries go to the weak model at its own cheaper rate. See the models page.

Every model above is on the uncensored model list with its live price per million tokens. Per-token pricing sets the whole catalog side by side, and the family directory groups the builds by base model.

Get a keyPrepaid 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.

Help