> ## 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

> 通过 Responses 自定义 Provider 连接 Codeflare。

## 准备

安装 Codex CLI，确认模型支持 `responses` 协议，并复制区域的完整 `/v1` Base URL。以下示例仅供阅读与复制，不会修改本机配置。

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

## 用户级配置

将示例合并到用户级 `~/.codex/config.toml`；不要覆盖已有配置。替换模型 ID 与区域地址。

```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
```

关闭 HTTP 和流式中断自动重试，可减少不确定执行后重放的风险。既有登录或配置可能影响实际连接，请检查运行时使用的 Provider 与模型。

## 能力检查

客户端工具调用、多模态和推理需要模型及渠道支持。托管工具、WebSocket 等能力不能仅凭 `responses` 协议推定可用。出现连接错误时核对地址、密钥与模型权限，查看[故障排查](/zh/troubleshooting)。

配置字段依据 [Codex 官方配置参考](https://developers.openai.com/codex/config-reference)。


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