场景 018 · Codex Use Case

升级 API 集成

用 Codex 将现有 OpenAI API 集成升级到推荐模型和 API 功能,并在发布前检查回归。

EvaluationEngineering
Upgrade your API integrationEvaluationEngineering

原文核对:2026-10-13 · 中文正文 · 英文提示词与演示

场景定位

用 Codex 将现有 OpenAI API 集成升级到推荐模型和 API 功能,并在发布前检查回归。

难度
中级
时间跨度
1 小时

适合用于

  • 从旧模型或旧 API 接口升级的团队。
  • 要求保持行为并明确验证的迁移项目。

相关工具

OpenAI Docs

修改实现前,获取当前模型、迁移和 API 指南。

OpenAI Docs ↗

起步提示词

英文原文 · 可复制后按实际材料修改

Use $openai-docs to upgrade this OpenAI integration to the latest recommended model and API features.

Specifically, look for the latest model and prompt guidance for this specific model.

Requirements:
- Start by inventorying the current models, endpoints, and tool assumptions in the repo.
- Identify the smallest migration plan that gets us onto the latest supported path.
- Preserve behavior unless a change is required by the new API or model.
- Update prompts using the latest model prompt guidance. 
- Call out any prompt, tool, or response-shape changes we need to review manually.

简介

OpenAI 建议随新模型和 API 功能发布升级集成,以获得改进。切换模型通常不只是改模型名称。

API 可能变化,例如 GPT-5.4 为 assistant 消息加入了集成时应包含的 phase 参数;模型行为也可能改变,需要调整已有提示词。

迁移时,既要修改必要代码,也要评估对实际工作流的影响。

使用 OpenAI Docs 技能

Model guidance 页面汇总各代模型的 API 功能、行为、迁移和提示词指南。

OpenAI Docs 技能也提供具体迁移参考;当前升级目标应以 Model guidance 页面为准。

Codex 默认附带 OpenAI Docs 技能。使用 OpenAI API 开发时,在提示词中提及它,以获取最新文档和指导。

建立可靠的评测流程

Codex 能根据最新指南自动更新提示词,但还需要自动验证集成是否按预期工作。

建立每次修改集成都能运行的评测流程,检查行为是否回归。

链接的 cookbook 指南详细介绍如何用 Evals API 实现。

展开英文原文对照

Use Codex to update your existing OpenAI API integration to the latest recommended models and API features, while checking for regressions before you ship.

Introduction

As we release new models and API features, we recommend upgrading your integration to benefit from the latest improvements. Changing from one model to another is often not as simple as just updating the model name.

There might be changes to the API–for example, for the GPT-5.4 model, we added a new phase parameter to the assistant message that is important to include in your integration–but most importantly, model behavior can be different and require changes to your existing prompts.

When migrating to a new model, you should make sure to not only make the necessary code changes, but also evaluate the impact on your workflows.

Leverage the OpenAI Docs skill

The Model guidance page combines API feature, model behavior, migration, and prompting guidance for each model generation.

The OpenAI Docs skill also includes specific guidance as a concrete migration reference. For the current upgrade target, use the Model guidance page.

Codex now automatically comes with the OpenAI Docs skill, so make sure to mention it in your prompt to access all the latest documentation and guidance when building with the OpenAI API.

Build a robust evals pipeline

Codex can automatically update your prompts based on the latest prompt guidance, but you should have a way to automate verifying your integration is working as expected.

Make sure to build an evals pipeline that you can run every time you make changes to your integration, to verify there is no regression in behavior.

This cookbook guide covers in detail how to do this using our Evals API.