OpenAI has unveiled the Agents API, a new interface that provides applications with access to the Codex model through an OpenAI-managed environment. This API simplifies the integration of Codex by managing sessions, orchestration, context compaction, and recovery, while allowing developers to supply tools and select execution environments.

Agents operate within sandboxes where they can execute code, modify files, connect to MCP servers, and generate outputs. The API supports various use cases, including incident response, Slack bots, data analysis with SQL, GitHub issue investigation, and document review.

The Agents API is structured around four key components: the agent itself (comprising the model, instructions, tools, and MCP servers), the environment (sandbox or host where tasks run), sessions (durable instances managing tasks and inputs), and events/items (inputs and outputs during sessions).

Developers can start sessions in OpenAI-hosted sandboxes, configure agents, assign tasks, and monitor progress via streaming outputs or webhooks. The managed Codex harness facilitates command execution, skill application, external data connections, agent steering, context summarization, task delegation to subagents, and session resumption.

Pricing aligns with standard API rates for model usage, tools, and container hosting. The API retains session states to maintain continuity across interactions but currently supports data residency only in the United States and does not offer Zero Data Retention compliance.

This new API offers developers a streamlined way to embed advanced AI-driven workflows into their applications, reducing the complexity of managing AI orchestration and execution environments.