# Codex (https://inference.net/docs/integrations/codex)

`fast codex on` adds an `inference-net` provider to `~/.codex/config.toml`
(Responses API at `https://api.inference.net/v1`) and makes it the default.
The lines it manages are wrapped in `# inference-fast` comments.

## Connect Codex

<ConnectAgent integration="codex" />

## Connect with Inference Pass

If you have an Inference Pass subscription, use the `@inference/cli` (`inf`) CLI
for automatic plan detection, live allowance checks, self-healing config repair,
and local loopback proxy support:

```bash
npm install -g @inference/cli
inf auth login
inf pass on codex
inf pass status
```

Run `inf pass doctor` to repair drifted settings or rotated keys, `inf pass off codex`
to restore your previous configuration, or `inf pass proxy` for desktop apps over
`http://127.0.0.1:4141/v1`.

## Choose a model

Codex uses `kimi-k3-fast` unless you pick another ID from the
[model catalog](/models/):

```bash
fast codex on --model kimi-k3-fast
```

Run `on` again to change the default. Restart Codex afterward.

### Switch models in Codex

`on` writes every model from the [model catalog](/models/) into a Codex model
catalog (`~/.codex/inference-fast-models.json`), so `/model` lists them all
with the same system prompt and tools Codex uses for its own models. A
`/model` choice lasts for the session; run `fast codex on --model <id>` to
change the default. Codex must be installed when you run `on`, otherwise the
picker is not configured.

## Check status

```bash
fast codex status
```

Shows the connection, model, and config paths.

## Disconnect

```bash
fast codex off
```

Restores `config.toml` to the backup taken by `on`, so edits made after
connecting are lost. Restart Codex afterward.

## Troubleshooting

- **`fast codex status` says `off` but Codex is connected** — run
  `fast codex` commands with the same `CODEX_HOME` you used for `on`.
- **Requests return 401** — run `fast status`, then `fast codex on`.
- **Model rejected** — pick an ID from the [model catalog](/models/).