OpenClaw on a security model that answers

Give OpenClaw this API through one models.providers entry in ~/.openclaw/openclaw.json: baseUrl, a key pulled from the environment, the openai-completions adapter and a models array of security and abliterated builds. Then the default model, what a session costs and the error fixes.

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

An agent that halts a red team exercise to question whether you are allowed to read your own scan output is a liability. OpenClaw takes a custom provider in ~/.openclaw/openclaw.json: a base URL, the Chat Completions adapter, a key reference and the model ids. With that single block a security-tuned or abliterated build drives the agent, tool calls for files and shell included, billed per token under the PentestLLM name. The same ids also work in Hermes Agent and OpenCode.

What you need

OpenClaw installed with its Gateway running, a key from the console, and an editor open on ~/.openclaw/openclaw.json. That file is JSON5, so comments and trailing commas are legal, and the Gateway watches it: most changes take effect the moment you save. A custom provider is a single entry under models.providers holding a base URL, an API adapter, a key reference and the list of models you intend to call. The reference ${PENTESTLLM_API_KEY} pulls the key from the environment, so the key itself never lands in the file. To try a security build before any of this, the home page prompt box gives a few free turns and the playground runs the same catalog.

Shortest path to a first reply

  1. Make a key for OpenClaw alone, so its traffic is easy to pick out on the usage page when you reconcile an engagement, and place it where OpenClaw actually looks for the variable: the process environment or the global env file. A .env in your working directory is not read for provider keys.
.env
1# ~/.openclaw/.env
2PENTESTLLM_API_KEY=sk-ptl-live-…
  1. Paste the block into openclaw.json. The input, contextWindow and maxTokens fields on each entry are taken from the catalog wherever it publishes them. Any further id from the models page belongs in the same array with, at minimum, its id:
openclaw.json
1// ~/.openclaw/openclaw.json
2{
3 agents: {
4 defaults: { model: { primary: "pentestllm/glm-5.3-uncensored" } },
5 },
6 models: {
7 mode: "merge",
8 providers: {
9 pentestllm: {
10 baseUrl: "https://api.pentestllm.ai/v1",
11 apiKey: "${PENTESTLLM_API_KEY}",
12 api: "openai-completions",
13 models: [
14 { id: "glm-5.3-uncensored", name: "GLM-5.3 Uncensored" },
15 { id: "glm-5.3-flash-uncensored", name: "GLM-5.3 Flash Uncensored" },
16 { id: "deepseek-v4.1-flash-abliterated", name: "DeepSeek V4.1 Flash Abliterated" },
17 { id: "deepseek-v4-pro-uncensored", name: "DeepSeek V4 Pro Uncensored" },
18 { id: "glm-5.3-abliterated", name: "GLM-5.3 Abliterated" },
19 { id: "kimi-k3.1-pro-uncensored", name: "Kimi K3.1 Pro Uncensored", contextWindow: 1048576, maxTokens: 131072 },
20 ],
21 },
22 },
23 },
24}
  1. See what OpenClaw made of it, then start a conversation:
shell
1openclaw models list --provider pentestllm
2openclaw models status

models list --provider pentestllm echoes the ids you declared and models status reports the resolved primary model with its auth state. Swap the default later with openclaw models set pentestllm/glm-5.3-flash-uncensored. A first message, for instance asking the agent to read a scan log and group the findings by host, lands on the console’s usage page within seconds, token counts and charge included.

Each field of the entry

baseUrl
https://api.pentestllm.ai/v1
keep the trailing /v1; OpenClaw appends /chat/completions itself
apiKey
${PENTESTLLM_API_KEY}
the full sk-ptl- key, resolved from the environment when OpenClaw starts
api
openai-completions
the Chat Completions adapter; every build in the catalog speaks it
models
[{ id, name, … }]
the ids this provider exposes; an id with no entry here cannot be referenced anywhere
mode
merge
adds this provider beside OpenClaw's bundled ones; replace would remove them
agents.defaults.model.primary
pentestllm/glm-5.3-uncensored
the build OpenClaw opens with, written as provider/model

Which build to start with

On each turn of an agent session the conversation and all tool output go back to the model, so the input rate is what you are really paying for. Where an entry omits a field, OpenClaw substitutes its own defaults: input: ["text"], reasoning: false, a 200,000-token context budget when none is declared, and its own output ceiling. The cost column below prices a single turn of 30,000 tokens in and 1,000 out from the catalog as of 2026-11-17. OpenClaw sends no prompt-cache hints to a custom provider, so budget at the full input rate.

BuildSingle turnSession of 40 turns
GLM-5.3 Uncensored$0.0093$0.37
GLM-5.3 Flash Uncensored$0.0035$0.14
DeepSeek V4.1 Flash Abliterated$0.03$1.09
DeepSeek V4 Pro Uncensored$0.03$1.24
GLM-5.3 Abliterated$0.07$2.79
Kimi K3.1 Pro Uncensored$0.04$1.63
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
Kimi K3.1 Pro Uncensoredkimi-k3.1-pro-uncensoredUncensored$1.164$5.82

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

If the agent’s job is mostly reviewing code for vulnerabilities, the coding guide compares the code builds and prices a full day on each. The AI pentesting page covers where an agent fits in an engagement.

Confirm it works

Prove the key and the endpoint from the shell before you blame OpenClaw. The -i flag shows the response headers, which carry a request id and, on a non-streamed reply, the charge in USD.

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

When something fails

  • ${PENTESTLLM_API_KEY} stays unresolved and the log warns about it: the variable is set in neither of the two places OpenClaw reads (a project-folder .env does not count). Export it, or add the line to ~/.openclaw/.env and save.
  • A ref like pentestllm/glm-5.3-flash-uncensored is rejected: that id has no models[] entry under the provider. Add one, even if it is only the id.
  • 401 invalid_api_key: bad or revoked key. Copy a fresh one from the console and verify which variable it ends up in.
  • 402 insufficient_balance: the balance cannot cover this call; add credit in the console. A 402 monthly_limit_reached instead means the key reached the monthly spend ceiling you gave it.
  • 404 model_not_found: the id is not on the models page. Check the part of the ref after the slash.
  • 429 rate_limited: the key is over its rate limit. Read retry-after on the response.
  • The Gateway will not come up after your edit: the file fails schema validation. OpenClaw rejects unknown keys, so recheck every field name, or let openclaw doctor --fix repair it.

Sources

Field names and defaults come from OpenClaw’s custom providers documentation, read 2026-11-06. Prices come from the live catalog when the page renders.

Questions

One models.providers.pentestllm entry in ~/.openclaw/openclaw.json: baseUrl https://api.pentestllm.ai/v1, api "openai-completions", apiKey "${PENTESTLLM_API_KEY}" and a models array. Then point agents.defaults.model.primary at pentestllm/<model-id>.

In the environment variable that apiKey names, PENTESTLLM_API_KEY here. OpenClaw checks the process environment first and ~/.openclaw/.env second. It skips provider keys in a working-directory .env, and the key is never written into openclaw.json.

Each model of a custom provider needs its own models[] entry with at least an id. agents.defaults.models only carries aliases and metadata; it registers nothing. Add the entry, save, and confirm with openclaw models list --provider pentestllm.

All of them. Each id on the models page serves /v1/chat/completions in OpenAI format under one shared key, so any id can go into the models array, spelled as the page spells it. See the models page.

You pay per token at the model’s listed price out of prepaid credit, with no subscription required. The table above prices a typical agent turn per build at the current rate. If a response reports cached input tokens, they are charged at that model’s discounted cache price where one exists.

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