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

# Codex CLI

> Connect Codeflare through a custom Responses provider.

## Prepare

Install Codex CLI, choose a model with the `responses` protocol, and copy the region's full `/v1` Base URL. These examples are instructions to copy; they do not edit your machine.

```bash theme={null}
npm install -g @openai/codex
export CODEFLARE_API_KEY="YOUR_CODEFLARE_KEY"
```

## User-level configuration

Merge this snippet into user-level `~/.codex/config.toml` without overwriting existing settings. Replace the model ID and regional URL.

```toml ~/.codex/config.toml theme={null}
model = "MODEL_ID"
model_provider = "codeflare"

[model_providers.codeflare]
name = "Codeflare"
base_url = "https://YOUR-REGION.example/v1"
env_key = "CODEFLARE_API_KEY"
wire_api = "responses"
request_max_retries = 0
stream_max_retries = 0
```

```bash theme={null}
codex
```

Disable automatic HTTP and stream retries to reduce replay after uncertain execution. Existing login and configuration can affect the active connection; verify the provider and model used at runtime.

## Check capabilities

Client tools, multimodal input, and reasoning require model and channel support. The `responses` protocol alone does not guarantee hosted tools or WebSockets. Check the URL, credentials, and model permissions, then see [Troubleshooting](/en/troubleshooting).

Configuration fields follow the [official Codex configuration reference](https://developers.openai.com/codex/config-reference).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.