> ## Documentation Index
> Fetch the complete documentation index at: https://doc.xbhuiz.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Codex CLI

> Configure Codex CLI with XMAI as an OpenAI-compatible provider.

Codex uses OpenAI-compatible Responses traffic. Add XMAI as a custom provider
and set your API key in the shell that launches Codex.

## Configuration

In `~/.codex/config.toml`:

```toml theme={null} theme={null}
model = "gpt-5.5"
model_provider = "XMAI"

[model_providers.XMAI]
name = "XMAI"
wire_api = "responses"
env_key = "XMAI_API_KEY"
base_url = "https://xmapi.site/v1"
```

Then run:

```bash theme={null} theme={null}
export XMAI_API_KEY="your-XMAI-api-key"
codex
```

## Models

Use `gpt-5.5` or any supported OpenAI-compatible model from
[Models](/en/models).

<Note>
  `wire_api = "responses"` is the current Codex CLI shape for custom providers.
  If you keep an older `wire_api = "chat"` provider block, update it before
  testing XMAI.
</Note>
