OpenAI opens the Codex harness to developers through Agents API
OpenAI has put the Codex harness behind a public-beta Agents API, adding managed sessions, context compaction, tool coordination, subagents, and selectable execution environments for long-running agents.
OpenAI has opened the managed harness behind Codex to all developers through the Agents API public beta. The service handles session state, context compaction, tool coordination, recovery, and parallel subagents, while developers choose the model, tools, and execution environment.
That changes the integration boundary for long-running agents. Teams can keep their application logic and tools while outsourcing the infrastructure that keeps an agent alive across hours or days. OpenAI says the API has no additional fee beyond the tokens and tools used during the beta.
Agents API moves the hard state-management work into the service
The API exposes a session-oriented runtime instead of a one-shot completion loop. OpenAI’s example creates a session with a model, an MCP tool, a hosted environment, and an input task. The harness can compact earlier context as a session approaches its limit, which lets an agent continue across multiple context windows without each application implementing its own summarization and recovery path.
Tool search loads relevant tool definitions as needed, and programmatic tool calling can run calls in parallel, chain related operations, and return filtered results to the model. The API also supports MCP, custom functions, and built-in tools such as web search.
Subagents and sandboxes define the deployment model
Multi-agent support lets a coordinator break a complex task into independent pieces and delegate them to subagents with separate context. The example enables three concurrent subagents, but the practical limit will depend on workload, model choice, tool latency, and the controls a team places around credentials and side effects.

Execution is separate from the harness. Developers can use an OpenAI-hosted sandbox, their own infrastructure, or a partner environment. OpenAI lists Cloudflare, Vercel, Modal, E2B, Daytona, DigitalOcean, Oracle, Runloop, and Blaxel as integration partners. The split matters for data residency, network access, secrets handling, cold starts, and cost accounting.
Cloudflare’s same-day changelog gives the clearest independent implementation detail. Its reference Workers template keeps a Cloudflare Container for each Codex session, reconnects it for follow-up input, and shuts it down when idle. That makes the partner model concrete: OpenAI manages the agent loop and session lifecycle, while Cloudflare supplies the execution container and the controls around its network and data access.
Public beta access still leaves production questions
The Agents API is available to developers now, but beta status means interfaces and operational behavior can change before general availability. There is no promise that a workflow built around one model, tool schema, or sandbox integration will remain unchanged.
Before moving a production task into the service, define which actions require approval, isolate write-capable credentials, record tool calls and artifacts, and set explicit limits for concurrency and spend. The hosted sandbox may be the fastest route to a prototype; self-hosted or partner environments may fit teams that need tighter control over internal services and data.
OpenAI is effectively productizing the durable runtime that made Codex useful for extended coding work. The next milestone is general availability—and evidence that teams can inspect, constrain, and price these long-running agent sessions as predictably as conventional API workloads.
Sources and evidence
- OpenAI Agents API documentation — official API scope, managed harness, sandbox, and pricing details.
- Cloudflare Changelog — independent partner implementation using Cloudflare Containers.
Try the related loot
Put six hosted Workers AI models behind Cloudflare AI Search
