OpenAI Agents API vs Agents SDK vs Responses API: What Should You Build On in 2026?

OpenAI's agent stack changed materially in September 2026. The new Agents API introduced a managed Codex harness for durable cloud agents, while the older Agents SDK moved into a feature-complete maintenance phase. The Responses API remains the lower-level surface for applications that want direct model calls or to own the agent loop themselves. These are not three interchangeable wrappers around the same thing: they place the runtime boundary in different places.
The architecture changed: choose a runtime boundary, not a library
The important decision is no longer simply “Which SDK should I install?” It is who owns the harness, the agent loop, durable session state, context compaction, recovery, execution environment, and application lifecycle.
OpenAI's current Agents overview makes this boundary explicit. The Agents API runs a hosted Codex harness and manages orchestration plus durable session state. The Responses API provides model responses and hosted capabilities while your application owns the surrounding agent loop. The Agents SDK runs the loop in your application and is now feature complete rather than the forward path for major new agent features.
The short comparison
| Option | Best fit in 2026 | Who owns the agent loop? | Session / context responsibility | Strategic status |
|---|---|---|---|---|
| Agents API | New OpenAI-native durable agents | OpenAI-managed Codex harness | OpenAI manages sessions, orchestration, compaction and recovery | Recommended starting point for new agent apps; public beta |
| Responses API | Direct model integrations and custom agent runtimes | Your application | You choose response chaining, Conversations, storage and loop logic | Core API primitive; recommended over Chat Completions for new projects |
| Agents SDK | Existing SDK applications or temporary capability gaps | Your application via the SDK runner | Your application operates deployment, storage and runtime behaviour | Feature complete; maintenance and compatibility continue, major new features not planned |
| Codex SDK | Codex harness in infrastructure you operate | Codex harness in your environment | You operate harness hosting and lifecycle | Separate option when you want the harness without the hosted Agents API runtime |
1. Agents API: managed harness, durable cloud agent
The Agents API exposes the Codex harness through an OpenAI-managed service. OpenAI manages sessions, orchestration, context compaction, and recovery. Your application still provides tools and chooses the execution environment.
That last distinction matters. “Managed agent” does not necessarily mean “all compute runs inside OpenAI.” The Agents API architecture supports no environment, an OpenAI-hosted environment, or a self-hosted environment connected to the hosted harness. With a self-hosted environment, your application owns provisioning, reconnection, shutdown, and persistent files while the harness remains managed.
The Agents API is therefore a runtime service, not merely a request format. Sessions can persist, stream progress, receive additional tasks, use tools, work with files, and recover across long-running work.
What you gain with the Agents API
- A managed Codex harness instead of building and operating the main agent loop yourself.
- Durable sessions for work that spans turns and long-running tasks.
- Managed orchestration, context compaction, and recovery.
- OpenAI-hosted or self-hosted execution environments, depending on workload requirements.
- Streaming and webhooks for progress and lifecycle events.
- A platform direction that OpenAI explicitly recommends for new agent applications.
What you still own
- Your product and application server.
- Function-tool implementations and business logic.
- Authorization and policy decisions around your own systems.
- The execution environment lifecycle when you choose self-hosted compute.
- Evaluation, acceptance criteria, domain-specific guardrails, and the decision of what the agent is allowed to do.
2. Responses API: own the loop, use the platform primitives
The Responses API is the lower-level choice when you want OpenAI model and tool capabilities without delegating the overall agent runtime. OpenAI describes Responses as the recommended API primitive for new projects and as an evolution of Chat Completions with built-in tools, multi-turn state options, multimodal input, and agentic tool use.
A Responses request can itself invoke tools, but your application remains responsible for the larger workflow when you build an agent around it. That means your code decides how to persist application state, when to continue, how to recover, how to coordinate specialists, how to compact long histories, and how to represent resumable work.
This is not inherently inferior. It is the right boundary when agent behaviour must be deeply embedded in existing application logic, when you need a custom state model, or when a managed harness would hide control you actually need.
3. Agents SDK: supported, but no longer the default forward path
The Agents SDK remains an open-source framework for running agent workflows in your application. It provides agent definitions, tools, handoffs, guardrails, tracing, sessions, and the runner loop in TypeScript and Python.
But its strategic status changed. OpenAI now labels the Agents SDK feature complete: maintenance, security fixes, critical bug fixes, and compatibility work continue, but major new features are not planned. OpenAI recommends the Agents API for new applications.
That does not mean an existing SDK application should be rewritten immediately. It means the architecture should stop assuming that the SDK is where the next major agent-runtime capabilities will land.
Where the Codex SDK fits
The current choice is not a simple three-way fork. OpenAI's runtime overview includes the Codex SDK as the option for running the Codex harness in infrastructure you operate. That is architecturally different from both the hosted Agents API and the Agents SDK.
If your real requirement is “I want the Codex harness, but I need to operate it myself,” the Codex SDK is the surface to evaluate. If your requirement is “I want to own the loop around model calls,” evaluate Responses. If your requirement is “I already have a working Agents SDK application,” the existing SDK can remain valid while you plan against its maintenance status.
The Runtime Ownership Test
A useful architecture decision starts by deciding what your team must own. Score each requirement as either must control, prefer to control, or prefer managed.
Runtime Ownership Test
| Decision | If you prefer managed | If you require control | |
|---|---|---|---|
| Agent loop | |||
| Durable sessions | |||
| Harness runtime | |||
| Execution environment | |||
| Orchestration semantics | |||
| Provider / transport flexibility | |||
| Operational burden |
A decision tree for new systems
Choose the runtime by the control boundary
What should not drive the decision
| Weak decision rule | Why it fails | Better question |
|---|---|---|
| “The newest API must be best.” | Newer can be strategically preferred while still lacking a capability you need. | Which runtime responsibilities should be managed versus application-owned? |
| “We already know the SDK.” | Team familiarity can preserve an architecture whose roadmap has changed. | What is the cost of staying versus moving over the next product cycle? |
| “Managed means no infrastructure.” | Agents API can still use self-hosted environments and your application still owns product logic. | Which infrastructure layer is actually being delegated? |
| “Responses is only for simple calls.” | Responses provides built-in tools and stateful primitives; it can be the foundation of custom agent loops. | Do we need the platform to own the harness, or only model/tool primitives? |
| “Feature complete means we must migrate now.” | The SDK remains maintained for existing applications. | What concrete future requirement is blocked by staying? |
Migration is an architectural change, not an import rename
Moving from the Agents SDK to the Agents API changes ownership. In the SDK, the loop runs in your application. In the Agents API, OpenAI runs the harness and session while your application integrates through tasks, events, tools, and environment boundaries.
A real migration plan therefore needs to map session state, custom orchestration, handoffs, tool execution, approvals, storage, tracing, retries, failure recovery, environment lifecycle, and any provider-specific abstractions. Code volume may fall while operational assumptions change.
The migration inventory
- Agent definitions and instruction ownership.
- Tool definitions and where each tool executes.
- Handoffs, manager/specialist patterns, and subagent behaviour.
- Session identifiers, conversation state, resumability, and history retention.
- Human approvals and interruption semantics.
- Custom context trimming or compaction logic.
- Tracing, evals, observability, and production debugging.
- Self-hosted files, containers, private-network access, or other execution dependencies.
- Provider abstraction or non-OpenAI model dependencies.
- Retry, timeout, idempotency, recovery, and lifecycle assumptions.
Public beta changes the risk model
The Agents API is the recommended direction for new agent applications, but it is also in public beta. Those facts are not contradictory. Strategic direction answers “where is the platform going?” Beta status answers “how much interface and operational change should I budget for?”
For production systems, isolate the integration behind an application boundary. Keep domain state, permissions, audit data, and business rules outside vendor-specific session objects where possible. This makes it easier to absorb API evolution without turning the agent runtime into the source of truth for your entire product.
A practical default architecture
For many new OpenAI-native applications, a reasonable 2026 default is: Agents API for the managed harness and durable session, application-owned domain services and authorization, explicit function tools for business actions, and either OpenAI-hosted or self-hosted execution depending on data and compute requirements.
That keeps the agent runtime powerful without making it the owner of business truth. The application still decides what a user may do, which data is authoritative, which actions require approval, and how results are validated.
What would change this answer?
The recommendation changes if the Agents API adds or removes capabilities, exits beta with different contracts, changes environment or pricing boundaries, or introduces migration tooling that reduces ownership differences. It also changes if your application depends on provider portability, custom orchestration semantics, local-only execution, or a capability the hosted harness cannot support.
For an existing Agents SDK application, the answer also changes with migration cost. If the system is stable, well evaluated, and not blocked by the SDK's feature-complete status, immediate migration may create more risk than value. If the product roadmap depends on capabilities landing only in the Agents API, delaying migration can create a different kind of debt.
Limitations
This comparison focuses on runtime ownership and OpenAI's stated platform direction. It does not benchmark latency, quality, or total cost for a specific workload. Those properties depend on model choice, tool usage, environment, task length, caching, sandbox usage, and application architecture.
The Agents API is also new enough that production experience is still accumulating. A design should therefore be validated with representative workloads rather than chosen solely from product positioning.
Conclusion
The 2026 OpenAI agent decision is fundamentally about runtime ownership. Agents API means OpenAI owns more of the harness and durable-session machinery. Responses means your application owns the loop around platform primitives. The Agents SDK remains valid for existing systems but is no longer the default destination for major new agent-runtime features.
For a new application, follow the platform direction unless a real requirement pushes you lower in the stack. Start with the Agents API, move to Responses when you need to own the loop, evaluate Codex SDK when you need the harness in your infrastructure, and keep the Agents SDK where existing investments or temporary capability gaps justify it.
FAQ
OpenAI agent runtime choices in 2026
Should I use the OpenAI Agents API or Agents SDK for a new project?
Is the Agents SDK deprecated?
When should I use the Responses API instead of the Agents API?
Does the Agents API require OpenAI-hosted compute?
Where does the Codex SDK fit?
Should an existing Agents SDK app migrate immediately?
Glossary
Key runtime terms
- Harness
- The runtime loop and supporting machinery that coordinates model calls, tools, context, sessions and agent execution.
- Agents API
- OpenAI's managed API for durable cloud agents using a hosted Codex harness.
- Responses API
- OpenAI's lower-level API primitive for model responses, hosted tools and stateful interactions around which applications can build their own agent loop.
- Agents SDK
- OpenAI's open-source framework for running agent workflows in application code; feature complete as of September 2026.
- Codex SDK
- The runtime option OpenAI lists for running the Codex harness in infrastructure you operate.
- Runtime ownership
- The architectural boundary describing which parts of the agent loop, session state, execution environment and lifecycle are operated by the platform versus the application.
Primary sources and further reading
OpenAI — Introducing the Agents APILaunch announcement for the Agents API on 10 September 2026, describing the managed Codex harness and public beta.
OpenAI — Agents runtime overviewCurrent comparison of Agents API, Codex SDK and Responses API, including the support status of the Agents SDK.
OpenAI — Agents API overviewDocumentation for durable cloud agents, sessions, orchestration, context compaction, recovery and environment choices.
OpenAI — Agents API architectureArchitecture boundary between the hosted harness, application server and no/openai-hosted/self-hosted execution environments.
OpenAI — Agents SDKCurrent Agents SDK support notice and explanation of the application-owned agent loop.
OpenAI — Migrate to the Responses APICurrent Responses API positioning, built-in tools, stateful context and agentic primitives.
Related Articles

Enterprise-Grade Multi-Tenant Architecture for an International Platform
Loving Rocks is an enterprise-grade wedding platform designed with a true multi-tenant architecture, isolated databases per tenant, and built-in internationalization for global scalability, security, and long-term operational stability.

A Practical Monorepo Architecture with Next.js, Fastify, Prisma, and NGINX
Explore a practical monorepo architecture using Next.js, Fastify, Prisma, and NGINX, highlighting real-world integration and workflow.

MCP vs A2A vs UCP vs AP2 vs A2UI: The Agent Protocol Stack Explained
MCP, A2A, UCP, AP2 and A2UI are often presented as competing agent standards. They mostly solve different interoperability problems. This guide maps each protocol to the boundary it actually standardizes—and shows how they can work together in one production system.

What Is RAG? The Simplest Explanation of How It Works
RAG sounds complicated, but the idea is simple: before an AI answers, it first looks up useful information from a knowledge source and gives that information to the language model. This guide explains RAG, LLMs, state, memory and tools using one simple mental model.