OpenAI has introduced the Agents API, a managed service that enables developers to build durable cloud-based agents with what the company calls a “managed Codex harness.” According to OpenAI’s API documentation, the platform handles infrastructure complexity—including sessions, orchestration, context management, and recovery—while developers provide tools and specify execution environments.

The Agents API is structured around four core concepts: agents (defined by model, instructions, tools, and connected servers), environments (optional sandboxes or computers where agents access files and run commands), sessions (durable instances that work on tasks and respond to input), and events and items (inputs and outputs during a session).
Agents can operate in sandboxes where they execute code, edit files, connect to MCP (Model Context Protocol) servers, and generate artifacts. The platform supports multi-agent workflows, allowing agents to delegate independent research tasks to subagents, with configurable limits on concurrent subagents.
According to OpenAI’s documentation, the managed harness provides several capabilities: running commands and code in sandboxes, applying relevant skills and instructions, connecting to external data through tools or MCP, steering agents during execution, summarizing previous work to manage context windows, breaking work into subtasks, and resuming sessions from where they left off.
Developers can configure agents with various tools, including programmatic tool calling, web search, and MCP server connections. The API supports multiple execution environments: OpenAI-managed sandboxes and self-hosted options where developers specify workspace directories and capability directories.
Pricing is based on model usage at standard API rates for the selected model, with OpenAI tools and OpenAI-hosted sandboxes charged at standard container rates. The API documentation includes quickstart guides and prerequisites for API-key permissions and SDK setup across multiple programming languages including Python, JavaScript, Go, and Java.
The service is positioned for use cases like document review with policy and specialist agents, as well as general autonomous task execution workflows.
Key facts
- OpenAI’s Agents API provides a managed infrastructure for building autonomous cloud agents
- The platform handles sessions, orchestration, context management, and recovery automatically
- Agents can run code, edit files, connect to MCP servers, and produce artifacts in sandboxes
- The API supports multi-agent workflows with configurable concurrent subagent limits
- Pricing is based on model usage rates plus standard container rates for hosted sandboxes
