Quickstart: Codex
Codex reads extra model providers from its config file. Add this one and set the key in your shell.
~/.codex/config.toml
model = "glm-5.3-flash-uncensored"
model_provider = "uncensored-opencode"
[model_providers.uncensored-opencode]
name = "Uncensored Opencode"
base_url = "https://uncensoredopencode.com/v1"
env_key = "UNCENSORED_OPENCODE_API_KEY"
wire_api = "chat"What to know
env_keynames the variable Codex reads the key from, so the key is never in the file.wire_api = "chat"uses chat completions. The API also serves/v1/responseswith function tools; see Formats for what that route maps.- To change model, change the
modelline to any id on Models.
Run it
shell
export UNCENSORED_OPENCODE_API_KEY="sk-nc-..."
codex "Run the tests and fix the first failure"If it does not start
- A 401 on the first request means Codex found no key. The variable has to be set in the same shell that starts Codex, under the exact name in
env_key. - A 400 that lists model ids means the
modelline has a typo. The message names every id the API accepts. - A 402 means the account, or the key's cap, cannot cover the request. The message says which and by how much.
- If Codex sits waiting, the model is reasoning. The stream stays open while it does.