Codex
The Codex CLI talks to models through the Responses API, which we serve statelessly at https://api.abliteratedllm.dev/v1. Add a custom model provider to your user config and Codex uses it for every session.
Placeholders:
$API_BASEishttps://api.abliteratedllm.dev/v1,$API_ORIGINishttps://api.abliteratedllm.dev, and$YOUR_KEYis your API key.
Configure ~/.codex/config.toml
model = "glm-5.3-flash-abliterated"
model_provider = "abliteratedllm"
model_reasoning_effort = "medium"
model_context_window = 262144
[model_providers.abliteratedllm]
name = "AbliteratedLLM"
base_url = "$API_BASE"
env_key = "ABLITERATEDLLM_API_KEY"
wire_api = "responses"
model_providerselects the provider defined in[model_providers.abliteratedllm]. The id is yours to choose, butopenai,ollama,lmstudio,amazon-bedrock,amazon-bedrock-runtimeandgcpare reserved for Codex's built-in providers.env_keynames the environment variable that holds your API key. Codex sends it as a Bearer token.wire_api = "responses"makes Codex call/v1/responses.model_reasoning_effortbecomesreasoning.efforton each request.model_context_windowtells Codex how much context the model has: itscontext_lengthfrom GET /v1/models, 262144 tokens for GLM-5.3 Flash.
The provider keys must be in your user-level ~/.codex/config.toml. Codex ignores model_provider and model_providers in a project's .codex/config.toml.
Set the key and run
Bash or Zsh:
export ABLITERATEDLLM_API_KEY="$YOUR_KEY"
codex
PowerShell:
$env:ABLITERATEDLLM_API_KEY = "$YOUR_KEY"
codex
To use another model from GET /v1/models, change model to its id and model_context_window to its context_length.
Good to know
- Stateless. Codex sends the whole conversation with each request, which is what our Responses endpoint requires. We force
storetofalse, and a request withprevious_response_idwould fail with 400stateless_only. See POST /v1/responses. - Prompt caching. Long Codex sessions resend the same prefix on every turn, so much of it is usually read from cache and billed at the cached-input price.
- Text only. Attaching images fails with 400
unsupported_content. - Trial accounts are limited to 4096 output tokens and 1 concurrent request, which is tight for agent work. See Rate limits and trial.
Verified against Codex docs on 2026-11-03: Advanced configuration, custom model providers (developers.openai.com/codex/config-advanced redirects there).