Agents API vs Agents SDK vs Responses API: OpenAI Compared
The Short Answer
| Responses API | Agents SDK | Agents API (new, Sep 10, 2026) | |
|---|---|---|---|
| What it is | One model call; you build the loop | Open-source library that runs the loop in your process | Hosted Codex harness that runs the loop for you |
| Who runs orchestration | You | You (library code) | OpenAI |
| State | Optional conversation object | In your process/store | Durable session on OpenAI’s side |
| Sandbox / code execution | Built-in tools only (e.g. code interpreter) | Whatever you wire up | OpenAI-hosted, self-hosted, or 9 partner sandboxes |
| Compaction | DIY | Configurable in code | Automatic near the context limit |
| Subagents | DIY | Handoffs/agents-as-tools you define | multi_agent with max_concurrent_subagents |
| Long sessions (hours–days) | Painful | Possible with your infra | Designed for it; steer and resume |
| Extra platform fee | None | None | None — tokens + tools + container rates |
| ZDR | Available per endpoint policy | Depends on the endpoint you call | Not supported |
| Data residency | Per platform policy | Per endpoint | US only |
| Maturity | GA | GA | Public beta |
Rule of thumb: Responses for control and compliance, Agents SDK for a loop you own, Agents API for cloud agents that must run long and you’d rather not babysit.
Responses API: the raw material
The Responses API is a single model turn with tools attached. It is the right primitive when the “agent” is a few steps of tool use inside a request you already control, when you need Zero Data Retention or regional data residency, or when latency and predictability beat autonomy. Everything else — deciding when to stop, storing history, summarising context, running commands somewhere — is your code.
Agents SDK: your loop, your servers
The Agents SDK wraps the loop: agents, tools, handoffs, guardrails, tracing. It stays in your process, which means you own tool execution and the data path end-to-end. That is exactly why it remains the answer for teams with strict security review — nothing runs anywhere they did not deploy it. The price is maintenance: every new model capability (tool search, programmatic tool calling, better compaction) is something you adopt and re-test. OpenAI’s own launch note for the Agents API says this out loud — “taking advantage of new model capabilities often means reworking your harness.”
Agents API: OpenAI runs the harness
The Agents API is the Codex harness as a service. One POST /v1/agents/sessions call with the model (gpt-6-astra in the docs), instructions, tools (programmatic_tool_calling, mcp, web_search, …), a multi_agent block and an environment creates a durable session. OpenAI then:
- provisions the sandbox (or connects to yours),
- compacts context automatically as the session nears its limit,
- loads tool definitions on demand and lets the agent filter results in code,
- spins up parallel subagents with isolated contexts,
- lets you steer mid-turn and resume later,
- emits events by stream or webhook.
The harness is versioned with each model launch, so the improvements arrive without you rewriting the loop. And the core logic is public — the open-source Codex repo — so you can read what it does.
Two hard constraints in the docs as of September 11, 2026: US data residency only and no ZDR (self-hosting the sandbox does not change this). If either is a requirement, this is not your API yet.
Cost, honestly
None of the three charges a platform fee. Token spend is identical for the same model and the same amount of work. The differences:
- Agents API adds container charges if you use an OpenAI-hosted sandbox; partner sandboxes bill you directly; self-hosted is your compute.
- Agents API may reduce tokens through tool search (definitions loaded on demand, cache preserved) and programmatic tool calling (large intermediate results never enter context). Whether this beats a well-tuned SDK loop is workload-specific — measure it on a hundred real tasks.
- Engineering time is the real line item. Compaction, subagent coordination and long-session recovery are weeks of work in the SDK and configuration in the Agents API.
Decision guide
| Situation | Pick |
|---|---|
| ZDR contract, EU/UK data residency, regulated data | Responses API (or SDK on a ZDR-eligible endpoint) |
| Short interactive assistant inside your app | Responses API |
| You need to own every byte of the execution path | Agents SDK |
| Multi-hour research, coding or data-analysis agents | Agents API |
| Many parallel subtasks with a merge step | Agents API (multi_agent) |
| You already run an SDK loop and it works | Stay — the Agents API is a migration, not an upgrade switch |
| Prototype in an afternoon with a sandbox | Agents API, OpenAI-hosted sandbox |
What to watch
The Agents API is in public beta; OpenAI says it will “iterate quickly” toward GA. The two things that would change this comparison most are ZDR support and non-US residency. Until then, the honest split is: compliance-first teams stay on Responses/SDK, velocity-first teams move heavy agents to the Agents API.