# 下载与安装

## 装哪个

| 你想 | 装这个 |
| --- | --- |
| 聊天、写东西，也用 Codex 写代码 | **ChatGPT 桌面版**，自带 Codex，大多数人选这个 |
| 不想装软件 | 网页版，打开 [chatgpt.com](https://chatgpt.com) 就能用 |
| 在手机上用 | ChatGPT 手机 App |
| 在 VS Code、Cursor 里写代码 | Codex 编辑器插件 |
| 习惯在终端里输命令 | Codex 命令行版 |

只用 2api 余额的：2api 的 Key 是给 Codex 写代码用的，ChatGPT 聊天还是要 ChatGPT 账号。装好 Codex 后，用 [magpie](https://docs.2api.dev/magpie/) 一键配置 2api。

## 桌面版

桌面版里同时有 ChatGPT 和 Codex，在左上角的下拉菜单里切换。

打开 [chatgpt.com/download](https://chatgpt.com/download/)，下载 macOS 版，把 ChatGPT 拖进「应用程序」。也可以直接下载：[Apple 芯片版](https://persistent.oaistatic.com/codex-app-prod/Codex.dmg)、[Intel 版](https://persistent.oaistatic.com/codex-app-prod/Codex-latest-x64.dmg)。
  在 Microsoft Store 安装 [ChatGPT](https://apps.microsoft.com/detail/9plm9xgg6vks)，或者在 PowerShell 里运行：

  ```powershell
  winget install --id 9PLM9XGG6VKS -s msstore
  ```

  商店里还有一个「ChatGPT Classic」，那是旧版，没有 Codex。推荐 Windows 11；Windows 10 要 1809 或更新的版本。
  Linux 版还在预览阶段，支持 Ubuntu 24.04 / 26.04、Debian 13、Fedora 43 / 44 和 Arch Linux，x64 和 ARM64 都有。先运行 `uname -m` 看处理器架构：输出 `x86_64` 是 x64，输出 `aarch64` 或 `arm64` 是 ARM64。

  Ubuntu / Debian 下载 [x64 的 .deb](https://persistent.oaistatic.com/codex-app-prod/linux/deb/latest/chatgpt_amd64.deb) 或 [ARM64 的 .deb](https://persistent.oaistatic.com/codex-app-prod/linux/deb/latest/chatgpt_arm64.deb)，然后：

  ```bash
  cd ~/Downloads
  sudo apt install ./chatgpt_amd64.deb
  ```

  Fedora 下载 [x64 的 .rpm](https://persistent.oaistatic.com/codex-app-prod/linux/rpm/latest/chatgpt.x86_64.rpm) 或 [ARM64 的 .rpm](https://persistent.oaistatic.com/codex-app-prod/linux/rpm/latest/chatgpt.aarch64.rpm)，然后：

  ```bash
  cd ~/Downloads
  sudo dnf install ./chatgpt.x86_64.rpm
  ```

  ARM64 把文件名换成你下载的那个。Arch Linux 和更多细节见官方的 [Linux 安装说明](https://learn.chatgpt.com/docs/linux/linux-app)。
  **确认装好**：打开 ChatGPT，点「Continue to sign in」登录（见[登录](https://docs.2api.dev/guides/login/)），然后在左上角的下拉菜单里选「Codex」，能看到 Codex 的新对话页面就行了。以前装过 Codex 桌面版的，更新后会变成 ChatGPT 桌面版，打开后再切到 Codex。

## 网页版和手机

- **网页版**：打开 [chatgpt.com](https://chatgpt.com)，电脑和手机的浏览器都可以。Codex 在 [chatgpt.com/codex](https://chatgpt.com/codex/)。
- **iPhone / iPad**：App Store 里的「ChatGPT」，开发者是 OpenAI OpCo, LLC，需要 iOS 18 或更新的版本。中国大陆、香港和澳门的 App Store 搜不到，可以先用网页版：在 Safari 里打开 chatgpt.com，点「分享」→「添加到主屏幕」。
- **Android**：Google Play 里的 [ChatGPT](https://play.google.com/store/apps/details?id=com.openai.chatgpt)，开发者是 OpenAI，需要 Android 7.1 或更新的版本，并且要有 Google Play 服务。OpenAI 没有在其他渠道提供安装包，第三方网站上的 APK 可能是仿冒的。

## 编辑器插件（VS Code、Cursor）

1. 在编辑器的扩展商店搜索 **Codex**，认准发布者是 OpenAI、扩展 ID 是 `openai.chatgpt` 的那个，名字相近的仿冒插件不少。也可以直接打开 [VS Code 扩展页](https://marketplace.visualstudio.com/items?itemName=openai.chatgpt)。VS Code、Cursor、Windsurf 都用这个插件。

2. 装好后点侧边栏的 Codex 图标。找不到图标就按 `Ctrl+Shift+P`（macOS 是 `Cmd+Shift+P`）打开命令面板，运行 **Codex: Open Codex Sidebar**。Cursor 的活动栏是横排的，新图标可能藏在「更多」里，拖出来固定住。

3. 登录：用 ChatGPT 订阅的，点「Sign in with ChatGPT」；用 2api 余额的，在 [magpie](https://docs.2api.dev/magpie/) 里给 Codex 打开「接入」，插件会用上同一份设置。

4. 打开一个项目，发一句「介绍一下这个项目」试试，能正常回复就装好了。

JetBrains 系列在 AI Chat 里选 Codex；Xcode 在编码助手里新建对话时选 Codex。

:::caution[Windows 上插件装好了却一直没反应]
可能缺少 C++ 组件。安装 Visual Studio Build Tools（C++ 工作负载）和 Visual C++ 运行库（x64），然后完全退出编辑器再打开：

```powershell
winget install --id Microsoft.VisualStudio.2022.BuildTools -e
```
:::

## 命令行版

习惯在终端里输命令的才需要装，不用终端的跳过这一节。在终端里运行（Windows 用 PowerShell，不要用 CMD）：

```bash
  curl -fsSL https://chatgpt.com/codex/install.sh | sh
  ```
  ```powershell
  powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"
  ```
  ```bash
  curl -fsSL https://chatgpt.com/codex/install.sh | sh
  ```

  Codex 在 Linux 上用 bubblewrap 做沙箱，没装的话先装上：Ubuntu / Debian 运行 `sudo apt install bubblewrap`，Fedora 运行 `sudo dnf install bubblewrap`。
  装好后关掉终端，再开一个新的，运行 `codex --version`，能看到版本号就装好了。之后用 `codex update` 更新。

装不上或者提示找不到命令，见[常见问题的命令行版部分](https://docs.2api.dev/faq/chatgpt/#命令行版)。Windows 上的 WSL2、沙箱、中文乱码等设置见 [Windows 上用 Codex](https://docs.2api.dev/faq/codex-windows/)。

## 地区说明

ChatGPT 只在 OpenAI 支持的国家和地区提供服务，名单见 OpenAI 帮助中心的 [Supported countries and territories](https://help.openai.com/en/articles/7947663-chatgpt-supported-countries)。按 OpenAI 的说明，在不支持的地区使用可能导致账号被限制或停用。

## 下一步

- 登录：[登录](https://docs.2api.dev/guides/login/)
- 用 2api 余额：[用 magpie 一键配置所有 Agent](https://docs.2api.dev/magpie/)
- 开始用：[上手使用](https://docs.2api.dev/guides/usage/)

---

本页按 OpenAI 官方文档整理，核对于 2026 年 10 月。OpenAI 更新很频繁，按钮名称和菜单位置可能略有出入，以你看到的界面为准。