OpenAI ships the Codex harness as an API
The OpenAI Agents API is in public beta: managed sessions, automatic context compaction, sandboxes, subagents. No extra fee. Here's what you give up.
OpenAI put the Agents API into public beta on September 10. It is the harness behind Codex, exposed as a service: OpenAI runs the session loop, compacts your context when it fills, recovers from failures, and rents you a sandbox to run code in. You bring tools and instructions. If you have written your own agent loop in the last year, this is the pitch to replace it.
What actually happened
Per OpenAI's API changelog, the Agents API lets developers "build agents with a managed Codex harness while OpenAI handles session orchestration, context compaction, and recovery." The pieces are an agent (model, instructions, tools, MCP servers), an optional environment, and a durable session you stream progress from or steer mid-run.
The interesting parts are the boring ones. Context compaction happens automatically as a session nears its limit — that is the single ugliest chunk of code in most homegrown harnesses, gone. Sessions are durable across turns, so long-running work does not die when your process does. Subagents get their own context and report back. Tool definitions load on demand instead of sitting in the prompt.
Execution is the part worth reading twice. You can run in an OpenAI-hosted sandbox, self-host by running codex exec-server in your own environment over an outbound-only WebSocket, or use a partner sandbox — OpenAI lists Cloudflare, Vercel, Modal, E2B, Daytona, DigitalOcean, Runloop, Blaxel, and Oracle. There is no separate API fee; you pay tokens, tools, and container time. Beta caveats: US-only data residency, and Zero Data Retention is not supported.
Why a managed agent harness matters for your business
The harness was never your moat. Nobody paid you for retry logic. If OpenAI runs the loop for free and you keep the tools, the prompts, and the domain knowledge, that is a good trade on the arithmetic alone — most teams we see burn four to six weeks building session state and compaction that they then maintain forever.
Read the caveats as requirements, not footnotes. No ZDR and US-only residency means a regulated workload — health records, EU customer data, anything under a BAA — does not go through the hosted path today. That is exactly what the self-hosted codex exec-server option is for, and it is why we would wire the sandbox to your infrastructure on day one rather than "later."
The portability question is the real one. A session ID, an event stream, and a compaction policy are all OpenAI-shaped. Keep your tool definitions and system prompts in your own repo, behind an interface, so the harness stays a swappable dependency. Then a beta that changes under you is a refactor, not a rewrite.
Key takeaways
- OpenAI's Agents API entered public beta on September 10, exposing the managed Codex harness
- OpenAI handles session orchestration, automatic context compaction, and recovery
- Run code in an OpenAI sandbox, your own via
codex exec-server, or a partner (Cloudflare, Vercel, Modal, E2B and others) - No extra API fee - you pay tokens, tools, and container time
- Beta limits: US-only data residency and no Zero Data Retention, so regulated data needs the self-hosted path
- Keep tools and prompts in your repo behind an interface so the harness stays swappable
We build agents that survive a harness change. Your tools, prompts, and domain logic live in your repo; the vendor loop is a dependency we can pull out. See how we build AI agent systems, or bring us the agent loop you are tired of maintaining.
Sources: OpenAI: Introducing the Agents API, OpenAI API changelog.
- #openai
- #ai-agents
- #agents-api
- #developer-tools
- #mcp
Tommy Rush — Founder, Rush Commerce
Operator turned builder. 15+ years running operations — now shipping the systems businesses run on. More
Get The Rush Report weekly — one email, zero fluff.
Keep reading
Alibaba backs an AI model testing lab at $2.5B
Alibaba is reportedly leading a $300M round in UniPat AI at a $2.5B valuation. Grading models is now a business - but your acceptance test is still yours.
Read itShieldCrash: Microsoft's Defender patch got bypassed again
A new PoC reads arbitrary files as SYSTEM on fully patched Windows after September's update. Third Defender escalation in the same chain since June.
Read it