OpenAI Agents API: Architecture, Pricing & Responses API Differences

The OpenAI Agents API is a managed, currently beta agent harness for durable software-engineering tasks. OpenAI manages sessions, orchestration, context compaction and recovery; your application still chooses the environment and tools and controls permissions and external side effects.

Published September 11, 2026 · Verified against official OpenAI developer documentation

Quick answer

What the Agents API manages

The API gives an agent a durable session in which it can run code, edit files, connect to MCP servers and produce artifacts inside a sandbox. OpenAI manages the execution harness, including turn orchestration, context compaction and recovery. The application supplies or selects the environment and exposes the tools the agent may use.

The current documentation and examples use the beta API namespace and the OpenAI-Beta: agents=v1 header. Treat the interface as beta and plan for change rather than describing it as generally available.

Agents API vs Agents SDK vs Responses API

OptionWho runs the loop?Best fit
Agents APIOpenAI managed harnessDurable cloud agents, managed sessions and sandboxed engineering work
Agents SDKYour application using SDK primitivesCustom orchestration, handoffs, guardrails and application-owned workflows
Responses APIYour applicationDirect model requests and explicit tool calls with maximum control

How pricing works

OpenAI does not publish one flat price for an Agents API run. Budget each layer separately:

A realistic estimate therefore needs expected turns, tokens per turn, tool calls, sandbox duration and external service costs. Use the AI agent cost calculator for a workload estimate, then replace assumptions with trace data from a representative test set.

Sessions, turns and observability

A session preserves working context across turns. Traces and logs help teams inspect model calls, tool activity, timing and failures. A completed turn does not prove every requested tool action succeeded, so applications should verify important outcomes explicitly.

Security and responsibility boundaries

Managed does not mean permissionless. Your application remains responsible for tool scopes, approval gates, secret handling, data retention and confirmation before consequential external actions.

Expose only the tools and credentials required for the task. Validate artifacts before deployment, require human approval for irreversible actions and keep external side effects idempotent where possible.

When to choose it

Official OpenAI sources

Related APIpulse guides