- 本文对应的版本:
openai(Python)3.26.1、openai(Node)7.30.1、openai-agents(Python)0.23.1、@openai/agents(JS/TS)0.19.0。以上均为 2026-10-08 在 PyPI、npm 和 GitHub 上看到的最新版本。 - Agents API 目前处于 beta,Agents SDK 仍是 0.x。按照官方的版本策略,0.Y.Z 中的 Y 每增加一次,都可能带来破坏性变更1。
- 资料截至 2026-10-09。本文不会随官方更新而同步,动手前请先查看:OpenAI API 文档 · openai-python CHANGELOG · openai-agents-python Releases
- OpenAI 面向开发者的产品可以分成四层:模型 API → 客户端 SDK → Agents SDK(开源,运行在你这边)→ Agents API(托管的 Codex harness,beta)。
- 2026 年最重要的三个变化:Assistants API 于 8 月 26 日下线、Agents API 在 9 月 10 日公测、GPT-6 系列模型发布。
- 一句话选型:新项目从 Responses API 起步;需要框架就用 Agents SDK;希望厂商托管运行就用 Agents API。
1. 产品地图#
| 产品 | 是什么 | 运行在哪 | 状态 | 本专题笔记 |
|---|---|---|---|---|
| Responses API | 主力 API 原语。内置 web search、file search、computer use、code interpreter、远程 MCP 等工具 | OpenAI 服务端 | GA,新项目推荐使用2 | 2.2 OpenAI 客户端 SDK 与 Responses API |
| Chat Completions API | 上一代标准接口,官方称会“无限期支持” | OpenAI 服务端 | 继续支持3 | 2.2 中做对比 |
| Conversations API | 持久化的会话对象,配合 Responses 使用 | OpenAI 服务端 | GA4 | 2.2 |
| Assistants API | 旧的有状态 Agent API | — | 2026-08-26 已下线5 | 2.2 中的迁移对照 |
| 客户端 SDK | 官方提供 Python、JavaScript/TypeScript、.NET、Java、Go、Ruby 版本,另有 CLI | 你的进程 | Java 和 Go 版本标注为 beta6 | 2.2 |
| Agents SDK | 开源的 agent 运行时:Agent、Runner、handoffs、guardrails、sessions、tracing、Sandbox agents 等 | 你的进程 | 0.x7 | 2.3 OpenAI Agents SDK |
| Agents API | 托管的 Codex harness,核心概念是 agent、environment、session、events | OpenAI 托管 | beta,2026-09-10 加入 SDK8 | 2.4 OpenAI Agents API |
| Codex 开发者工具 | Codex CLI、Codex SDK(用代码控制本地 Codex agent)、App Server | 你的机器或 OpenAI | 见官方文档9 | 本专题不展开 |
| AgentKit:Agent Builder / ChatKit | 可视化编排 agent 工作流;可嵌入的聊天界面 | OpenAI 平台 | 2025-10-06 发布10 | 本专题不展开 |
| Realtime / GPT-Live | 低延迟的实时语音交互 | OpenAI 服务端 | 见官方文档11 | 本专题不展开 |
官方文档里已经有一篇 Migrate from Agent Builder,给出两条迁移路径:把工作流导出成 Agents SDK 代码自己运行,或者在 ChatGPT 里重建为 Workspace Agent12。这说明以代码方式构建 agent 的主线是 Agents SDK 和 Agents API。
2. 演进时间线#
时间线出处:Responses API 与 Agents SDK 发布13;Agents SDK 是 Swarm 的生产级升级版7;Conversations 支持14;Assistants 下线公告15;AgentKit10;Assistants 正式下线5;Agents API816。
这条线的脉络:
- Assistants:由服务端负责循环和状态,是一个比较“黑盒”的方案。
- Responses 加 Agents SDK:基础 API 本身变得更具备 agent 能力,同时把循环交给你这边一个开源、透明的 SDK。
- Agents API:再把“托管运行”作为一个独立的选项提供出来,而且托管的就是 OpenAI 自己在 Codex 中使用的 harness17。
3. Responses、Agents SDK、Agents API 怎么选#
官方给出了三者的对比表18,以下是译文:
| Agents API | Agents SDK | Responses API | |
|---|---|---|---|
| 适合场景 | 长时间运行的任务,由 OpenAI 管理 agent 并保存进度 | 在自己的应用里构建带自定义工具和工作流的 agent | 直接调用模型,或者从零写 agent |
| agent 运行在哪 | OpenAI 运行托管的 Codex harness | SDK 运行在你的应用里 | 你的应用,可选用托管的编排能力 |
| 集成工作量 | 低 | 中 | 高 |
| 任务之间的状态 | 保存的会话配置、turns 和 items | 你自己的存储加 SDK sessions,或者 Responses 的会话状态 | 手动管理历史、response 链,或 Conversations |
| 工具执行 | 服务端连接的工具、应用侧的函数处理器、可选的沙箱 | 在你的应用中配置的工具和集成 | 托管工具,加上你的应用自己执行的工具 |
| 执行环境 | OpenAI 托管沙箱、自托管沙箱,或者不用沙箱 | 你的运行时,加上各家沙箱提供方的集成 | 你自己的执行环境 |
官方明确说明,不必全局只选一种。许多应用用 Agents SDK 跑托管型工作流,同时在更底层的路径上直接调用 Responses API7。
4. 2026 年需要知道的变化#
4.1 Assistants API 已下线#
自 2026-08-26 起,Assistants API 不再可用,官方给出的迁移目标是 Responses API5。概念对应关系如下:
| 以前(Assistants) | 现在 | 官方给出的理由 |
|---|---|---|
Assistants | Prompts | Prompt 保存配置(模型、工具、指令),更方便做版本管理 |
Threads | Conversations | 存放 item 流,而不只是消息 |
Runs | Responses | 发送输入 item(或引用 conversation),得到输出 item;工具调用循环由你显式管理 |
Run steps | Items | 通用对象,可以是消息、工具调用、输出等 |
以上对照来自官方迁移指南5。
4.2 Chat Completions 仍然可用,但新能力集中在 Responses#
- 官方的说法是,Chat Completions 仍受支持,但新项目推荐使用 Responses2。
- 从 GPT-5.4 开始,Chat Completions 中只要
reasoning_effort不是none,就不支持工具调用2。 - GPT-6 Astra 和 GPT-6.1 Sol 只能通过 Responses API 做工具调用19。
4.3 模型阵容(2026-10)#
| 模型 | 官方定位 |
|---|---|
| GPT-6 Astra | 智能最高 |
| GPT-6.1 Sol | 速度、成本、智能三者平衡,性能接近 Astra |
| GPT-6 Luna | 最快,性价比最高 |
以上来自 Using GPT-6 页面20。另外:
- Agents SDK 在没有指定模型时,默认使用
gpt-5.6-luna,并设置reasoning.effort="none"21。 - 本专题示例中出现的模型名都取自官方文档,使用时请以 Models 页面 为准。
4.4 新的工具能力#
| 能力 | 一句话说明 | 出处 |
|---|---|---|
| Tool search | 把用得少的工具设为延迟加载(defer_loading),运行时再按需载入;需要 gpt-5.4 及以上 | 22 |
| Programmatic Tool Calling | 模型生成 JavaScript 代码,在托管的 V8 环境中批量调用工具 | 23 |
| Hosted shell + Skills | 在 OpenAI 托管的容器里执行 shell,可以挂载 skills | 23 |
| Async tool calling | GPT-6 可以在你的工具还没返回时继续推理,或者调用其他工具 | 20 |
| Mid-turn steering | 模型工作到一半时插入新指令(通过 WebSocket) | 20 |
5. 客户端 SDK 一览#
| 语言 | 包 / 仓库 | 备注 |
|---|---|---|
| Python | openai(openai-python) | 3.x,基于 HTTPX23 |
| JavaScript/TypeScript | openai(openai-node) | 支持 Node.js、Deno、Bun6 |
| .NET | 与微软合作维护 | 6 |
| Java | openai-java | beta6 |
| Go | openai-go | beta6 |
| Ruby | openai-ruby | 6 |
| CLI | openai 命令行工具(可通过 Homebrew 安装) | 6 |
Agents SDK 有 Python 和 JS/TS 两个实现。官方 Python 文档把 Python 作为一等公民,其特性列表中写着 Python-first7。本专题的 OpenAI 部分统一使用 Python。
6. 阅读顺序#
小结#
- 主线是 Responses API。 Assistants 已经下线,Chat Completions 只是“继续可用”,新能力基本都只在 Responses 上提供。
- Agents SDK 与 Agents API 是两种不同的路线:前者把循环放在你的进程里,开源、可控;后者把循环和沙箱交给 OpenAI 托管。
- 学习路径建议:先用 Responses 手写一次循环(1.2 Tool Calling 与 Agent Loop 原理),再学 Agents SDK,最后了解 Agents API。
相关笔记#
- 1.1 从 LLM API 到 Agent Harness 的分层
- 2.2 OpenAI 客户端 SDK 与 Responses API · 2.3 OpenAI Agents SDK · 2.4 OpenAI Agents API
- 对照阅读:3.1 Claude 开发者生态全景
参考资料#
注释与出处#
-
openai/openai-agents-python,
docs/release.md(版本策略),https://github.com/openai/openai-agents-python/blob/26345c1e45ebede8e2fc9b0bc7341dedab5e01fc/docs/release.md ↩ -
OpenAI,Migrate to the Responses API(“While Chat Completions remains supported, Responses is recommended for all new projects.”),https://developers.openai.com/api/docs/guides/migrate-to-responses ↩ ↩2 ↩3
-
openai/openai-python,
README.md(称 Chat Completions 为 “previous standard (supported indefinitely)”),https://github.com/openai/openai-python/blob/9301e319ea33ef28fba380f39a289dedc14652c1/README.md ↩ ↩2 -
OpenAI,Conversation state,https://developers.openai.com/api/docs/guides/conversation-state ↩
-
OpenAI,Assistants migration guide(“officially sunset on August 26, 2026”),https://developers.openai.com/api/docs/assistants/migration ↩ ↩2 ↩3 ↩4
-
OpenAI,SDKs and CLI,https://developers.openai.com/api/docs/libraries ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7
-
openai/openai-agents-python,
docs/index.md,https://github.com/openai/openai-agents-python/blob/26345c1e45ebede8e2fc9b0bc7341dedab5e01fc/docs/index.md ↩ ↩2 ↩3 ↩4 -
openai/openai-python,
CHANGELOG.md中 3.13.0(2026-09-10)条目 “api: add Agents API”,https://github.com/openai/openai-python/blob/9301e319ea33ef28fba380f39a289dedc14652c1/CHANGELOG.md ↩ ↩2 -
OpenAI,Codex 开发者文档索引(Codex SDK:“Programmatically control local Codex agents”),https://developers.openai.com/codex/llms.txt ↩
-
TechCrunch,OpenAI launches AgentKit to help developers build and ship AI agents(2025-10-06),https://techcrunch.com/2025/10/06/openai-launches-agentkit-to-help-developers-build-and-ship-ai-agents ;OpenAI 官方公告:https://openai.com/index/introducing-agentkit/ ↩ ↩2
-
OpenAI,Audio and voice,https://developers.openai.com/api/docs/guides/audio ↩
-
OpenAI,Migrate from Agent Builder,https://developers.openai.com/api/docs/guides/agent-builder/migrate-from-agent-builder ↩
-
OpenAI,New tools for building agents(2025-03-11),https://openai.com/index/new-tools-for-building-agents/ ;另见 TechCrunch 同日报道:https://techcrunch.com/2025/03/11/openai-launches-new-tools-to-help-businesses-build-ai-agents ↩
-
openai/openai-python,
CHANGELOG.md中 1.101.0(2025-08-21)条目 “adding support for /v1/conversations to the API”,https://github.com/openai/openai-python/blob/9301e319ea33ef28fba380f39a289dedc14652c1/CHANGELOG.md ↩ -
OpenAI Developer Community,Assistants API beta deprecation — August 26, 2026 sunset(发布于 2025-08-26),https://community.openai.com/t/assistants-api-beta-deprecation-august-26-2026-sunset/1354666 ↩
-
第三方报道,OpenAI Agents API Public Beta: What Operators Need to Know(称其于 2026-09-10 上午 8 点(太平洋时间)发布),https://davidandgoliath.ai/daily-ai-briefing/openai-agents-api-public-beta 。注:这是二手资料,官方 SDK 的 changelog 日期与之吻合。 ↩
-
OpenAI,Agents API(“gives your application access to the Codex harness through an OpenAI-managed API”),https://developers.openai.com/api/docs/guides/agents-api/overview ↩
-
OpenAI,Agents(Compare agent runtime options 一节),https://developers.openai.com/api/docs/guides/agents ↩
-
OpenAI,Function calling(页首关于 GPT-6 Astra、GPT-6.1 Sol 的说明),https://developers.openai.com/api/docs/guides/function-calling ↩
-
OpenAI,Using GPT-6,https://developers.openai.com/api/docs/guides/latest-model ↩ ↩2 ↩3
-
openai/openai-agents-python,
docs/models/index.md,https://github.com/openai/openai-agents-python/blob/26345c1e45ebede8e2fc9b0bc7341dedab5e01fc/docs/models/index.md ↩ -
OpenAI,Using tools,https://developers.openai.com/api/docs/guides/tools ↩
-
openai/openai-agents-python,
docs/tools.md,https://github.com/openai/openai-agents-python/blob/26345c1e45ebede8e2fc9b0bc7341dedab5e01fc/docs/tools.md ↩ ↩2