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

# Codex Desktop 配置指南

> Codex 集成指南 - Ace Data Cloud

Codex Desktop 与 Codex CLI 共用 `~/.codex/config.toml`。

## 1. 获取 API Key

打开 [Ace Data Cloud 应用列表](https://platform.acedata.cloud/console/applications)，进入可用的应用并复制 API Key。

![获取 Ace Data Cloud API Key](https://cdn.acedata.cloud/dvc3cg.jpg)

## 2. 设置 API Key

macOS：

```bash theme={null}
launchctl setenv ACEDATACLOUD_API_KEY "你的 API Key"
```

Windows PowerShell：

```powershell theme={null}
setx ACEDATACLOUD_API_KEY "你的 API Key"
```

## 3. 配置 AceDataCloud

编辑 `~/.codex/config.toml`（Windows 为 `%USERPROFILE%\.codex\config.toml`），加入：

```toml theme={null}
model_provider = "acedatacloud"

[model_providers.acedatacloud]
name = "acedatacloud"
base_url = "https://api.acedata.cloud/v1"

[model_providers.acedatacloud.auth]
command = "sh"
args = ["-c", "echo $ACEDATACLOUD_API_KEY"]
```

Windows 将最后两行改为：

```toml theme={null}
command = "powershell"
args = ["-NoProfile", "-Command", "Write-Output $env:ACEDATACLOUD_API_KEY"]
```

无需填写 `model`；打开 Codex 后直接选择模型。

## 4. 重启并验证

完全退出并重新打开 Codex Desktop，新建本地任务并发送一条简单消息。Provider 应显示为 `acedatacloud`；真实调用可在 [使用历史](https://platform.acedata.cloud/console/usages) 查看。

如果配置未生效，确认修改的是当前用户的 `~/.codex/config.toml`，环境变量已设置，然后再次完全重启应用。云端任务或自动化运行在不同环境时，需要在对应环境单独配置 Key。


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