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

# 在 Codex 中使用

> 将 AnyFast AI 模型与 Codex 集成——终端中的 AI 编码代理。

## 1. 安装 Codex

从 [Codex CLI GitHub](https://github.com/openai/codex) 安装 Codex。

## 2. 配置 AnyFast

在您的 shell 配置文件（`.bashrc`、`.zshrc` 或 `.profile`）中：

```bash theme={null}
export OPENAI_API_KEY="sk-your-api-key-here"
export OPENAI_BASE_URL="https://www.anyfast.ai/v1"
```

## 3. 应用配置

```bash theme={null}
# bash 用户
source ~/.bashrc

# zsh 用户
source ~/.zshrc
```

## 4. 启动 Codex

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

通过 CLI 指定模型：

```bash theme={null}
codex --model gpt-4o
```

完成以上操作，即可开始在 Codex 中使用 AnyFast。<script src="/feedback.js" />
