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

# Codex桌面版安装

> 安装 Codex Desktop，并使用 MomoAPI 配置 API Key、模型和本地配置文件

# Codex桌面版安装

Codex Desktop 是 OpenAI 推出的桌面端 AI 编程工具，适合用图形界面管理代码任务、查看修改结果，并在本地项目中运行 AI Agent。

本页适合第一次安装 Codex 桌面版的新手。你只需要完成三件事：安装软件、准备 MomoAPI Token、把 `auth.json` 和 `config.toml` 放到正确位置。

## 一、安装 Codex Desktop

### Windows

1. 打开 Microsoft Store 页面：[Codex Desktop Windows 版](https://apps.microsoft.com/detail/9plm9xgg6vks)。
2. 点击「获取」或「下载」。
3. 按提示完成安装。

如果 Microsoft Store 下载不方便，也可以使用站内安装包入口：[点击下载](https://momoapi.oss-cn-hongkong.aliyuncs.com/tools/Claude%20Setup.exe)

### macOS

1. 打开 App Store。
2. 搜索 `Codex`。
3. 安装 Codex Desktop。

## 二、切换中文界面

1. 打开 Codex Desktop。
2. 点击左上角 `File` -> `Settings`。
3. 进入 `General`。
4. 在 `Language for the app UI` 中选择 `Chinese (China)`。
5. 如果没有立即生效，请保持网络畅通并重启 Codex Desktop。

## 三、获取 MomoAPI Token

1. 打开 [MomoAPI 控制台](https://momoapi.top/console)。
2. 登录后进入「令牌管理」页面。
3. 创建或复制一个可用于 Codex 的 API Key，格式通常以 `sk-` 开头。

<Warning>
  API Key 只在创建时完整显示一次，请立即保存。不要公开分享，也不要提交到代码仓库。
</Warning>

如果你已经通过命令行配置过 Codex，并且 Codex Desktop 能正常使用，可以先不重复配置。

## 四、创建 Codex 配置目录

Codex Desktop 会读取用户目录下的 `.codex` 配置。

| 系统      | 配置目录                      |
| ------- | ------------------------- |
| Windows | `C:\Users\<你的用户名>\.codex` |
| macOS   | `/Users/<你的用户名>/.codex`   |

如果 `.codex` 目录不存在，请先手动创建。

在 `.codex` 目录中创建两个文件：

* `auth.json`
* `config.toml`

macOS 用户也可以在终端执行：

```bash theme={null}
mkdir -p ~/.codex
touch ~/.codex/auth.json
touch ~/.codex/config.toml
```

## 五、编辑 auth.json

将以下内容写入 `auth.json`，把 `sk-xxx` 替换为你的 MomoAPI Token：

```json theme={null}
{"OPENAI_API_KEY":"sk-xxx"}
```

<Warning>
  注意注意注意：`auth.json` 里只保留上面这一行内容。如果文件里还有其它字段、注释或旧配置，请全部删除，否则很容易出现 401 鉴权错误。
</Warning>

## 六、编辑 config.toml

将以下内容写入 `config.toml`：

```toml theme={null}
model_provider = "Momoapi"
model = "gpt-5.3-codex"
model_reasoning_effort = "high"
```
