AI agents · OpenClaw · self-hosting · automation

Quick Answer

Agents API vs Agents SDK vs Responses API: OpenAI Compared

Published:

The Short Answer

Responses APIAgents SDKAgents API (new, Sep 10, 2026)
What it isOne model call; you build the loopOpen-source library that runs the loop in your processHosted Codex harness that runs the loop for you
Who runs orchestrationYouYou (library code)OpenAI
StateOptional conversation objectIn your process/storeDurable session on OpenAI’s side
Sandbox / code executionBuilt-in tools only (e.g. code interpreter)Whatever you wire upOpenAI-hosted, self-hosted, or 9 partner sandboxes
CompactionDIYConfigurable in codeAutomatic near the context limit
SubagentsDIYHandoffs/agents-as-tools you definemulti_agent with max_concurrent_subagents
Long sessions (hours–days)PainfulPossible with your infraDesigned for it; steer and resume
Extra platform feeNoneNoneNone — tokens + tools + container rates
ZDRAvailable per endpoint policyDepends on the endpoint you callNot supported
Data residencyPer platform policyPer endpointUS only
MaturityGAGAPublic 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

SituationPick
ZDR contract, EU/UK data residency, regulated dataResponses API (or SDK on a ZDR-eligible endpoint)
Short interactive assistant inside your appResponses API
You need to own every byte of the execution pathAgents SDK
Multi-hour research, coding or data-analysis agentsAgents API
Many parallel subtasks with a merge stepAgents API (multi_agent)
You already run an SDK loop and it worksStay — the Agents API is a migration, not an upgrade switch
Prototype in an afternoon with a sandboxAgents 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.

Sources