OpenAI Releases Agents API in Public Beta, Offering a Managed Codex Agent Runtime
The service shifts the mechanics of keeping an agent working over time to OpenAI, while leaving developers to choose its tools and runtime environment. Its U.S.-only data residency and lack of Zero Data Retention narrow the immediate fit for some deployments.
OpenAI is making the runtime behind its Codex agent harness available through the Agents API public beta. Developers can persist sessions, stream events, use webhooks, compact context automatically, delegate subtasks, and resume work while choosing hosted, self-managed, partner, or no sandbox. The harness has no separate fee, but model, tool, and hosted-sandbox usage still costs money. The main enterprise caveat is significant: US-only data residency and no Zero Data Retention, even with self-hosted execution.
01
The API supports custom functions, MCP servers, web search, code execution, file editing, and artifact generation inside sandboxes.
02
OpenAI manages session lifecycle, orchestration, context compaction, and recovery; developers remain responsible for tools and execution environments.
03
Customer-reported results include Ciridae scores rising from 0.71 to 0.85 and SafetyKit claiming 60% lower cost per case; neither is independently benchmarked.
A developer can now hand off much of the machinery that keeps an AI agent running across a complex task: its session state, orchestration, context management and recovery. OpenAI has released the Agents API in public beta, giving all developers managed access to the Codex-based harness behind that work while they supply the tools and select where the agent executes.
The release changes what an application needs to build itself. Rather than only calling a model and assembling its own agent loop around it, an application can create a durable session, give it a task, receive output events and continue or steer the same session later. OpenAI says developers can follow progress through streamed output or webhooks, including when an agent finishes or needs more input.
A managed loop, with a developer-chosen workspace
The central division of labor is straightforward: OpenAI manages sessions, orchestration, automatic context compaction and recovery. The application provides the agent’s tools and chooses the execution environment. That environment can be an OpenAI-hosted sandbox, a developer-managed environment, an integrated partner sandbox, or no sandbox at all.
A sandbox gives the agent a place to act rather than simply respond. OpenAI says agents operating in one can run code, edit files, connect to Model Context Protocol, or MCP, servers, and produce artifacts. The API supports MCP connections, custom functions and built-in tools such as web search.
Capabilities aimed at longer work
The managed harness is designed for tasks that involve more than a single model answer. Its features include summarizing earlier work to manage the model’s context window, breaking work into subtasks, delegating those subtasks to other agents, and resuming a session where it left off. Those functions address recurring engineering work in agents that must keep track of progress while invoking tools over multiple turns.
With an OpenAI-hosted session, your application sends input and receives events, while OpenAI runs the agent and provisions and manages its sandbox. See environment options for setup and limitations.Source: developers.openai.com.
Automatic context compaction can summarize prior work as a session approaches its context limit.
Programmatic tool calling supports running and combining tool operations in code.
Multi-agent support can delegate independent tasks to subagents and combine their output.
The API can connect agents to external data through tools or MCP servers.
OpenAI lists examples that reflect that broader workflow: an incident-response agent that investigates alerts and seeks approval for recovery actions; a data analyst that queries a warehouse with read-only SQL; and a GitHub issue investigator that reproduces reported bugs and shares findings. They are examples of intended applications, not performance evidence for the API itself.
The constraint sits outside the sandbox choice
The launch comes with a material data-handling limit. The Agents API supports data residency only in the United States and does not support Zero Data Retention. OpenAI says choosing a self-hosted sandbox does not make the API eligible for Zero Data Retention. For organizations whose requirements depend on those controls, moving the execution environment outside OpenAI does not resolve the limitation.
There is no separate charge for the Agents API harness itself, according to OpenAI. Usage is billed through the selected model’s API rates, while OpenAI tools and OpenAI-hosted sandboxes carry their standard rates. That makes the product decision less about a new platform fee than about whether to adopt OpenAI’s managed runtime for the workloads a team wants to automate.
OpenAI has also published customer-supplied results, including a Ciridae evaluation-score increase from 0.71 to 0.85 and a fourfold latency reduction in subagent flows, plus SafetyKit’s reported 60% lower cost per case. Those figures are not independent benchmarks, but they point to the claim the new service is asking developers to evaluate: whether a managed harness can reduce the operational work of building agents without giving up too much control.
OpenAI’s Agents API environment documentation divide file storage and cleanup across different systems, a Superpower Daily review of 11 execution configurations found. Hosted sandboxes keep working files while the environment exists, publish separate output artifacts that can outlive it, and can use Files API objects with their own retention rules. Self-hosted files instead stay outside OpenAI’s Artifacts API. OpenAI manages the agent harness while customers select where code executes, so a builder’s cleanup policy must account for both the managed service and the chosen environment.
The analysis covered OpenAI-hosted execution, generic self-hosted customer infrastructure, and nine named integrations: Modal, Cloudflare, Vercel, Daytona, Blaxel, E2B, Runloop, DigitalOcean, and Oracle Cloud Infrastructure. It was limited to public documentation available by September 11 and excluded private contractual controls, so the finding describes the documented launch choices rather than every possible commercial arrangement. This is a comparison of documented behavior, not a live test of deletion guarantees. It does not assume that a provider’s available regions determine where OpenAI retains session data, or that ending a compute session removes every output copy. The review treats execution, session storage, and published files as separate questions.
The OpenAI-hosted option is the more integrated route for file work. It gives each session a Linux workspace, lets agents receive files and produce outputs, and publishes files saved under its output directory as immutable artifacts after a turn completes. Workspace files persist across turns while the sandbox exists, while published artifacts remain downloadable after the sandbox expires.
A published artifact is separate from its source file: deleting the artifact does not remove the file that remains in the environment. Conversely, the expiry of the sandbox does not remove published output artifacts. Teams handling sensitive inputs and outputs therefore need to inventory both the working files and the copies exposed for download, rather than treating a completed agent turn as evidence that its files have disappeared.
The hosted sandbox itself can be deleted after an hour without activity and keep-alives, according to OpenAI’s documentation. Deleting a session requests sandbox cleanup, but published output artifacts survive expiry and must be deleted separately when they are no longer needed.
Self-hosted and partner environments offer a different file arrangement. Their files are retrieved through the provider’s file interface or a mounted filesystem, not through OpenAI’s Artifacts API. That keeps the execution environment’s filesystem outside that OpenAI artifact service, while leaving the customer or provider to manage its own storage and cleanup process.
That responsibility extends to lifecycle management. OpenAI’s Cloudflare integration, for example, says an application must clean up the provider sandbox and delete the Agents API session separately for immediate cleanup. It also cautions that reconnecting an offline executor does not itself restore files from a previous container. A customer-managed runtime can therefore offer placement and storage control, but it requires explicit provisioning, recovery, and deletion policies.
OpenAI directs teams that need their own image, compute, or private network toward self-hosting rather than an OpenAI-hosted sandbox. That gives customers a concrete execution-side choice without requiring an assumption about what every partner offers. The documentation describes the hosted option as a managed Linux workspace; the self-hosted route instead requires the customer to provision and run an executor.
OpenAI hosts and maintains the Agents API harness, while customers choose where the agent executes. In a self-hosted deployment, a customer runs an executor in its selected environment. That executor runs shell commands, reads and writes files, and connects outbound to OpenAI to receive commands and return results.
The customer’s environment also needs its own access boundary. OpenAI advises isolating environments by user or workload because agents that share one can access the same files and credentials. It requires a restricted executor key and says to keep the broader application API key outside the workspace. That restricted key can be read by agent-generated code, but it only permits connecting environments.
The compliance boundary remains important context, though it is not a new promise in these environment guides. OpenAI’s launch documentation already states that Agents API sessions and its managed harness are U.S.-resident and not eligible for Zero Data Retention. Selecting a different place to execute code does not change those terms. The documented file-handling choices explain an additional operational question: which system holds each copy, and which deletion action reaches it.
OpenAI’s release makes the agent harness itself a product boundary. Developers can retain control over an agent’s tools and execution environment while handing session persistence, context management and recovery to OpenAI. That may appeal where the workflow and connected data matter more than custom orchestration. But the launch also makes data handling a decisive architectural question: the API is U.S.-residency-only and cannot be used with Zero Data Retention, even with a self-hosted sandbox. The next meaningful test is whether OpenAI broadens those controls or whether developers needing them keep the runtime layer under their own management.
Reader comments
Newest comments first. Replies stay oldest first.