If Codex refuses to look at the exploit you were hired to validate, change the model under it. It accepts a custom provider in ~/.codex/config.toml: a base URL, the variable that carries your key, and the Responses wire API. One table later it runs a security-tuned or uncensored build from prepaid credit, billed per token. Prefer a Chat Completions client on the same ids? See OpenCode or Cline.
What you need
- Codex CLI installed and
codexon your PATH. - A key from the console, with some prepaid credit on it.
- A model id from the models page. The builds tagged security are tuned for this work; auto/security chooses one per request.
The one file Codex reads
Everything lives in ~/.codex/config.toml. A custom provider is one [model_providers.<id>] table in that file: a label, the base URL, the name of the variable holding your key, and the wire API. Codex talks the Responses API and nothing else; every id on the models page answers /v1/responses here, so a single table serves the whole catalog. Profiles are separate files beside it, picked with --profile.
Shortest path to a first reply
- Write the table into
config.toml. Pick a provider id of your own;openai,ollamaandlmstudioare taken:
# ~/.codex/config.tomlmodel = "glm-5.3-uncensored"model_provider = "pentestllm" [model_providers.pentestllm]name = "PentestLLM"base_url = "https://api.pentestllm.ai/v1"env_key = "PENTESTLLM_API_KEY"wire_api = "responses"- Make a key in the console, export it in the shell you will run Codex from, and launch:
export PENTESTLLM_API_KEY="sk-ptl-live-…"codex- Give it a task: a severity-ranked summary of a scan file from an engagement you are on, say. The request reaches the console’s usage page within seconds, with token counts and charge. To run once on a different id:
codex --model glm-5.3-flash-uncensored.
Want to test the model before touching a config file? The home page offers a few free demo turns, and the playground runs any id on a key.
The settings, one by one
- model_provider
- pentestllmnames the table to use; without it Codex falls back to openai
- name
- PentestLLMthe label Codex prints for this provider
- base_url
- https://api.pentestllm.ai/v1ends in /v1; Codex appends /responses on its own
- env_key
- PENTESTLLM_API_KEYthe variable holding the full sk-ptl- key, so the key itself stays out of the file
- wire_api
- responsesthe sole accepted value and the default; you may omit the line
- model
- glm-5.3-uncensoredan id copied from the models page, spelled exactly as shown
One profile file per build
A profile is ~/.codex/<name>.config.toml, holding just the keys that differ from the main file. Launch with --profile <name> and Codex merges it over config.toml. Older write-ups put [profiles.<name>] tables inside config.toml; the current reference documents separate files instead.
# ~/.codex/ptl-flash.config.tomlmodel_provider = "pentestllm"model = "glm-5.3-flash-uncensored"# ~/.codex/ptl-pro.config.tomlmodel_provider = "pentestllm"model = "deepseek-v4-pro-uncensored"codex --profile ptl-flashcodex exec --profile ptl-flash "review poc.py for the CVE it claims to exploit and list the preconditions"One trap. While a custom provider is active, the /model menu still shows Codex’s built-in models rather than yours, and choosing one overwrites the model line of the active profile (openai/codex issue #35487, read 2026-11-06). The next request then asks this API for an id it does not have and gets a 404. Recover by setting model back in the file. Switch builds with --profile or --model instead of the menu.
Which build, and what a session costs
Each agent turn resends the whole session plus every tool result, so input tokens dominate the bill. The cost column prices one turn of 30,000 tokens in and 1,000 out at the catalog prices on 2026-11-17. When a session repeats a prefix, the cached input tokens bill at the build’s cached rate where it publishes one.
| Model | One turn | 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 |
| GLM-5.3 Uncensored | Uncensored | $0.282 | $0.846 |
| GLM-5.3 Flash Uncensored | Uncensored | $0.1053 | $0.3685 |
| DeepSeek V4.1 Flash Abliterated | Abliterated | $0.8488 | $1.6975 |
| DeepSeek V4 Pro Uncensored | Uncensored | $0.97 | $1.94 |
| GLM-5.3 Abliterated | Abliterated | $2.1825 | $4.365 |
| Kimi K3.1 Pro Uncensored | Uncensored | $1.164 | $5.82 |
For code-heavy work such as reviewing a target’s source for bugs, the uncensored coding AI guide ranks the code builds and prices a full day on each.
Prove the key outside Codex
Before blaming the config, hit the Responses path with curl. -i shows the headers, which carry a request id and, when the answer is not streamed, the charge in USD.
curl -i https://api.pentestllm.ai/v1/responses \ -H "Authorization: Bearer $PENTESTLLM_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "glm-5.3-uncensored", "input": "Reply with the single word ok."}'When it breaks
401 invalid_api_key: the key is bad or revoked, orPENTESTLLM_API_KEYwas empty in the shell where Codex started. Export it and relaunch.402 insufficient_balance: credit ran out; add some in the console.402 monthly_limit_reached: you hit the monthly cap you set on the key.404 model_not_found: the id is not on the models page, usually because the/modelmenu rewrote a profile. Correct themodelline.429 rate_limited: the key is over its rate limit. Wait for theretry-aftervalue in the response.wire_api = "chat"copied from an old guide: Codex rejects it now. Useresponsesor remove the line.- The profile does nothing: it is still written as a
[profiles.<name>]table inconfig.toml. Move those keys to~/.codex/<name>.config.toml. - Codex ignores the table: the id collides with a reserved name, or
model_providerpoints at another id.
Where this comes from
Every key and value above matches Codex’s Configuration Reference as read on 2026-11-06. Prices come from the live catalog when the page renders.
Questions
One [model_providers.pentestllm] table carrying name, base_url and env_key, plus model_provider = "pentestllm" and a model line with an id from the models page.
responses. It is the only value Codex supports and also the default, so the line is optional. Setting chat, as some older guides do, fails now. Every id on the models page answers /v1/responses on this API.
Through the environment variable that env_key names. Export PENTESTLLM_API_KEY in the shell before starting Codex; config.toml never holds the key.
One profile file per setup at ~/.codex/<name>.config.toml, started with --profile <name>; or --model for a single run. Stay out of the /model menu while a custom provider is selected.
Per token at the build’s catalog price, drawn from prepaid credit, with no subscription required. The table on this page prices one agent-sized turn and a longer session on each build.
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.