OpenAI has unveiled the Agents API, a new interface that allows applications to leverage the Codex model through a fully managed API. This service handles session management, task orchestration, context compaction, and recovery, while developers supply tools and select execution environments. Agents can operate within sandboxed environments where they execute code, modify files, connect to MCP servers, and generate outputs.
The API supports multiple use cases, including incident response, Slack bots, data analysis with SQL, GitHub issue investigation, and document review. OpenAI provides example applications demonstrating these capabilities.
The Agents API is structured around four key elements: the agent (model, instructions, tools, and MCP servers), the environment (sandbox or host machine), sessions (durable task instances), and events/items (inputs and outputs during sessions). Developers can create sessions that OpenAI provisions with sandbox environments, enabling input-driven task execution and real-time progress monitoring via streaming or webhooks.
The managed Codex harness facilitates command execution, skill application, external data access, agent steering, context summarization, subtask delegation to subagents, and session resumption. Pricing aligns with standard API rates for model usage and container rates for sandboxes.
Currently, the Agents API retains session state to maintain continuity across interactions but supports data residency only within the United States and does not offer Zero Data Retention. Self-hosted sandboxes do not change these data retention policies.
This API is significant as it streamlines the integration of advanced AI capabilities into applications, enabling more sophisticated automation and interaction workflows while offloading complex session and environment management to OpenAI.