Skip to content
DOCS / Codex

Codex

Configure Codex to use Fast Inference's OpenAI-compatible Responses API and restore the previous configuration safely.

The fast codex adapter routes Codex model traffic through Fast Inference's OpenAI-compatible Responses API. It adds a clearly marked provider block to Codex's configuration and saves the original file for one-command restoration.

Connect Codex

  1. Install and sign in

    bash
    npm install -g @inference/fast
    fast login

    The sign-in flow selects the first project in your personal workspace.

  2. Enable Codex routing

    bash
    fast codex on

    The adapter configures ~/.codex/config.toml. The default model is glm-5.2; choose another callable catalog ID with:

    bash
    fast codex on --model <catalog-id>
  3. Restart and verify

    bash
    fast codex status

    Restart Codex, open a new session, and send a small prompt. Verify the request in Usage.

What the adapter writes

Codex uses the Responses API rather than Chat Completions. The adapter adds an inference-net provider pointing to https://api.inference.net/v1, selects your model, and writes the machine key as the provider's bearer token. Managed blocks are labeled with inference-fast comments.

Change the model

Copy a callable ID from the model catalog, then reconnect:

bash
fast codex on --model <catalog-id>

An existing connection is not silently changed when the CLI is upgraded.

Restore your configuration

bash
fast codex off
fast codex status

The CLI restores the original TOML snapshot and removes its backup. Restart Codex after restoration.

Troubleshooting

SymptomCheck
Codex still uses its old providerRestart the process after on.
Status says offRun fast codex on from the same CODEX_HOME.
Gateway returns 401Run fast status, then reconnect Codex.
Model is rejectedChoose a callable ID from the model catalog.