OpenAI has released the Agents API, a new service designed to provide applications with streamlined access to Codex capabilities through a fully managed interface. The API handles key operational aspects such as session management, orchestration, context compaction, and recovery, allowing developers to focus on defining tools and execution environments.

Agents operate within sandboxes where they can execute code, edit files, connect to Managed Control Plane (MCP) servers, and generate output artifacts. This setup supports a variety of use cases, including incident response, data analysis, bug investigation, and document review.

The API is structured around four main components: the agent (which includes the model, instructions, and tools), the environment (sandbox or host where code runs), sessions (durable instances managing tasks and interactions), and events/items (inputs and outputs during sessions).

Developers can create and manage sessions that persist state, enabling continuous workflows without rebuilding context. OpenAI provisions and manages the sandbox environments, with options for both OpenAI-hosted and self-hosted setups. The API supports multi-agent configurations, allowing agents to delegate subtasks to subagents for parallel processing.

Pricing follows the standard OpenAI API rates for model usage and container costs for sandbox hosting. Currently, data residency is limited to the United States, and Zero Data Retention is not supported, even with self-hosted sandboxes.

The Agents API aims to simplify the integration of AI-powered automation by managing the complexities of execution and orchestration, making it easier for developers to build sophisticated applications that leverage Codex and related tools.