Guide

Use an uncensored model in Codex CLI

Codex CLI connects to unrestricted.sh through its OpenAI-compatible provider, with a few lines of config. You get Qwen3.8 27B Uncensored, a model for coding and chat with 262K context, at $1.00 per million input tokens.

Get an API key

Sign up, then add credit: API keys work after your first top-up of $5 or more. A first top-up of $10 or more adds $5 of bonus credit.

Connect Codex CLI

This adds the provider to ~/.codex/config.toml and makes Qwen3.8 27B Uncensored the default. Codex reads the key from UNRESTRICTED_API_KEY when it starts, so set it in the shell that runs Codex. Delete any model, model_provider or [model_providers.unrestricted] lines already in the file first. If the file already has a [...] table, move the model_provider and model lines the snippet adds above the first table. Checked against Codex CLI's docs.

sh
mkdir -p ~/.codex
cat >> ~/.codex/config.toml <<EOF

model_provider = "unrestricted"
model = "qwen3.8-27b-uncensored"
[model_providers.unrestricted]
name = "unrestricted.sh"
base_url = "https://api.unrestricted.sh/v1"
env_key = "UNRESTRICTED_API_KEY"
wire_api = "responses"
EOF
chmod 600 ~/.codex/config.toml

Pick the model

Run codex. The model line makes Qwen3.8 27B Uncensored the default; codex --model qwen3.8-27b-uncensored picks it for one session.

If something goes wrong

401 invalid_api_key
Missing or revoked API key.
402 insufficient_funds
Out of funds.
403 api_locked
Add funds once to unlock API keys.
429 concurrent_request_limit
Too many requests running on this account.

Every error the API returns is listed in the API reference.

What a session costs

Cached input: when your tool resends the start of a conversation, those tokens cost $0.10 per million instead of $1.00. Cached-input pricing applies to the API and coding tools; messages in the web chat pay the full input price.

A coding-agent turn with 60,000 tokens in, 55,000 of them cached, 1,500 out costs $0.015. The pricing page has every price and more examples.

Next