---
title: "Codex CLI custom provider: uncensored model setup"
canonical: https://uncensoredllm.ai/guides/codex-cli
generated: 2026-11-09T16:02:06.084Z
source: https://uncensoredllm.ai/guides/codex-cli
base_url: https://api.uncensoredllm.ai/v1
---

# Codex CLI with an uncensored model

One [model_providers] table in ~/.codex/config.toml: base_url, env_key and wire_api responses, with an uncensored model id. A profile file per model, the /model menu pitfall, the cost of a task and the errors.

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

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](https://uncensoredllm.ai/guides/opencode) or [Cline](https://uncensoredllm.ai/guides/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

1. Add the table to `config.toml`. The ids `openai`, `ollama` and `lmstudio` are reserved, so the table needs its own name:

```
# ~/.codex/config.toml
model = "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"
```

1. Create a key in the [console](https://app.uncensoredllm.ai/console), export it in the shell that runs Codex, then start it:

```bash
export UNCENSOREDLLM_API_KEY="sk-ullm-live-…"
codex
```

1. 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: uncensoredllm selects the table by its id; openai is the default
- name: UncensoredLLM the display name Codex shows for the provider
- base_url: https://api.uncensoredllm.ai/v1 with the /v1; Codex adds /responses
- env_key: UNCENSOREDLLM_API_KEY the variable that holds the whole sk-ullm- key; it never goes in the file
- wire_api: responses the only value Codex accepts, and the default, so the line is optional
- model: glm-5.3-uncensored any 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.toml
model_provider = "uncensoredllm"
model = "glm-5.3-flash-uncensored"
```

```
# ~/.codex/ullm-pro.config.toml
model_provider = "uncensoredllm"
model = "deepseek-v4-pro-uncensored"
```

```bash
codex --profile ullm-flash
codex 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](https://github.com/openai/codex/issues/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](https://uncensoredllm.ai/models/glm-5.3-uncensored) | $0.0093 | $0.37 |
| [GLM-5.3 Flash Uncensored](https://uncensoredllm.ai/models/glm-5.3-flash-uncensored) | $0.0035 | $0.14 |
| [DeepSeek V4.1 Flash Abliterated](https://uncensoredllm.ai/models/deepseek-v4.1-flash-abliterated) | $0.03 | $1.09 |
| [DeepSeek V4 Pro Uncensored](https://uncensoredllm.ai/models/deepseek-v4-pro-uncensored) | $0.03 | $1.24 |
| [GLM-5.3 Abliterated](https://uncensoredllm.ai/models/glm-5.3-abliterated) | $0.07 | $2.79 |
| [Kimi K3.1 Pro Uncensored](https://uncensoredllm.ai/models/kimi-k3.1-pro-uncensored) | $0.04 | $1.68 |

| Model | Build | Input $/M | Output $/M |
| --- | --- | --- | --- |
| [GLM-5.3 Uncensored](https://uncensoredllm.ai/models/glm-5.3-uncensored) glm-5.3-uncensored | Uncensored | $0.282 | $0.846 |
| [GLM-5.3 Flash Uncensored](https://uncensoredllm.ai/models/glm-5.3-flash-uncensored) glm-5.3-flash-uncensored | Uncensored | $0.1053 | $0.3685 |
| [DeepSeek V4.1 Flash Abliterated](https://uncensoredllm.ai/models/deepseek-v4.1-flash-abliterated) deepseek-v4.1-flash-abliterated | Abliterated | $0.8488 | $1.6975 |
| [DeepSeek V4 Pro Uncensored](https://uncensoredllm.ai/models/deepseek-v4-pro-uncensored) deepseek-v4-pro-uncensored | Uncensored | $0.97 | $1.94 |
| [GLM-5.3 Abliterated](https://uncensoredllm.ai/models/glm-5.3-abliterated) glm-5.3-abliterated | Abliterated | $2.1825 | $4.365 |
| [Kimi K3.1 Pro Uncensored](https://uncensoredllm.ai/models/kimi-k3.1-pro-uncensored) kimi-k3.1-pro-uncensored | Uncensored | $1.20 | $6.00 |

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

For coding specifically, [the uncensored coding AI guide](https://uncensoredllm.ai/guides/uncensored-coding-ai) 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.

```bash
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, or `UNCENSOREDLLM_API_KEY` is 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_reached` means 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 `/model` menu rewrote a profile. Fix the `model` line.
- `429 rate_limited`: the key hit its rate limit. The response carries `retry-after`.
- `wire_api = "chat"` from an older guide: Codex no longer accepts it. Set `responses` or delete the line.
- A profile has no effect: it is still a `[profiles.<name>]` table in `config.toml`. Move its keys into `~/.codex/<name>.config.toml`.
- The table is not used: its id is a reserved name, or `model_provider` names a different id.

## Sources

Keys and values follow Codex’s [Configuration Reference](https://learn.chatgpt.com/docs/config-file/config-reference), read 2026-11-06. Prices are from the live catalog at render.

## Questions

### How do I add a custom provider to Codex CLI?

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.

### Which wire_api should a Codex custom provider use?

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.

### Where does Codex read the API key for a custom provider?

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.

### How do I switch models in Codex CLI?

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.

### What does a Codex task cost on this key?

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](https://uncensoredllm.ai/models) with its live price per million tokens. [Per-token pricing](https://uncensoredllm.ai/pricing) sets the whole catalog side by side, and the [family directory](https://uncensoredllm.ai/uncensored) groups the builds by base model.

[Get a key](https://app.uncensoredllm.ai/console) Prepaid 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.
