Codex CLI takes a custom model provider in ~/.codex/config.toml: a base URL, the variable that holds the key and the Responses wire API. One table, and an uncensored build runs Codex from a prepaid balance, billed per token. For a Chat Completions client on the same ids, see OpenCode or Cline.
Where the settings are
Codex CLI reads ~/.codex/config.toml. A custom provider is a [model_providers.<id>] table there: a display name, a base URL, the environment variable that holds the key and the wire API. Codex speaks the Responses API only, and every build on the models page answers /v1/responses, so the one table covers them all. A profile is a separate file next to it, selected with --profile.
Steps
- Add the table to
config.toml. The idsopenai,ollamaandlmstudioare reserved, so the table needs its own name:
# ~/.codex/config.tomlmodel = "glm-5.3-uncensored"model_provider = "uncensoredllm" [model_providers.uncensoredllm]name = "UncensoredLLM"base_url = "https://api.uncensoredllm.ai/v1"env_key = "UNCENSOREDLLM_API_KEY"wire_api = "responses"- Create a key in the console, export it in the shell that runs Codex, then start it:
export UNCENSOREDLLM_API_KEY="sk-ullm-live-…"codex- Send a prompt. The request shows on the console’s usage page within seconds, with its tokens and its charge. For one run on another id:
codex --model glm-5.3-flash-uncensored.
What each setting does
- model_provider
- uncensoredllmselects the table by its id; openai is the default
- name
- UncensoredLLMthe display name Codex shows for the provider
- base_url
- https://api.uncensoredllm.ai/v1with the /v1; Codex adds /responses
- env_key
- UNCENSOREDLLM_API_KEYthe variable that holds the whole sk-ullm- key; it never goes in the file
- wire_api
- responsesthe only value Codex accepts, and the default, so the line is optional
- model
- glm-5.3-uncensoredany id from the models page, exactly as it is spelled there
A profile per model
A profile is a file named ~/.codex/<name>.config.toml holding only the keys that differ from config.toml. Start Codex with --profile <name> and it layers the file on top. Guides written for older Codex versions show [profiles.<name>] tables inside config.toml; the reference now documents the separate files.
# ~/.codex/ullm-flash.config.tomlmodel_provider = "uncensoredllm"model = "glm-5.3-flash-uncensored"# ~/.codex/ullm-pro.config.tomlmodel_provider = "uncensoredllm"model = "deepseek-v4-pro-uncensored"codex --profile ullm-flashcodex exec --profile ullm-flash "review this change"With a custom provider active, the /model menu lists Codex’s built-in models, not your provider’s, and picking one rewrites the active profile’s model line (openai/codex issue #35487, read 2026-11-06). An id that is not on the models page then returns 404. To undo it, set model back in the file; to switch without the menu, use --profile or --model.
Picking a model
Every agent turn resends the session and the tool output, so the input price carries most of the bill. The cost column is one turn of 30,000 tokens in and 1,000 out at the catalog prices on 2026-11-09; a session that repeats the same prefix bills the cached input tokens at the model’s cached rate where it has 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.68 |
| 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.20 | $6.00 |
For coding specifically, the uncensored coding AI guide compares the code builds and costs a full coding day on each.
Check it
Check the key and the Responses path outside Codex first. -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.
curl -i https://api.uncensoredllm.ai/v1/responses \ -H "Authorization: Bearer $UNCENSOREDLLM_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "glm-5.3-uncensored", "input": "Reply with the single word ok."}'Errors and fixes
401 invalid_api_key: the key is wrong or revoked, orUNCENSOREDLLM_API_KEYis empty in the shell that started Codex. Export it and start Codex again.402 insufficient_balance: the balance does not cover the request. Top up in the console.402 monthly_limit_reachedmeans the key hit the monthly spend limit you set on it.404 model_not_found: the model id is not on the models page, often after the/modelmenu rewrote a profile. Fix themodelline.429 rate_limited: the key hit its rate limit. The response carriesretry-after.wire_api = "chat"from an older guide: Codex no longer accepts it. Setresponsesor delete the line.- A profile has no effect: it is still a
[profiles.<name>]table inconfig.toml. Move its keys into~/.codex/<name>.config.toml. - The table is not used: its id is a reserved name, or
model_providernames a different id.
Sources
Keys and values follow Codex’s Configuration Reference, read 2026-11-06. Prices are from the live catalog at render.
Questions
Add a [model_providers.uncensoredllm] table to ~/.codex/config.toml with name, base_url and env_key, then set model_provider = "uncensoredllm" and a model id from the models page.
responses. Codex lists it as the only supported value and the default, so the line can be left out. Older guides that set chat no longer work. Every model on the models page answers /v1/responses here.
From the environment variable named in env_key. Export UNCENSOREDLLM_API_KEY in the shell that runs Codex; the key stays out of config.toml.
Keep one profile file per setup in ~/.codex/<name>.config.toml and start Codex with --profile <name>, or pass --model for one run. Avoid the /model menu while a custom provider is active.
Per token at the model’s price, from your prepaid balance, with no subscription. The table above costs one agent-sized turn on each build at the live price.
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.