Claude Agent SDK vs OpenAI Agents SDK 2026: Which Agent Do You Ship?
Key takeaways
- The split is who owns the loop and the environment: Claude ships Claude Code's whole agent loop — file, shell, and web tools, permissions, sessions, hooks — inside your process. OpenAI ships small primitives — Agents, handoffs, guardrails — and you bring the tools and the sandbox.
- Versions checked Nov 24, 2026: Claude Agent SDK TypeScript 0.3.331 and Python 0.2.188 (both Nov 23); OpenAI Agents SDK Python 0.25.0 (Nov 18) and JavaScript 0.22.0 (Nov 12). Both are pre-1.0, so a minor bump can still break your build.
- Neither SDK charges a fee. The bill is model tokens, and the workhorse models cost the same on both sides — Claude Sonnet 5.5 and GPT-6.1 Sol are both $2 per million input tokens and $10 per million output tokens — so the model tier decides the cost, not the SDK.
- Claude runs Claude models only. OpenAI's SDK is model-agnostic and runs 100+ models through providers, and it is the only one of the two with voice and realtime agents built in.
- Wrong fit: pick Claude when you need another model, pick OpenAI when you need a coding agent that already knows how to read, edit, and run code. If you want no operations work at all, neither — that job is a hosted runtime.
These two SDKs solve the same problem from opposite directions. Claude Agent SDK hands you Claude Code’s whole agent loop — the file tools, the shell, the permissions, the sessions — as a library that runs inside your process. OpenAI Agents SDK hands you a small set of primitives — an agent, a handoff, a guardrail — and leaves the tools, the sandbox, and the environment to you.
| Job | Lean Claude Agent SDK | Lean OpenAI Agents SDK | Neither |
|---|---|---|---|
| Coding agent that reads, edits, and runs code | The whole Claude Code loop and its built-in tools, in your process | Bring your own file tools and sandbox; the loop itself is light | A hosted runtime — Managed Agents Compared runs the loop for you |
| Support or triage with handoffs between specialists | Subagents under one orchestrator that keeps control | Handoffs that pass the conversation to the specialist who owns the answer | A drag-and-drop builder — Agent Builder shuts down Nov 30, 2026, see OpenAI Agent Builder Shuts Down |
| Voice agent | No voice support | Realtime Agents and voice pipelines built in | A voice platform such as Retell — not either SDK |
| One agent, many models | Claude models only | Any model through providers such as LiteLLM | LangGraph, where you assemble the loop yourself and pick any model |
One build runs the same job through both SDKs, so the rest of this page has something to stand on. Kusuma built the same support agent in both — a customer whose order never arrived, two tools (look up the order, issue the refund), one rule (refundable orders get refunded, the rest escalate to a human) — in August 2026, with Claude Agent SDK 0.2.131 and OpenAI Agents SDK 0.19.4 on Python 3.10. What it showed: Claude’s version wraps the two tools in an in-process MCP server and gets the file and shell tools and the permission system without extra work; OpenAI’s version defines the tools as typed functions, hands escalation to a second agent, and gets built-in tracing for free. No tokens, latency, or cost were measured — the build shows the shape of the code, not the size of the bill. My check on it: both SDKs moved since August. Claude’s November releases changed the sandbox and hook defaults, and OpenAI’s 0.25.0 removed the beta Runloop sandbox provider, so treat the code as a shape guide and read the current docs before copying either snippet. The sections below use the November versions and the November prices.
Who each tool is for
You are building a coding agent, a repo chore bot, or anything that has to read a codebase, edit files, and run commands. That is the Claude Agent SDK’s job. Anthropic’s own docs describe it plainly: the same tools, agent loop, and context management that power Claude Code, programmable in Python and TypeScript. You get Read, Write, Edit, Bash, Glob, Grep, WebSearch, and WebFetch without writing any of them, plus subagents, hooks, permissions, and sessions, and skills, commands, and memory loaded from your project’s .claude/ directory the way Claude Code loads them. The trade is model choice: Claude only, because the SDK bundles and drives the Claude Code binary.
You are building a text agent with tools, routing, and delegation — support tiers, content pipelines, approval chains — especially on the OpenAI stack. That is the OpenAI Agents SDK’s job. The primitives are small on purpose: an Agent with instructions, tools, and guardrails; a Runner that drives the loop; handoffs that pass the conversation to a specialist; sessions that keep the history; tracing that records every step. You bring your own tools and your own execution environment, and in return the SDK stays light and model-agnostic — OpenAI’s own package page says it supports the Responses and Chat Completions APIs plus 100+ other models.
Already running one of the plan-bundled agents and wondering whether the SDK is the same thing with a different name? It is not. Claude Code vs Codex picks between two $20 plan pools; this page picks between two libraries you embed in your own app and pay for by the token.
Interface and how you build
The biggest difference is where the loop lives relative to the sandbox, and OpenAI’s own migration guide from the Claude Agent SDK states it more clearly than any third-party table. In the Claude pattern, the harness runs inside the sandbox: the agent loop, the tools, the filesystem, and the execution environment share one boundary. In the OpenAI pattern, the harness is separate from compute: your trusted application runtime owns the loop, the tools, the approvals, the secrets, and the guardrails, and the sandbox is a tool the harness calls when the agent needs scoped compute, filesystem access, or code execution. Secrets and approval decisions stay outside the execution environment on the OpenAI side; on the Claude side they live inside the sandbox boundary with the agent.
That split shows up in the first hour of building. With Claude, you configure ClaudeAgentOptions — system prompt, allowed tools, MCP servers, permission mode — and call query() for one-shot work or ClaudeSDKClient for a session. Custom tools are async functions wrapped in @tool and served through an in-process MCP server, so there is no subprocess or JSON-RPC plumbing to debug. With OpenAI, you define an Agent with instructions and tools, and Runner.run() drives it. Custom tools are plain functions decorated with @function_tool; the schema comes from the type hints and docstring, so there is less code per tool and less explicit control over the schema the model sees.
Both SDKs speak MCP. Anthropic created the protocol, so the Claude side treats MCP servers as first-class: the SDK manages the connection lifecycle and your custom tools arrive as an in-process server. OpenAI added MCP support in v0.7 and annotated converted tools in 0.24.0; it works, but expect more manual wiring. If MCP is the center of your architecture, that gap is real. If it is one integration among many, it is not the deciding factor.
Where it caps out: Claude starts to feel like the wrong buy the moment you need a non-Claude model — there is no provider switch, only Claude. OpenAI starts to feel like the wrong buy the moment you need the agent to work on files and run shell commands out of the box — you will build that surface yourself, including the sandbox it runs in.
Multi-agent, guardrails, and sessions
Multi-agent work is where the two designs diverge most. Claude uses subagents: the orchestrator spawns child agents for focused subtasks, they run in the background by default, they can nest, and the parent keeps control and decides what happens with each result. OpenAI uses handoffs: when one agent meets work better suited to another, it transfers the whole conversation, and the specialist takes over completely. OpenAI’s migration guide adds the nuance the tables miss — use agent.as_tool(...) when the lead agent should stay in control and combine specialist outputs, and handoffs=[...] when the specialist should own the final response. Support tiers and approval chains map naturally onto handoffs; deep, sequential work where one agent’s output feeds the next maps naturally onto subagents.
Guardrails follow the same split. OpenAI’s are declarative: @input_guardrail and @output_guardrail decorators, and a tripped guardrail raises GuardrailTripwireTriggered. Claude’s are hooks and permissions: hooks fire at lifecycle points such as PreToolUse and can block or reshape a call, and the permission system decides which tools run automatically, which need approval, and which are denied — including deny rules that apply even in bypassPermissions mode. Since the November releases, a hook that crashes or times out can block the action instead of letting it through (onFailure: "block", TypeScript 0.3.317 and up), and hook configurations must be arrays or the SDK refuses to start (0.3.327). Two November defaults to check before you upgrade: sandboxed Bash is no longer auto-approved unless autoAllowBashIfSandboxed is set (0.3.325), and hook values that are not arrays are rejected at startup. If your agent runs shell commands in a sandbox, these two changes decide whether your upgrade works or fails on first run — and the hardening checklist in AI Agent Security After the WorkOS Sandbox Escape is the right companion for the permissions you set around them.
Sessions and tracing are close enough that neither decides the pick. Claude manages sessions in the SDK — in-memory or resumable across processes by session ID, with archiveSession() added in 0.3.325 — and streams an event log you can export over OpenTelemetry, with per-turn token and cost figures on the result message. OpenAI offers sessions with pluggable backends (Redis is an install extra) and built-in tracing viewable in the OpenAI dashboard, exportable to any OpenTelemetry backend. One genuine gap: voice. OpenAI ships Realtime Agents and voice pipelines (gpt-realtime-2.1) as part of the SDK. Claude has no voice support.
First-hour setup (what actually differs)
Claude Agent SDK
- Install the package — TypeScript
@anthropic-ai/claude-agent-sdkor Pythonclaude-agent-sdk— on Node 18.14+ or Python 3.10+. - Set an Anthropic API key. A Claude Pro or Max login does not substitute: Anthropic’s docs say third-party developers may not offer claude.ai login or plan rate limits for products built on the SDK. The agent bills by API tokens.
- Pin the version. Both SDKs are pre-1.0, and November proved the point: the TypeScript package went through six releases in eight days, and two of them changed sandbox and hook defaults.
OpenAI Agents SDK
- Install the package — Python
openai-agentsor TypeScript@openai/agents— on Python 3.10+ or a current Node. - Set an OpenAI API key. Other models work through providers such as LiteLLM, with their own keys.
- Pin the version. OpenAI’s own versioning note says a minor bump signals breaking changes to non-beta public interfaces — 0.25.0 removed the beta Runloop sandbox provider outright.
| Package | Version checked Nov 24, 2026 | Released |
|---|---|---|
@anthropic-ai/claude-agent-sdk (TypeScript) | 0.3.331, bundles Claude Code 2.1.331 | Nov 23, 2026 |
claude-agent-sdk (Python) | 0.2.188 | Nov 23, 2026 |
openai-agents (Python) | 0.25.0 | Nov 18, 2026 |
@openai/agents (JavaScript) | 0.22.0 | Nov 12, 2026 |
One trap to skip: OpenAI also ships a native-runtime preview, 0.24.0-alpha.8 (Nov 16), distributed as wheels from GitHub releases rather than PyPI. It is a Codex-backed preview with a different API — Agent.run() instead of Runner — and it is not the stable SDK. Install 0.25.0 for production work and treat the alpha line as a preview to watch.
Licensing is a one-line difference worth knowing before you ship: both Python packages are MIT-licensed. The Claude TypeScript SDK ships without an open-source license — Anthropic’s docs put the Agent SDK under its Commercial Terms of Service.
How you are billed
Neither SDK charges a fee. You pay for the model tokens the agent burns, plus any hosted tools or sandbox compute you add. That makes the billing comparison a model comparison, and the workhorse models happen to cost the same on both sides.
| Axis | Claude Agent SDK | OpenAI Agents SDK |
|---|---|---|
| How you’re billed | Model tokens at Anthropic API rates; no SDK fee | Model tokens at OpenAI API rates; no SDK fee |
| Free entry | No free tier on the API; a Claude plan login does not substitute | No free tier on the API; other providers set their own terms |
| Workhorse model | Sonnet 5.5: $2 in / $10 out per 1M tokens | GPT-6.1 Sol: $2 in / $10 out per 1M tokens |
| Cheap tier | Haiku 5.5: $0.10 / $0.50 per 1M (prompts up to 100K tokens) | GPT-6.1 Terra: $1 / $5; GPT-6 Luna: $0.10 / $0.50 per 1M |
| Frontier tier | Opus 5.5: $4 / $20 per 1M | GPT-6 Astra: $10 / $50 per 1M |
| Cached input | Sonnet 5.5 cache reads $0.10 per 1M | GPT-6.1 Sol cache reads $0.10 per 1M |
| Batch | Batch API halves Sonnet 5.5 to $1 / $5 | Batch API halves GPT-6.1 Sol to $1 / $5 |
A worked example, at list prices as of November 2026: one task that reads 10,000 input tokens and writes 2,000 output tokens costs $0.04 on Sonnet 5.5 and $0.04 on GPT-6.1 Sol. At 1,000 such tasks a month, that is $40 either way. The same task on Opus 5.5 costs $0.08; on Haiku 5.5 or GPT-6 Luna it costs $0.002. The model tier moves the bill by 40x. The SDK moves it by nothing.
Two details change the math at scale. First, cache reads: repeated turns on Sonnet 5.5 read cached input at $0.10 per million instead of $2, so long sessions with a stable system prompt get much cheaper than the sticker rate — GPT-6.1 Sol’s cached input is also $0.10. Second, watch the calendar: GPT-6.2 Sol arrived Nov 17 at the same $2/$10 rates, and GPT-5.6 Sol’s promotional $4/$20 ends Nov 30, 2026. If you do not want to host the loop at all, the hosted runtimes change the bill instead — Claude Managed Agents adds $0.08 per session-hour on top of tokens, and the OpenAI Agents API bills tokens plus hosted tools and sandbox compute. That comparison is on Managed Agents Compared.
Example workflows I’d shortlist
- Repo chore bot that opens PRs: Claude Agent SDK. The file and shell tools are the differentiator, and the permission system handles the risky parts. The closest shortlist for the same job is on Best AI Coding Agents.
- Support triage with refund rules and human escalation: OpenAI Agents SDK. Handoffs model the tiers, guardrails model the policy, and the built-in tracing shows you every step when a refund goes wrong.
- Voice agent that takes calls: OpenAI Agents SDK. Realtime Agents are built in; Claude has no voice path.
- Multi-model agent that routes cheap tasks to a small model: OpenAI Agents SDK. The provider switch is a configuration choice, not a rewrite.
- Long-running coding session with subagents doing research and review in parallel: Claude Agent SDK. Subagents under one orchestrator fit work that branches and comes back.
- No operations work, no servers to run: Neither — that job is a hosted runtime, not an SDK.
Pick rules
Choose Claude Agent SDK when the agent works on code, files, and shell commands; when you want Claude Code’s loop, tools, permissions, and sessions without rebuilding them; and when Claude-only models are acceptable.
Choose OpenAI Agents SDK when the workflow is handoffs between specialists; when you need voice or realtime; when the model must be swappable; and when you prefer a small, open-source runtime you can read and a light process you host.
Choose neither when the job is a hosted runtime with no servers to run, a drag-and-drop builder, or a no-code workflow — those are different pages, linked above.
Wrong fits
Picking Claude because the docs look friendlier, then discovering the one model you need is not a Claude model, is the usual mix-up. The SDK bundles the Claude Code binary; there is no provider switch to reach for later.
Picking OpenAI because the primitives look lighter, then discovering your agent needs to edit files and run shell commands every turn, is the other mix-up. You will build the execution environment Claude ships, and the light runtime stops feeling light.
Expecting either $0 SDK to mean a $0 agent will stall at the first invoice. The SDK is free; the tokens are not. And expecting the November versions to stay still will stall at the next upgrade — both SDKs are pre-1.0, both shipped breaking changes in November, and the version table above is already a snapshot, not a promise.
How I checked this
This page picks between the Claude Agent SDK and the OpenAI Agents SDK for builders choosing which agent loop to ship.
I used Anthropic’s Agent SDK overview and pricing docs and OpenAI’s Agents SDK package page and migration guide from the Claude Agent SDK, all read Nov 24, 2026; the npm registry and PyPI for the November version pins; and Kusuma’s August 2026 same-task build for the hands-on shape. I pick by who owns the loop and the execution environment, then by whether the job needs Claude’s built-in tools, OpenAI’s handoffs and voice, or a different model entirely.
Products in this guide
- Claude Agent SDK Anthropic's library that runs the Claude Code agent loop — built-in file, shell, and web tools, permissions, sessions, hooks — inside your own app. Claude models only; you pay API token rates. Visit site
- OpenAI Agents SDK OpenAI's open-source, code-first agent runtime — Agents, handoffs, guardrails, sessions, tracing, realtime — model-agnostic through providers; you pay API token rates. Visit site
FAQ
Is Claude Agent SDK better than OpenAI Agents SDK?
For a coding agent that reads, edits, and runs code, usually Claude — the file, shell, and web tools ship with it. For a text agent with handoffs between specialists, especially across models, usually OpenAI. Pick by the job, not by which vendor you like.
Which SDK is cheaper to run?
The SDKs cost the same: nothing. You pay model tokens. A 10,000-input, 2,000-output task costs $0.04 on Claude Sonnet 5.5 and $0.04 on GPT-6.1 Sol at list prices as of November 2026, because both are $2/$10 per million tokens. Pick the cheaper model tier, not the cheaper SDK.
Can I use Claude models with the OpenAI Agents SDK?
Yes, through a provider such as LiteLLM — the OpenAI SDK is model-agnostic. The reverse does not work: the Claude Agent SDK runs Claude models only, because it bundles the Claude Code binary.
Do I need an SDK if I already use Claude Code or Codex?
Not for the same job. Claude Code and Codex are the plan-bundled agents you run from a terminal or chat. The SDKs are the libraries you embed in your own application, billed by API tokens, when the agent has to live inside your product.
Which SDK should I pick for a support agent?
OpenAI, in most cases. Support is handoffs between specialists — triage, billing, escalation — and the OpenAI SDK models that shape directly, with built-in tracing and guardrails. Claude fits when the support job also touches files and shell commands.