OpenAI Launches Agents API in Public Beta, Exposing Codex Harness Through One API Call
OpenAI released the Agents API in public beta on Sept. 10, 2026, letting developers use the Codex harness through one managed API call. Agents can run in OpenAI-hosted, self-hosted, or partner sandboxes, with built-in context compaction, tool search, and subagents.
The API is live for all developers in public beta. It is a managed service built on the open-source Codex harness. OpenAI said scaling Codex and ChatGPT for Work showed that long-running agents need a harness that manages context, uses tools efficiently, and coordinates subagents, as well as infrastructure that keeps them running reliably for days. The official documentation organizes the API around four concepts: the agent, which includes the model, instructions, tools, and MCP servers; the environment, an optional sandbox where the agent accesses files, loads skills, and runs commands; the session, a durable agent instance that works on tasks and responds to input; and events and items, the inputs sent to the agent and the output it produces.
A session runs in four steps. Developers create it and give it a task, follow progress through streaming or webhooks, and then continue with a new task or steer the current turn. OpenAI's announcement shows an incident-investigation agent created in a single call. The example uses the gpt-6-astra model, an MCP observability server, multi-agent support with up to three concurrent subagents, vault IDs, and an OpenAI-hosted environment with capability directories. Its input asks the agent to investigate service-api's elevated 5xx rate over the previous 30 minutes, delegate deployment, error, and dependency analysis to subagents, and save findings, evidence, and recommended mitigation in /workspace/outputs.
Environment choice is the main architectural decision. The Agents API supports three sandbox options and can also run without a sandbox. An OpenAI-hosted sandbox uses the sandboxing infrastructure behind Codex and ChatGPT and can be configured with files, packages, skills, and plugins. A self-hosted option runs codex exec-server inside the developer's environment; it registers with a restricted key and connects over WebSocket, with all connections outbound. Blaxel, Cloudflare, Daytona, DigitalOcean, E2B, Modal, Oracle, Runloop, and Vercel have first-class partner sandbox integrations.
OpenAI maintains the harness alongside its models, with versioned access at each model launch. For long sessions, the API automatically compacts earlier context as a session nears its limit, so developers do not write their own compaction logic. Tool search loads tool definitions only when needed, which OpenAI says reduces token usage and cost while preserving the model's cache. Programmatic tool calling lets agents run calls in parallel and chain operations, and agents filter or combine results in code so that only relevant data returns into context. Supported tools include MCP, custom functions, and built-in tools such as web search. With multi-agent support, the main agent splits complex tasks into independent pieces, each subagent keeps its own context, and the main agent coordinates them and combines the results.
OpenAI's runtime comparison positions the three options differently. The Agents API runs a managed Codex harness on OpenAI, has low integration effort, saves session configuration, turns, and items, and supports OpenAI-hosted, self-hosted, or no sandbox execution. The Agents SDK runs inside the application, has medium integration effort, relies on the developer's storage and SDK sessions, and uses the developer's runtime and sandbox providers. The Responses API runs in the application with optional hosted orchestration, has high integration effort, requires manual history, response chaining, or Conversations, and runs in the developer's own environment.
OpenAI also published customer-reported results, which are vendor-supplied and not independent benchmarks. Ciridae's evaluation score rose from 0.71 to 0.85, with a 4x latency reduction on subagent flows. SafetyKit reported 60% lower cost per case after migrating its case review workflow. Hypha reported 86% fewer failed agent responses after separating the harness from the sandbox. Nash.ai runs thousands of long-running agents across global logistics networks. OpenAI said there is no extra fee for the Agents API; users pay for tokens.
Editor's Summary
OpenAI has opened its Agents API in public beta, packaging the managed Codex harness behind a single API call with OpenAI-hosted, self-hosted, and partner sandbox options. The service includes built-in context compaction, tool search, programmatic tool calling, and subagents, but its data is US-only and Zero Data Retention is unsupported. OpenAI also cited vendor-reported customer gains, while charging no extra fee beyond token usage.