title: "Codex 集成:提升您的 ChatGPT 编码工作流程" slug: "11369540-using-codex-with-your-chatgpt-plan" date: "2026-03-06" lang: "zh" source: "https://help.openai.com/en/articles/11369540-using-codex-with-your-chatgpt-plan" category: "开发工具" keywords:
- Codex
- ChatGPT
- AI 编码代理
- OpenAI
- 代码生成
- 代码审查
- IDE 集成
- 开发工具
- AI 开发
- GPT-5.1-Codex
- 企业级 AI
- 软件开发 meta_description: "了解如何将 OpenAI 的 Codex 集成到您的 ChatGPT 计划中,以加速编码、自动化代码审查并提升各种开发环境中的生产力。了解其功能、设置和用法。" image: "/images/articles/11369540-using-codex-with-your-chatgpt-plan.png" image_alt: "OpenAI Codex 标志与 ChatGPT 图标并列,象征着通过开发工具集成以增强 AI 编码功能。" quality_score: 94 content_score: 93 seo_score: 95 companies:
- OpenAI schema_type: "NewsArticle" reading_time: 8 faq:
- question: "Codex CLI 或 IDE 扩展使用哪个模型?" answer: "Codex 主要使用 GPT-5.1-Codex 模型系列,其中 'Max' 为默认模型,'Mini' 为可选模型。需要注意的是,Codex 中不提供 GPT-4o,并且像 GPT-4o 这样的旧模型无法作为旧版层级恢复或购买。用户可以通过模型选择器选择模型,包括旧版选项,或者使用 '-m' 标志或在 'config.toml' 文件中指定。ChatGPT 平台和 API 的模型可用性及定价与 Codex 是分开管理的,用户应查阅 Codex 文档以获取当前支持的模型和配置指南。这确保了开发人员能够利用最有效的模型完成编码任务,同时理解不同的模型生态系统。"
- question: "OpenAI 会利用我的 Codex 使用数据进行训练吗?" answer: "对于商业用户,包括拥有 ChatGPT Business、Enterprise 和 API 计划的用户,OpenAI 明确指出,其产品的输入和输出默认情况下不用于训练或改进其模型。但是,API 组织所有者可以选择加入并共享 API 数据,尽管此设置不适用于 Enterprise 和 Zero Data Retention 账户。相反,对于 Pro 和 Plus 用户,对话可能会用于模型改进,除非用户通过其 ChatGPT 数据控制主动禁用此功能。建议用户查阅 OpenAI 关于数据使用的文档,以了解其信息如何有助于模型性能,并相应地管理其隐私设置。"
- question: "我可以在 IDE 中运行 Codex 吗?" answer: "是的,开发人员可以将 Codex 直接集成并运行在他们的集成开发环境 (IDE) 中。专用的 Codex VS Code 扩展设计用于与大多数 VS Code 分支兼容,为代码生成、审查和任务委派提供流畅的体验。对于没有原生 Codex 扩展的其他 IDE 用户,Codex 命令行界面 (CLI) 提供了一个多功能的替代方案。CLI 可以在 IDE 的集成终端中执行,允许开发人员访问 Codex 功能并利用其 AI 编码能力,而无需切换环境。这种灵活性确保了广泛的开发设置都能受益于 Codex。"
- question: "Codex 应用程序需要单独的工作区权限吗?" answer: "不需要,Codex 应用程序在与所有其他 Codex 界面和功能相同的统一工作区控制下运行。这意味着,如果您已经为 Codex Local(涵盖通过 CLI 和 IDE 扩展的使用)和 Codex Cloud(规定团队成员是否可以从 Codex 应用程序和其他基于云的界面委派任务)建立了权限,这些权限将无缝应用于 Codex 应用程序。无需专门为该应用程序配置额外的、独立的权限。要全面了解如何设置和管理工作区权限,用户应查阅 Codex 的企业管理员指南,以确保所有部署界面的访问管理一致性。"
- question: "我如何访问 Codex 企业分析?" answer: "Codex 企业分析仅提供给已启用 Codex 作为其工具套件一部分的企业工作区。如果您的组织在企业工作区内运行并希望利用这些分析功能,首要步骤是确保您的组织已激活 Codex 云功能。这通常需要与您的工作区管理员进行沟通。一旦启用,详细的设置说明和用于检索分析数据的 API 访问点可以在 OpenAI 提供的综合 API 文档中找到。这确保了管理员可以监控与他们的企业级 Codex 部署相关的用法、性能和其他关键指标。"
- question: "我在哪里可以找到更多关于解决 Codex 应用程序问题的信息?" answer: "对于遇到问题或需要 Codex 应用程序帮助的用户,OpenAI 提供了专门的资源来协助故障排除。主要的参考点是 OpenAI 开发者网站上提供的综合平台指南,该指南专门针对 Codex 应用程序的故障排除。此指南包含详细信息、常见解决方案和诊断步骤,以帮助解决各种问题。如果平台指南未能解决特定或复杂问题,建议用户直接联系 OpenAI 的支持团队。这确保了可以获得专家帮助,以维持 Codex 应用程序在您的开发工作流程中的顺畅高效运行。"
# Codex 集成:革新您的 ChatGPT 驱动开发工作流程
在软件开发快速发展的背景下,AI 工具变得不可或缺。OpenAI 的 Codex 作为一款强大的 AI 编码代理脱颖而出,旨在简化和加速编码过程。Codex 与各种 ChatGPT 计划无缝集成,使开发人员能够以前所未有的效率编写、审查和部署代码。本文将深入探讨开发人员如何在其现有的 ChatGPT 订阅中利用 Codex,涵盖从初始设置到高级企业功能和使用注意事项的所有内容。
需要澄清的是,尽管 OpenAI 提供了一套先进的 AI 功能,但 Codex 专门专注于编码任务。图像和视频生成(Sora、ChatGPT Images、DALL·E)以及语音功能在独立的用量限制和重置周期下运行。如果您遇到与这些功能相关的横幅提示,请放心,这些限制不会影响您的 Codex 使用。
## 通过 OpenAI Codex 集成简化开发
Codex 不仅仅是一个代码生成器;它是一个智能 AI 编码代理,旨在作为您开发周期中的协作伙伴。无论您是独立开发人员还是大型企业团队的一员,Codex 都能帮助您导航存储库、编辑文件、执行命令和运行测试,显著提高生产力。它旨在深度集成到您的日常工作流程中,提供灵活的交互方法以适应不同的偏好和环境。
在有限时间内,Codex 可广泛使用,并包含在 ChatGPT Plus、Pro、Business 和 Enterprise/Edu 计划中。在此促销期间,即使是 ChatGPT Free 和 Go 用户也可以探索 Codex,而其他计划则可享受 2 倍的速率限制,最大限度地发挥其 AI 驱动的编码潜力。
## 释放 AI 力量:与 Codex 配对和委派任务
Codex 提供多种操作模式,允许开发人员选择如何与 AI 编码代理互动,以实现最佳生产力。
### 在本地开发环境中配对
您可以在您偏好的本地工具中直接与 Codex 配对。从简单的提示或详细的规范开始,Codex 可以智能地导航您的存储库以进行编辑、执行命令和运行测试。这种动手实践的集成可通过以下方式实现:
* **Codex CLI:** 用于直接交互的命令行界面。
* **Codex IDE 扩展:** 适用于 VSCode、Cursor 和 Windsurf 等流行环境,将 AI 辅助直接引入您的编辑器。开发人员越来越依赖扩展来实现“代理编码”工作流程,Codex 极大地促进了这一点,类似于 [Xcode 代理编码](/zh/xcode-agentic-coding) 等文章中探讨的功能。
* **Codex App:** 对于管理多个项目或寻求统一界面的用户,Codex 应用程序提供内置的工作树支持、技能、自动化和 Git 功能,无需在终端或 IDE 之间切换。该应用程序适用于 macOS 和 Windows。
### 将任务委派给云中的 Codex
对于更广泛或后台任务,Codex 可以在云中运行,在一个隔离的沙盒中运行您的存储库和环境。这使您能够专注于主要工作,同时 Codex 在后台处理任务,生成代码,您可以稍后审查、合并或拉取到本地进行进一步开发。这种云委派对于复杂操作或需要卸载计算任务时特别有用。
### 通过 Codex 自动化代码审查
Codex 最具影响力的功能之一是其自动化代码审查的能力。就像人类同事一样,Codex 可以直接在 GitHub 中分析您的拉取请求 (PR)。您可以灵活地为您的个人 PR 启用自动审查,或为您的整个团队在多个存储库中配置它,从而提高代码质量并加速审查过程。此功能与 [GitHub 代理工作流程](/zh/github-agentic-workflows) 的日益增长的趋势相符,其中 AI 协助开发生命周期的各个阶段。
## 将 Codex 与您的 ChatGPT 账户无缝集成
使用您现有的 ChatGPT 计划开始使用 Codex 非常简单,确保顺利过渡到 AI 辅助开发。
要将 Codex 与您的 Plus、Pro、Business、Edu 或 Enterprise 计划连接:
1. **确保拥有有效的 ChatGPT 订阅。** 如果您尚未订阅,可以通过 ChatGPT 账户设置轻松升级。
2. **启动您偏好的 Codex 客户端**(CLI、IDE 扩展、网页界面或桌面应用程序)。
3. **按照客户端的说明使用您的 ChatGPT 账户登录。**
* 对于 [Codex 网页界面](https://chatgpt.com/codex),您需要将您的 ChatGPT 账户连接到您的 GitHub 账户。
* 对于程序化控制,[Codex SDK](https://developers.openai.com/codex/sdk) 可用,并且还支持通过 Slack 请求 Codex 执行任务等集成。
**现有 API 密钥用户须知:** 如果您之前通过 API 密钥访问过 Codex CLI,请记住更新您的包管理器,然后运行 `codex logout`,接着运行 `codex`,以切换到基于订阅的访问并利用集成的 ChatGPT 计划。有关功能和用法的深入详情,综合的 [Codex 文档页面](https://developers.openai.com/codex/) 是一个宝贵的资源。
## Codex 的企业级部署和控制
对于大型组织,Codex 提供强大的功能,专为企业级部署、管理和合规性而设计,确保在企业环境中实现安全且可扩展的集成。
### 企业设置和基于角色的访问控制 (RBAC)
为企业工作区设置 Codex 涉及 [企业管理员指南](https://developers.openai.com/codex/enterprise) 中涵盖的详细配置。本指南提供了使您的工作区全面运行的综合路线图。此外,可以使用基于角色的访问控制 (RBAC) 精细调整对 Codex 的访问权限,允许管理员为特定用户角色授予适当的权限。有关建立 RBAC 的更多信息,请参阅专门的 [RBAC 指南](https://help.openai.com/en/articles/11750701-rbac)。
### 数据驻留和合规性 API
组织优先考虑数据治理,Codex 在设计时已考虑到这一点。对于委派到云端或通过网络使用的 Codex,活动日志可通过 [合规性 API](https://chatgpt.com/admin/api-reference#tag/Codex-Tasks) 获取。需要注意的是,本地环境(CLI 或 IDE 扩展)中的使用情况不会通过此 API 记录。Codex 确保符合严格的数据保留和驻留策略,这是 [企业隐私](/zh/enterprise-privacy) 考虑的关键方面。
## 了解 Codex 用量限制和优化性能
Codex 的实用性,像许多 AI 服务一样,受用量限制的影响,这些限制根据您的具体 ChatGPT 计划而异。
### 按计划划分的 Codex 用量限制
| 计划类型 (ChatGPT) | Codex 包含 | 速率限制 | 影响用量的因素 |
| :------------------------- | :---------------------------------------------- | :---------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 免费和 Go (限时) | 包含 | 标准 | 任务大小、代码复杂性、所需上下文、执行环境(本地 vs. 云)。 |
| Plus, Pro, Business, Edu, Enterprise | 包含 | **2 倍速率限制 (限时)** | 任务大小、代码复杂性、所需上下文、执行环境(本地 vs. 云)。较大的代码库或长时间运行的任务会显著消耗更多额度。 |
在有限的促销期间,Plus、Pro、Business 和 Enterprise/Edu 订阅者将受益于 2 倍的 Codex 速率限制。您可以在这些限制内发送的 Codex 消息数量并非固定不变,而是动态消耗的。诸如编码任务的大小和复杂性,以及任务是在本地还是在云中执行等因素,都会严重影响用量。例如,小型脚本或简单函数可能只会消耗您额度的一小部分,而处理较大的代码库、处理长时间运行的任务或需要 Codex 维护大量上下文的长时间会话将消耗更多。有关 Codex 限制和定价的全面细分,建议开发人员查阅 OpenAI 开发者网站上的 [定价页面](https://developers.openai.com/codex/pricing)。
通过了解这些动态并有效利用 Codex,开发人员可以最大限度地发挥这一强大 AI 编码代理的优势,真正提升其软件开发生命周期。
常见问题
Which model does the Codex CLI or IDE extension use?
Codex primarily utilizes the GPT-5.1-Codex model family, with 'Max' as the default and 'Mini' as an optional choice. It's crucial to note that GPT-4o is not available within Codex, and older models like GPT-4o cannot be restored or purchased as legacy tiers. Users can select models via the model picker, including legacy options, or specify them using the '-m' flag or in the 'config.toml' file. Model availability and pricing for the ChatGPT platform and the API are managed separately from Codex, and users should consult the Codex documentation for current supported models and configuration guidelines. This ensures developers can leverage the most effective models for their coding tasks while understanding the distinct model ecosystems.
Does OpenAI train on my Codex usage?
For business users, including those with ChatGPT Business, Enterprise, and API plans, OpenAI explicitly states that inputs and outputs from their products are not used by default to train or improve their models. However, API organization owners have the option to opt-in and share API data, though this setting is unavailable for Enterprise and Zero Data Retention accounts. Conversely, for Pro and Plus users, conversations may be utilized for model improvement unless the user actively disables this feature through their ChatGPT data controls. Users are encouraged to review OpenAI's documentation on data usage to understand how their information contributes to model performance and to manage their privacy settings accordingly.
Can I run Codex in my IDE?
Yes, developers can integrate and run Codex directly within their Integrated Development Environments. The dedicated Codex VS Code extension is designed for compatibility with most VS Code forks, offering a streamlined experience for code generation, review, and task delegation. For users of other IDEs that may not have a native Codex extension, the Codex Command Line Interface (CLI) provides a versatile alternative. The CLI can be executed within the IDE's integrated terminal, allowing developers to access Codex functionalities and leverage its AI coding capabilities without needing to switch environments. This flexibility ensures a wide range of development setups can benefit from Codex.
Are there separate workspace permissions needed for the Codex app?
No, the Codex app operates under the same unified workspace controls that govern all other Codex interfaces and functionalities. This means that if you have established permissions for Codex Local (which covers usage through the CLI and IDE extension) and Codex Cloud (which dictates whether team members can delegate tasks from the Codex app and other cloud-based interfaces), these permissions will apply seamlessly to the Codex app. There's no need to configure additional, distinct permissions specifically for the app. For a comprehensive understanding of setting up and managing workspace permissions, users should refer to the Enterprise Admin Guide for Codex, ensuring consistent access management across all deployment surfaces.
How can I access Codex Enterprise Analytics?
Access to Codex Enterprise Analytics is exclusively provided to Enterprise workspaces that have Codex enabled as part of their suite of tools. If your organization operates within an Enterprise workspace and wishes to leverage these analytics, the primary step is to ensure that Codex Cloud functionalities are activated for your organization. This typically requires liaison with your workspace administrator. Once enabled, detailed setup instructions and API access points for retrieving analytics data can be found within the comprehensive API documentation provided by OpenAI. This ensures administrators can monitor usage, performance, and other key metrics relevant to their enterprise-level deployment of Codex.
Where can I find more info for troubleshooting Codex app issues?
For users encountering issues or requiring assistance with the Codex app, OpenAI provides dedicated resources to aid in troubleshooting. The primary reference point is the comprehensive platform guide available on the OpenAI developer website, specifically tailored for the Codex app troubleshooting. This guide contains detailed information, common solutions, and diagnostic steps to help resolve various problems. Should the platform guide not address a specific or complex issue, users are encouraged to directly contact OpenAI's support team. This ensures that expert assistance is available to help maintain smooth and efficient operation of the Codex app within your development workflow.
保持更新
将最新AI新闻发送到您的收件箱。
