Codex

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_BASE is https://api.abliteratedllm.dev/v1, $API_ORIGIN is https://api.abliteratedllm.dev, and $YOUR_KEY is 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_provider selects the provider defined in [model_providers.abliteratedllm]. The id is yours to choose, but openai, ollama, lmstudio, amazon-bedrock, amazon-bedrock-runtime and gcp are reserved for Codex's built-in providers.
  • env_key names 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_effort becomes reasoning.effort on each request.
  • model_context_window tells Codex how much context the model has: its context_length from 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 store to false, and a request with previous_response_id would fail with 400 stateless_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).