OpenAI's New Agents API: What It Is?
OpenAI's New Agents API: What It Is, What It Isn't, and When Not To Use It
Khalil Ur Rehman
Author

OpenAI's New Agents API
Building an AI agent that runs for hours instead of seconds means you've had to write a lot of infrastructure yourself: loops, state storage, sandboxes, retries and recovery. On September 10, 2026, OpenAI published a public beta of the Agents API to take most of that effort off developers' hands. Here is what it is, how it is used, what it is useful for and where it does not fit.
What Is the OpenAI Agents API?
The Agents API allows developers to use the same infrastructure and harness that powers OpenAI's Codex and ChatGPT products with a single API request. In simple terms, OpenAI now manages the "agent loop" on your behalf. It's a managed service that runs the open source Codex agent harness.
Most teams created agents on top of a model API and wrote their own orchestration code. You tell the work via the Agents API, and OpenAI runs the machinery.
What Is It Used For?
You can set up an agent with one API call, providing the task, model, tools and environment. From there the agent operates within a persistent session. According to OpenAI's changelog, the platform supports session orchestration, context compression, and recovery.
A typical workflow might be:
Create a session with your task, model, tools and environment
Have the agent plan and work through the processes, utilizing tools as appropriate
Follow up on progress, handle approvals, and gather results
Resume the same session later if needed
At the time of writing, the API is hit with a beta header (OpenAI-Beta: agents=v1). You will also require a recent version of the official OpenAI SDK.
Main Advantages
Less infrastructure has to be built. Session handling, recovery and context management are taken care of for you.
Built for the long haul. Sessions are designed to withstand long work and not lose sight of progress.
Parallel work of subagents. The agent can break the work into parts and run them in parallel.
A multi-purpose instrument. The API allows MCP, online search, custom functions and built-in utilities.
Openness. The harness is run and maintained by OpenAI, although its codebase is public for developers to look at.
No extra platform fee. OpenAI says there are no additional charges for the API itself, you pay normal prices for tokens and tool usage.
One company, Ciridae, saw its assessment score go from 0.71 to 0.85, and a 4x latency reduction for subagent operations. This is a vendor published customer result, thus treat it as a data point and not a guarantee.
Topic 1: Session Management
In short, a session is the unit of work. You don't need to create your own state layer. The settings, turns, and objects are stored on the OpenAI side.
Longer challenges keep sessions alive
As history increases, context compression allows the agent to keep functioning
The platform takes care of the recovery
Less code to write, test and maintain
Topic 2: Sandboxes
So, simply put: code-running or file-touching agents require a safe space to play. You can select a sandbox that suits your application, including OpenAI-hosted sandboxes, through the API.
Separates agent activities from your main systems
No need to provision and manage your own execution environment
Provides a stable work area for the agent during a session
Topic 3: Tools and MCP Support
To summarize: agents are only as good as the instruments at their disposal.
Connect to external systems via MCP
Create your own custom functions
Use the built-in features like web search
The platform allows agents to choose and deploy tools in an effective manner
Topic 4: Subagents and Parallelization
Briefly: complex jobs can be divided into segments and processed simultaneously.
Good for research, code review, data collection and multi-file updates
Can cut total time for assignments that divide nicely
Requires clear task limits to prevent duplication or conflicting tasks
Topic 5: Price and Availability
TLDR: The API is currently in public beta and is open to all developers, with OpenAI stating that it will be iterating rapidly on feedback on the route to general availability.
No API charge, only tokens and tool usage
Agents can burn through many tokens in long sessions, so set budgets and watch consumption
Beta status indicates behavior, interfaces and limitations may change
What the Agents API Is
A controlled runtime for long running multi-step agents
A way to run OpenAI's Codex-style harness without self-hosting
A session based system with built in orchestration, compaction and recovery
Good for coding, research, and other tool-heavy tasks
An inspectable system, since the harness code is public
What the Agents API Isn't
Not a replacement of ordinary model calls. You don't require an agent runtime for simple prompt and answer jobs.
Not quite hands free. You still have to design tasks, permits, approvals and evaluation.
Not yet a stable, finished product. This is a public beta, and specifics are subject to change before general availability.
Not a fully self-hosted alternative. OpenAI has the loop. It saves session data.
Not the only OpenAI agent path. Agents SDK is designed for agents where the loop, storage, and approvals remain in your own app, and Responses API is for direct model calls with your own orchestration.
When Not To Use It
You need tight controls on how you handle data. One third-party comparison states that "as of writing, teams that require zero data retention (ZDR) or EU data residency currently are not able to use the Agents API today." Check the current state in the documentation for OpenAI before committing.
You want to have total control of the agent loop. If your product relies on bespoke orchestration, your own storage, or unique approval flows in your app, then the Agents SDK or the Responses API will probably be a better fit.
Your job is basic and short. A single model call or tiny, fixed pipeline is cheaper and easier to debug than a full agent session.
You need production-grade stability now. Beta APIs evolve. If breaking changes are expensive, wait for General Availability or wrap the integration behind your own interface.
You don't want to be tied to one vendor. Managed harness and hosted sessions tie you more tightly to one supplier. If portability is important, build an abstraction layer.
You need to have very predictable costs. Long-running agents can use a lot of tokens. Spend can expand fast without limitations and without supervision.
Getting Started: Helpful Hints
Start with a focused, well-defined workflow, not a general-purpose agent
Evaluate before scaling so you can assess whether results improve
Enforce least-privilege access per tool and sandbox
Have a human approval step for any irreversible action
Set a token and time limit per session
Log sessions to audit and debug agent behavior
Concluding Thoughts
The Agents API doesn't make agents easy, but it does remove a big amount of the undifferentiated engineering underlying agents. If you're on a team that builds long-running, tool-heavy processes, it's worth checking out today. If compliance is severe, or bespoke orchestration is required, or use cases are basic, then other technologies may be appropriate for you. As with any beta, test carefully, keep your architecture flexible, and check OpenAI's official documentation for the latest specifics.