随着我们将 Codex 和 ChatGPT for Work 扩展到全球数百万用户,我们了解到了让长时间运行的智能体在实践中良好运作所需的条件。有用的智能体需要一个强大的执行框架,能够管理上下文、高效使用工具并协调子智能体。它们还需要基础设施来保持可靠运行数天,并提供可以处理文件、运行代码和保存中间结果的环境。
今天,我们推出 Agents API(在新窗口中打开) 公测版,通过一个简单、灵活的 API,将驱动 Codex 的同一套执行框架和基础设施带给开发者。
通过单次 API 调用构建云端智能体
借助 Agents API,你可以通过单次 API 调用创建生产就绪的智能体,只需指定任务、模型、工具和环境:
OpenAI 托管并维护执行框架。你可以选择智能体的计算环境:在 OpenAI 管理的沙箱中、在你自己的基础设施上,或使用我们的沙箱合作伙伴之一。Agents API 为你提供坚实的基础,让你能够在我们优化的智能体执行框架和基础设施之上构建智能体,这样你就可以专注于让你的智能体独一无二的工具、知识和工作流。
Agents API 使用与 Codex 相同的执行框架和基础设施为你的智能体提供支持。
客户对 Agents API 的评价
8 项中的 1 项
选择你的智能体环境
不同的工作负载需要不同的计算、存储和部署选项。Agents API 让你选择适合你应用的沙箱。
我们正在与生态系统提供商合作(在新窗口中打开),包括 Blaxel、Cloudflare、Daytona、DigitalOcean、E2B、Modal、Oracle、Runloop 和 Vercel,为各种需求提供一流的集成:
- 完全托管的环境或部署在你的 VPC 内
- 特定的文件和密钥存储机制
- 不同的 CPU、GPU 和内存配置,以及与你公司工作流相匹配的性能、冷启动和成本特征。
Agents API 与热门生态系统提供商提供一流的集成。
OpenAI 托管沙箱
对于希望快速开始并高效扩展的开发者,我们还推出了 OpenAI 托管沙箱(在新窗口中打开)。它利用与驱动 Codex 和 ChatGPT 相同的沙箱基础设施。
OpenAI 配置并管理沙箱,为你的智能体提供一个安全且高性能的环境,用于运行代码、处理文件并生成产物。这些沙箱可以灵活配置你的文件、包、技能和插件,为智能体提供完成任务所需的一切。
使用不断演进的 Codex 执行框架进行构建
利用新的模型能力通常意味着重做你的执行框架,这会占用改进应用的宝贵时间。Agents API 在每次模型发布时提供对这些能力的版本化访问。我们与模型一起维护并持续改进执行框架,帮助你的智能体从每次升级中获得更好的性能。例如,执行框架最近的改进包括:
让智能体在长会话中持续工作
为了支持模型工作数小时,我们构建了上下文管理,帮助智能体在更长会话中携带相关信息。当会话接近其上下文限制时,Agents API 会自动压缩(在新窗口中打开)较早的上下文,保留智能体继续所需的信息。开发者可以构建跨越多个上下文窗口的工作流,而无需实现自己的压缩逻辑。
帮助智能体高效使用更多工具
Agents API 帮助智能体找到合适的工具并高效使用它们。工具搜索(在新窗口中打开)会按需加载相关工具定义,帮助减少 token 使用量和成本,同时保留模型的缓存。工具可用后,程序化工具调用(在新窗口中打开)让智能体可以并行运行调用、串联相关操作,并在代码中过滤或组合结果,从而能够处理大量数据,同时只将相关结果带回上下文。Agents API 支持 MCP、自定义函数以及网页搜索等内置工具。
让智能体通过子智能体并行处理工作
借助多智能体支持(在新窗口中打开),Agents API 可以将复杂任务拆分为独立部分,并委派给并行工作的子智能体。每个子智能体维护自己的上下文,帮助它专注于自己的任务,而主智能体协调它们的工作并汇总结果。这可以加速受益于并行工作的研究、分析和编码任务,而无需你构建自己的编排。
开源基础
Agents API 由开源 Codex 执行框架提供支持,让开发者能够了解协调模型调用、工具和上下文的核心逻辑。借助 Agents API,OpenAI 运营并维护该执行框架,同时开发者可以检查其公共代码库(在新窗口中打开)并从中学习。
开始构建
Agents API 今天面向所有开发者提供公测版。使用 Agents API 无需额外费用——你只需为智能体使用的 token 和工具付费,详情见我们的定价页面(在新窗口中打开)。
在公测期间,我们将根据你的反馈快速迭代,并朝着正式可用版本推进。请告诉我们哪些方面运行良好、你在哪里遇到阻力,以及你在生产环境中构建和运行智能体需要什么。
As we’ve scaled Codex and ChatGPT for Work to millions of people around the world, we’ve learned what it takes to make long-running agents work well in practice. Useful agents need a powerful harness that manages context, uses tools efficiently, and coordinates subagents. They also need infrastructure that keeps them running reliably for days, with environments where they can work with files, run code, and save intermediate results.
Today, we’re introducing the Agents API(opens in a new window) in public beta, bringing that same harness and infrastructure that powers Codex to developers through a simple, flexible API.
Build cloud agents with a single API call
With the Agents API, you can create a production-ready agent in a single API call by specifying the task, model, tools, and environment:
OpenAI hosts and maintains the harness. You choose the agent’s compute environment: in an OpenAI-managed sandbox, on your own infrastructure, or with one of our sandbox partners. The Agents API gives you a strong foundation for building agents on top of our optimized agent harness and infrastructure, so you can focus on the tools, knowledge, and workflows that make your agent unique.
Agents API powers your agents with the same harness and infrastructure behind Codex.
What our customers are saying about Agents API
1 of 8
Choose your agent environment
Different workloads need different compute, storage, and deployment options. The Agents API lets you choose a sandbox that fits your application.
We’re partnering with ecosystem providers(opens in a new window), including Blaxel, Cloudflare, Daytona, DigitalOcean, E2B, Modal, Oracle, Runloop, and Vercel, to provide first-class integrations for a range of needs:
- Fully managed environments or deployments within your VPC
- Specific file and secret storage mechanisms
- Different CPU, GPU, and memory configurations, with performance, cold-start, and cost profiles to match your company’s workflow.
The Agents API offers first-class integrations with popular ecosystem providers.
OpenAI hosted sandboxes
For developers who want to get started quickly and scale efficiently, we’re also introducing the OpenAI hosted sandbox(opens in a new window). This leverages the same sandboxing infrastructure that powers Codex and ChatGPT.
OpenAI provisions and manages the sandbox, giving your agent a secure and performant environment to run code, work with files, and produce artifacts. These sandboxes can be flexibly configured with your files, packages, skills and plugins to give the agent what it needs to complete the task.
Build with an evolving Codex harness
Taking advantage of new model capabilities often means reworking your harness, taking valuable time away from improving your application. The Agents API provides versioned access to these capabilities with each model launch. We maintain and continuously improve the harness alongside our models, helping your agents get better performance from every upgrade. For example, recent improvements to the harness include:
Keep agents working across long sessions
To support models working for hours, we’ve built context management that helps agents carry relevant information across longer sessions. The Agents API automatically compacts(opens in a new window) earlier context as a session approaches its context limit, preserving information the agent needs to continue. Developers can build workflows that span multiple context windows without implementing their own compaction logic.
Help agents efficiently use more tools
The Agents API helps agents find the right tools and use them efficiently. Tool search(opens in a new window) loads relevant tool definitions as needed, helping reduce token usage and cost while preserving the model’s cache. Once tools are available, programmatic tool calling(opens in a new window) lets agents run calls in parallel, chain related operations, and filter or combine results in code so they can work through large volumes of data while bringing only the relevant results back into context. The Agents API supports MCP, custom functions, and built-in tools like web search.
Let agents parallelize work with subagents
With multi-agent support(opens in a new window), the Agents API can break complex tasks into independent pieces and delegate them to subagents that work in parallel. Each subagent maintains its own context, helping it stay focused on its assignment, while the main agent coordinates their work and brings the results together. This can speed up research, analysis, and coding tasks that benefit from parallel work, without requiring you to build your own orchestration.
An open-source foundation
The Agents API is powered by the open-source Codex harness, giving developers visibility into the core logic that coordinates model calls, tools, and context. With the Agents API, OpenAI operates and maintains that harness while developers can inspect and learn from its public codebase(opens in a new window).
Start building
Agents API is available in public beta today to all developers. There are no additional fees for using the Agents API – you simply pay for the tokens and tools your agents use, as outlined on our pricing page(opens in a new window).
During the public beta, we’ll iterate quickly based on your feedback as we work toward general availability. Let us know what’s working, where you’re running into friction, and what you need to build and run your agents in production.
本文内容采集自官方网站,排版和翻译可能与原页面存在差异。
阅读官方全文