OpenAI's Agents API arrived in public beta on September 10 with a seductive promise: send a task, a model, some tools, and an environment, then let the Codex harness deal with the long-running work. That is a useful product. It is also a fairly large architectural decision disguised as a short API call.

The right question is not whether the Agents API is impressive. It is whether your application should hand its agent loop to OpenAI. The launch removes a lot of plumbing, but it also moves session state, orchestration, compaction, and part of the failure surface outside your service. For a prototype that can be a bargain. For a regulated workflow or a product that may need another model provider later, it can be the wrong default.
OpenAI's own documentation gives the cleanest description. The Agents API runs a managed Codex harness. The Agents SDK runs inside your application and gives you control over deployment, storage, approvals, and runtime integration. The Responses API is the lower-level option for direct model calls or an agent loop you build yourself. Those are three different ownership models, not three names for the same API. OpenAI's comparison is effectively a choice among 3 runtime options.
Choose your runtime
| Runtime | Who owns the loop | Where state lives | Best fit | Main cost |
|---|---|---|---|---|
| Agents API | OpenAI | Saved sessions and items | Long tasks where speed of setup matters | Less orchestration code, less control |
| Agents SDK | Your application | Your storage plus SDK or Responses state | Custom workflows with approvals and integrations | More engineering and operations |
| Responses API | Your application | Your history or Conversations | Direct model work and a custom loop | Highest implementation burden |
The Agents API is the obvious choice when the task is long, tool-heavy, and fairly tolerant of OpenAI ownership. Think repository investigation, document processing, or an internal research job that can run for hours and return an artifact. OpenAI says the managed harness handles context compaction, tool search, programmatic tool calling, and multi-agent orchestration. Its launch example enables up to 3 concurrent subagents, enough to split an investigation into independent work without writing a scheduler first.
That last detail matters more than the marketing language. A long-running agent is a small distributed system. It needs a loop, state, retries, tool permissions, a workspace, cleanup, and a way to decide whether the task actually finished. The managed API gives you those pieces as a service. If you would otherwise spend two weeks building and debugging them, the trade may be sensible.
The Agents SDK is better when the agent is part of your product rather than a job you submit to a service. You may need approval records in your own database, a customer-visible audit trail, a model router, a custom retry policy, or a hard limit on which tools can run at each state. The SDK still gives you an agent runner and handoffs, but your team owns the runtime boundary. That is more work. It is also where your product logic belongs.
Responses API is the boring answer for many features. If the user submits text, your service calls a model, and you return structured output, do not add an autonomous runtime because the word agent is fashionable. The official comparison rates the integration effort as high for Responses API, but that describes building a full agent from scratch. A single controlled model call can still be the simplest and safest system.
The control you give up
There is no additional fee for the Agents API itself. That does not mean it is free. You still pay for model tokens, built-in tools, and sandbox usage. A workflow that retries, calls web search repeatedly, delegates to three subagents, and keeps a large session alive can cost more than its first API request suggests. Put a budget around the whole session, not just around the model call.
The bigger issue is data handling. The current Agents API documentation says it supports data residency only in the United States and does not support Zero Data Retention. Picking a self-hosted sandbox does not remove that limitation because the managed harness still owns the session. If your security review requires ZDR or non-US residency, this is a stop sign, not a checkbox for later.
Sandbox choice still matters. OpenAI provides a hosted environment, self-hosted sandboxes, and integrations with 9 sandbox providers: Blaxel, Cloudflare, Daytona, DigitalOcean, E2B, Modal, Oracle, Runloop, and Vercel. The sandbox controls where code runs and where files are handled. It does not turn the entire API into a self-hosted system. Keep that distinction visible in your architecture diagram.
There is another catch that does not fit neatly in a feature table: completion can be ambiguous. A session can finish its turn while the underlying task is incomplete. An open Codex issue from September 12 describes a user-reported financial audit that consumed about 8 hours and 3 weekly allowance resets before the user stopped it. The report does not prove a universal platform failure, and it does not provide an independently verified token bill. It does show why your application still needs an external acceptance test. A green session event is not the same thing as a correct business result.
That point is easy to miss when the harness is managed. Your service should own the task ID, user authorization, tool policy, approval record, expected artifact, and acceptance result. The model can propose actions and the harness can run them, but your database should decide whether the requested outcome exists. This is the same boundary problem discussed in why agents need a boundary before more tools, now applied to a hosted runtime.
A safer first deployment
Start with one workflow that produces a concrete artifact. A useful first test is repository triage: provide a branch or archive, ask the agent to inspect it, and require a report with file paths, evidence, and a fixed schema. Disable network access unless the task needs it. Give the sandbox only the files and tools that task requires. Do not begin with an agent that can send email, modify production data, and create its own credentials.
Wrap the session in your own control plane. Store an application task ID next to the Agents API session ID. Record the model, tools, environment, user approval, start time, end time, token usage, and artifact checksum. Add a deadline and a spend ceiling. When the session completes, validate the artifact against a schema and run a domain-specific check. If validation fails, mark the task failed even if OpenAI reports a completed turn.
Use the managed API when the harness is the part you do not want to maintain. Use the SDK when the orchestration rules are part of your product. Use Responses API when the feature does not need an autonomous loop. That decision will save you more trouble than another round of model comparisons.
The Agents API makes agent infrastructure easier to buy. It does not make control optional.
Sources
- OpenAI Agents API announcement: public beta, managed Codex harness, sandbox choices, three-subagent example, and pricing statement
- OpenAI Agents runtime comparison: ownership, state, execution environment, and integration-effort differences
- Agents API overview: session retention, residency, ZDR, tools, and API architecture
- OpenAI Agents API community announcement: sandbox integrations and early operator questions about container pricing
- Codex harness completion issue: a user-reported long-running task failure and its stated limits