OpenAI has released the Agents API in public beta. The service opens up the harness and infrastructure that run the company's own coding agent, Codex.

What is on offer here is not a model but an operating layer. OpenAI hosts and maintains the harness; what is left to the developer is describing what the agent should do.

Four concepts

The official documentation organises the API around four concepts. Standing an agent up amounts to defining those four.

ConceptWhat it defines
AgentThe model, instructions, tools and MCP servers available to it
EnvironmentAn optional sandbox: files, skills, running commands
SessionA durable agent instance that works on tasks and responds to input
Events and itemsThe inputs sent to the agent and the output it produces

A session runs in four steps too: you create it and give it a task, follow progress through streaming or webhooks, then either hand it a new task or steer the current turn.

Where the agent runs

Architecturally the main decision is the environment. The API supports three sandbox options, and it can also run with no sandbox at all.

  • OpenAI-hosted sandbox: the isolation infrastructure behind Codex and ChatGPT. It can be configured with files, packages, skills and plugins.
  • Self-hosted: you run codex exec-server inside your own environment. It registers with a restricted key and connects over WebSocket; all connections are outbound.
  • Partner sandboxes: Blaxel, Cloudflare, Daytona, DigitalOcean, E2B, Modal, Oracle, Runloop and Vercel are on the list with first-class integrations.

The outbound-connection detail matters on the enterprise side: running it on your own infrastructure does not require opening an inbound door into your network.

Running with no sandbox is on the list too. For an agent that only produces text and never touches a filesystem or a shell, carrying an isolation layer buys nothing; in that case session management stands on its own.

What it makes easier

OpenAI's announcement includes an incident-investigation agent created in a single call. That one call defines the model, an MCP observability server, at most three concurrent subagents, vault identifiers and working directories.

The company's reasoning follows from that: scaling Codex and ChatGPT for Work showed what long-running agents need. A harness that manages context, uses tools efficiently and coordinates subagents, plus infrastructure that keeps them alive for days.

The example also shows what the API removes: you no longer write the code that queues subagents, prunes context and keeps the session alive. For teams that already wrote their own loop, this means handing over the maintenance.

The limits are stated

Two constraints are written down plainly. Data stays in the US only, and Zero Data Retention is unsupported. For a project handling personal data under European or Turkish rules, those two lines belong on a legal desk before a technical one.

The service is in public beta for all developers. Beta means what it usually means: the interface can change, the behaviour can change, and that cost has to be priced in before production use.