Codex CLI custom provider: an uncensored model in config.toml

Codex CLI on an uncensored model: the [model_providers] table in config.toml, a profile file per model, the /model menu trap, the cost of a run and the errors.

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

A custom model provider in Codex CLI is a table in ~/.codex/config.toml: an address, the variable holding the key and the Responses wire API. With that table in place, an uncensored build drives Codex, billed per token from a prepaid balance. OpenCode and Cline cover the same ids over Chat Completions.

What you need

  • Codex CLI installed.
  • A key from the console, exported in the shell you run Codex from.
  • A model id from the models page, spelled as the page spells it.

Three steps to a first reply

  1. Write the table into config.toml. Pick an id of your own for it, because openai, ollama and lmstudio are taken:
config.toml
1# ~/.codex/config.toml
2model = "glm-5.3-uncensored"
3model_provider = "unrestrictable"
4
5[model_providers.unrestrictable]
6name = "Unrestrictable"
7base_url = "https://api.unrestrictable.ai/v1"
8env_key = "UNRESTRICTABLE_API_KEY"
9wire_api = "responses"
  1. Make a key in the console, set it in the shell you will run Codex from, and launch:
shell
1export UNRESTRICTABLE_API_KEY="sk-unr-live-…"
2codex
  1. Type a prompt. Seconds later the console’s usage page lists the request with its token counts and its charge. A one-off run on a different id: codex --model glm-5.3-flash-uncensored.

To talk to the same models with nothing installed, open /chat in the browser.

Where the settings live

~/.codex/config.toml is the file Codex reads. A custom provider is one [model_providers.<id>] table inside it, holding a display name, a base URL, the name of the environment variable with the key, and the wire API. Codex talks Responses only; every build on the models page serves /v1/responses, so a single table reaches all of them. Profiles are separate files beside it, chosen with --profile.

Each key, explained

model_provider
unrestrictable
names the table to use; without it Codex uses openai
name
Unrestrictable
what Codex displays for the provider
base_url
https://api.unrestrictable.ai/v1
ending in /v1; Codex appends /responses itself
env_key
UNRESTRICTABLE_API_KEY
the variable holding the full sk-unr- key, which stays out of the file
wire_api
responses
the one value Codex takes, also the default, so the line may be omitted
model
glm-5.3-uncensored
an id from the models page, spelled exactly as listed

One profile file per model

A profile lives at ~/.codex/<name>.config.toml and holds only the keys that depart from config.toml. Launch with --profile <name> and Codex lays the file over the main one. Older guides put [profiles.<name>] tables in config.toml itself; the current reference describes separate files.

unr-flash.config.toml
1# ~/.codex/unr-flash.config.toml
2model_provider = "unrestrictable"
3model = "glm-5.3-flash-uncensored"
unr-pro.config.toml
1# ~/.codex/unr-pro.config.toml
2model_provider = "unrestrictable"
3model = "deepseek-v4-pro-uncensored"
shell
1codex --profile unr-flash
2codex exec --profile unr-flash "review this change"

One trap. While a custom provider is active, the /model menu offers Codex’s own 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). An id the models page does not carry then answers 404. Recover by setting model in the file again, and switch with --profile or --model rather than the menu.

Choosing the model

Input price dominates, because each turn sends the session and the tool output again. The table prices a single turn, 30,000 tokens in and 1,000 out, using the catalog on 2026-11-16. Where a model has a cached rate, a repeated prefix is charged as cached input.

ModelPer turnPer 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-16.

If the work is code, the uncensored coding AI guide sets the code builds side by side and prices a whole day on each.

Test it

Before Codex, prove the key and the Responses route with curl. -i shows the headers: x-uplink-request-id identifies the request, and on a non-streamed reply x-uplink-charge states the cost in USD.

shell
1curl -i https://api.unrestrictable.ai/v1/responses \
2 -H "Authorization: Bearer $UNRESTRICTABLE_API_KEY" \
3 -H "Content-Type: application/json" \
4 -d '{"model": "glm-5.3-uncensored", "input": "Reply with the single word ok."}'

When it fails

  • 401 invalid_api_key: the key is mistyped or revoked, or UNRESTRICTABLE_API_KEY was not set in the shell Codex started from. Export it and launch again.
  • 402 insufficient_balance: not enough balance for the call; add credit in the console. 402 monthly_limit_reached: the key has reached the monthly limit you gave it.
  • 404 model_not_found: the id is not on the models page, usually because the /model menu rewrote a profile. Correct the model line in the file.
  • 429 rate_limited: your key’s own rate limit; retry-after in the response says when to try again.
  • wire_api = "chat", copied from an older guide: Codex rejects it now. Use responses or drop the line.
  • A profile does nothing: it is still written as a [profiles.<name>] table inside config.toml. Move the keys to their own file, ~/.codex/<name>.config.toml.
  • Codex ignores the table: its id is a reserved one, or model_provider points at another id.

Where the facts come from

Key and value names are those of Codex’s Configuration Reference, read 2026-11-06. Every price on this page is the live catalog’s at render time.

Questions

A [model_providers.unrestrictable] table in ~/.codex/config.toml with name, base_url and env_key, plus model_provider = "unrestrictable" and a model id copied from the models page.

responses, the only value Codex supports and its default, so the line is optional. A chat setting from an older guide fails now. Every model on the models page serves /v1/responses here.

Through the environment variable that env_key names. Set UNRESTRICTABLE_API_KEY in the shell before launching Codex; config.toml never contains the key.

A profile file per setup at ~/.codex/<name>.config.toml, launched with --profile <name>; or --model for a single run. Leave the /model menu alone while a custom provider is active.

Tokens times the model’s price, from a prepaid balance, no subscription needed. The table on this page prices one agent-sized turn per build at today’s rate.

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.

Join on Telegram