OpenAI Agents API Public Beta Puts Codex Harness Behind One Call
In this article
OpenAI on September 10, 2026 opened its Agents API to all developers in public beta, making the same managed harness that runs Codex and ChatGPT for Work available behind a single API call. The architectural significance is not a new model—it is a shift in where execution infrastructure lives. Teams building long-running agentic workflows previously had to maintain their own context compaction, tool orchestration, subagent coordination, and state persistence. That complexity is what this API absorbs. As production AI systems increasingly fail on architecture rather than model intelligence, moving the harness into a managed layer eliminates an entire category of engineering debt.
The API organises around four primitives: an agent (model, instructions, tools, MCP servers), an environment (optional sandbox for file access and command execution), a session (a durable instance that persists state across turns), and events and items (inputs sent to the agent and outputs it returns). A session progresses in four steps: create it with a task, stream or webhook progress, then continue with a new task or steer the current turn.
What the harness manages
Three capabilities that previously required custom engineering now ship as defaults.
Context compaction runs automatically as a session approaches its context limit. The harness compacts earlier context and retains what the agent still needs; developers write no compaction logic.
Tool efficiency operates on two levels. Tool search loads definitions only when the agent needs them, reducing token consumption and preserving the model's cache. Programmatic tool calling lets agents run multiple calls in parallel and filter or combine results in code before anything re-enters context. Supported tool types include MCP servers, custom functions, and built-ins such as web search.
Subagent coordination is enabled via multi_agent: { enabled: true, max_concurrent_subagents: 3 } in the session configuration. Each subagent maintains its own context; the orchestrating agent coordinates and merges results. OpenAI's published quickstart example creates an incident-investigation agent using gpt-6-astra that delegates deployment analysis, error analysis, and dependency analysis to three concurrent subagents, saving findings to /workspace/outputs—all in a single client.beta.agents.sessions.create() call.
Environment and runtime options
The sandbox choice is the primary architectural decision at deployment time. Three options exist alongside the option to run with no sandbox.
| Option | Where compute runs | Integration mechanism | Key constraint |
|---|---|---|---|
| OpenAI-hosted sandbox | OpenAI infrastructure (same as Codex) | environment.type: "openai_hosted" |
US data residency only; no ZDR |
| Self-hosted | Developer's own environment | codex exec-server registers via restricted key over outbound WebSocket |
Does not make the Agents API ZDR-eligible |
| Partner sandboxes | Blaxel, Cloudflare, Daytona, DigitalOcean, E2B, Modal, Oracle, Runloop, or Vercel | First-class integrations per provider | Varies by provider |
| No sandbox | N/A | Session runs without environment attachment | No file access or command execution |
Billing carries no additional Agents API fee. Costs accrue at standard API token rates for models, standard rates for OpenAI-built tools, and container rates for hosted sandboxes.
Vendor-reported early results
OpenAI published four customer-reported figures; these are vendor-supplied, not independent benchmarks.
- Ciridae: evaluation score improved from 0.71 to 0.85, with a 4x latency reduction on subagent flows.
- SafetyKit: 60% lower cost per case after migrating its case-review workflow.
- Hypha: 86% fewer failed agent responses after separating the harness from the sandbox.
- Nash.ai: operates thousands of long-running agents across global logistics networks (no quantified metric supplied).
AI Mastery analysis
The Agents API's most consequential design choice is not a feature—it is a boundary. By hosting the harness, OpenAI assumes responsibility for compaction timing, tool-call scheduling, and subagent lifecycle. That simplifies onboarding but concentrates execution observability inside OpenAI's infrastructure. Teams that have built internal tracing and replay tooling will lose that layer unless they reconstruct it via the streaming events surface.
The US-only data residency restriction is a hard blocker for regulated industries and non-US enterprises. Running a self-hosted sandbox does not change the API's residency classification—the control plane stays in the US regardless of where compute executes. This is the same governance tension that infrastructure governance frameworks for safe agent deployment highlight: shifting execution to a managed layer does not automatically satisfy compliance requirements.
The three-API positioning—Agents API, Agents SDK, and Responses API—also deserves scrutiny. The Agents SDK places orchestration logic inside the developer's application, preserving portability and debuggability. The Agents API trades both for reduced integration effort. For teams building multi-layer agent control systems, the managed harness may obscure contract boundaries between control layers that need explicit definition.
OpenAI's decision to open-source the Codex harness and then offer a managed version above the API boundary mirrors a broader infrastructure pattern: commoditise the plumbing, capture the operations margin. Nine partner sandbox integrations signal that OpenAI is not trying to own compute exclusively—but it is positioning itself to own orchestration. Whether the residency and ZDR limitations are resolved before general availability will determine how broadly the API can displace custom harnesses in enterprise deployments.
Primary source
Related Reading

ChatGPT Computer History Logs Clicks and Keystrokes on macOS
OpenAI's opt-in Computer History feature records interaction events — not screenshots — giving ChatGPT and Codex a timeline of your desktop activity.
GPT-6 Astra: $10/M Tokens, 57.9% Terminal-Bench, Critical Cyber Flag
OpenAI's GPT-6 Astra scores 57.9% on Terminal-Bench 4.0, costs $10/$50 per million tokens, and is the first model to hit the Critical cybersecurity threshold.
GPT-6 Astra Hits Amazon Bedrock With 1M-Token Context and Critical Security Tier
GPT-6 Astra is now generally available on Amazon Bedrock with a 1M-token context window, chip-level operator isolation, and OpenAI's first Critical cybersecurity classification.