Skip to main content
To use Codex with abliteration.ai, register a custom model provider in ~/.codex/config.toml pointing at https://api.abliteration.ai/v1 with wire_api = "responses". The Codex CLI then runs unchanged — same workflow, routed through abliteration.

Install

Configure

Codex reads its configuration from ~/.codex/config.toml (user-level). Create it if it doesn’t exist:
Add the following to ~/.codex/config.toml:
env_key tells Codex which environment variable holds your API key — it does not contain the key itself. Export it separately:
Codex only reads keys from environment variables. Setting the key inside config.toml will not work. Use a tool like direnv or your shell rc file if you want it persisted across terminals.

Run

To make abliteration the default so plain codex picks it up, add this line at the top of ~/.codex/config.toml:
Then:

Per-project config

Codex also looks for .codex/config.toml inside trusted projects. Use this to override the model or profile for a single repo without touching the user-level config.

Config precedence

When the same setting is defined in multiple places, the order is:
  1. CLI flags (highest)
  2. Profile (--profile <name>)
  3. Project config (.codex/config.toml)
  4. User config (~/.codex/config.toml)
If Codex isn’t using your abliteration provider, check whether something higher in this chain is overriding it. Web search is enabled with web_search = "live" in the profile (already shown above). You’ll need to turn on web search in the console too. See the web search overview for full details.

Troubleshooting

Notes

  • Policy rules attached to your API key apply to every Codex turn.
  • For headless / CI runs, use codex exec with --approval-mode auto.
Last modified on May 3, 2026