OpenAI has officially launched the Agents API in its developer documentation, exposing the Codex harness through a REST API hosted by OpenAI. There is only one core endpoint: POST https://api.openai.com/v1/agents/sessions, which requires the OpenAI-Beta: agents=v1 header. The semantics are straightforward—OpenAI handles sessions, orchestration, context compression, and recovery, while the application provides tools and decides the execution environment.
Four Core Concepts and a Set of Managed Capabilities
The documentation breaks down the concepts into four: Agent (model + instructions + tools + MCP server), Environment (optional sandbox or computer, where the agent reads and writes files, loads skills, and runs commands), Session (a persistent agent instance that processes tasks and responds to input), and Events and items (input and output during the session). The workflow is to create a session → assign a task → stream or webhook follow-up → continue or intervene.
The managed harness capabilities include running commands and code in a sandbox, applying skills and instructions, connecting to external data via tools or MCP, intervening at any time during the process, compressing previous context, delegating subtasks to subagents, and resuming from a breakpoint. Multi-agent functionality is enabled via agent.multi_agent, with a setting for max_concurrent_subagents; tools support three types: programmatic_tool_calling, mcp (HTTP transport), and web_search. Environments can be either self_hosted or an OpenAI-managed sandbox.
Data Limited to the US, Does Not Support ZDR, Community Questions Vendor Lock-in
Pricing follows the model: model usage is billed based on the selected model, OpenAI tools are billed at standard rates, and the managed sandbox is billed at container rates. However, there are two data-related restrictions worth noting—data residency is currently limited to the US, and it does not support Zero Data Retention (ZDR), even if you choose a self-hosted sandbox, it will not become ZDR compliant. The SDK covers Python, TS/JS, Go, Java, and Ruby, all unified under client.beta.agents.sessions.create(...).
Community discussions mainly revolve around two points: whether it's worth handing over sessions to OpenAI for management, and the ambiguity of pricing. One user tested the sandbox network access configuration and found three modes: enabled, disabled, and restricted. In restricted mode, accessing external domains returns "Domain forbidden." He also questioned the billing method—whether each agent session creates a new environment, whether environments are billed for at least an hour, and whether they can be actively closed to save costs.
Regarding why use this API instead of running the SDK yourself, the community is split: critics argue "this is more like strengthening vendor lock-in"; supporters are practical—"to avoid the hassle of maintaining a sandbox VM ourselves." From an architectural perspective, the essence of the Agents API is to server-ize the Codex client's harness, making long-running agents that can read and write files and split subtasks first-class API for any backend program, at the cost of handing over session state and execution environment to OpenAI.
Join Now