OpenAI opened its Agents API to all developers on September 11 — the same managed harness that powers Codex and enterprise ChatGPT is now accessible to anyone with an API key. This is not a new SDK wrapper or a rebrand of the Responses API. It is the orchestration infrastructure that dev teams have been building from scratch for years: durable sessions, automatic context compaction, parallel tool calls, subagent delegation, and a hosted sandbox — all behind a single API call. OpenAI’s announcement frames it plainly: supply the task, model, tools, and environment in one call, and the platform handles the rest.
The interesting part is not the new capability. It is that OpenAI productized the infrastructure layer. Most teams spend weeks building the harness before they ever ship their first agent. That friction is now optional.
Four Primitives, One Architecture
The Agents API is built around four concepts. Understanding them determines where you plug in:
- Agent — The model, instructions, tools, and MCP servers. What the agent knows and can do.
- Session — A durable state container that persists across turns and survives context overflow via automatic compaction.
- Sandbox — An OpenAI-hosted compute environment for running code, accessing files, and producing artifacts. You can supply your own sandbox or use none.
- Events and Items — Streaming I/O. Inputs go in, outputs come out, and you consume them as a stream.
The design is deliberately flat. You do not configure a pipeline or a DAG. You describe an agent, start a session, and provide input. OpenAI handles context compaction, orchestration, recovery, and subagent delegation. You handle the domain logic.
What You Stop Building
Before the Agents API, building a reliable long-running agent meant writing your own session state management, context windowing, retry logic on tool failures, subagent spawning and result collection, and compaction to prevent context overflow on multi-hour runs. That is not a small amount of plumbing.
The Agents API absorbs all of it. It runs up to six subagents simultaneously on a single session, and they share a filesystem. Tool search loads only the definitions relevant to the current step, which keeps token consumption in check. Context compaction runs automatically as a session approaches its limit — no summarization logic required on your end. The official API overview covers the full feature set.
The Minimal Viable Session
from openai import OpenAI
with OpenAI() as client:
with client.beta.agents.sessions.create(
agent={
"model": "gpt-6-astra",
"instructions": "Write clean code, run it, and report the actual output.",
},
environment={"type": "openai_hosted"},
input="Create tree.py that prints a readable directory tree. Run it and show the output.",
stream=True,
) as events:
for event in events:
print(event.to_json(indent=None), flush=True)
You need a billing-enabled OpenAI account and a project-scoped API key with three permissions: api.agents.read, api.agents.write, and api.responses.write. The quickstart guide walks through the full setup. That is the full setup for a hosted agent that runs code.
Early Numbers
OpenAI cited three early-adopter results in its launch post. SafetyKit cut its cost per trust-and-safety case review by 60% after migrating to the managed harness. Hypha reduced failed agent responses by 86% after separating the harness from the sandbox. Ciridae moved its evaluation score from 0.71 to 0.85 while cutting latency by 75%.
These are production gains, not benchmark numbers. SafetyKit handles bursty content review workloads — fanning out across hundreds of agents asynchronously is something the Agents API handles natively. The SafetyKit case study details how the migration worked in practice.
Pricing and the Real Trade-Off
There is no separate platform fee. You pay standard token rates for whichever model you use plus tool rates for built-in tools. The model range runs from gpt-5.6-luna at $0.20 input / $1.20 output per million tokens up to gpt-6-astra at $10 / $50. Cached input bills at 10% of standard rates. Web search costs $10 per 1,000 queries plus model tokens for the results.
The trade-off is real: you are handing OpenAI the orchestration layer. Your agent harness becomes an OpenAI-managed dependency. If you need model portability or want to run the same harness against Anthropic or open-weight models, LangGraph is still the right tool. If you want to ship a production-grade agent without building infrastructure, the Agents API makes that case easier to defend.
Either choice is defensible. But for teams currently maintaining custom orchestration code against the Responses API, the migration path to the Agents API is worth running the numbers on.













