OpenAI Agents SDK

Agentic AIFrameworks and SDKsPublished By Simon Budziak

OpenAI Agents SDK is a lightweight, open-source toolkit from OpenAI for building agentic applications. It ships the core loop an agent needs: a model equipped with instructions, tools, handoffs to other agents, guardrails, and sessions, in a package small enough to read end to end in an afternoon.

OpenAI’s positioning is blunt: it is “a production-ready upgrade of our previous experimentation for agents, Swarm” (docs), replacing Swarm in March 2025. At over 40 million PyPI downloads per month as of August 2026, it is among the most installed agent libraries in Python.

What does the OpenAI Agents SDK actually include?

The primitive set is deliberately short: agents (a model plus instructions plus tools), handoffs (one agent handing a task to another), guardrails (checks that run alongside the agent), and sessions (memory persisting across turns). Tracing is built in; tool calling and MCP servers connect the agent to external systems. There is no graph editor and no workflow engine; structure beyond the loop is code you write.

When does the minimal loop beat a full framework?

The honest comparison is with LangGraph. An AI agent that fits in a request-response shape, calls a handful of tools, and hands off to a specialist occasionally is a sweet spot for this SDK: almost nothing to learn, and the whole runtime fits in your head. The moment a run needs durable state across hours, checkpoints, or an approval step partway through, the orchestration features a framework ships start earning their cost, and the minimal loop becomes code you maintain yourself.

Frequently asked questions

What is the difference between the OpenAI Agents SDK and LangGraph?

The OpenAI Agents SDK gives you a minimal, readable loop you own and extend; LangGraph gives you a full orchestration runtime with durable state, checkpoints, and human-in-the-loop steps built in. Teams that need fine-grained control of long-running state pick LangGraph; teams that want the smallest thing that works pick the Agents SDK.

Does the OpenAI Agents SDK work with non-OpenAI models?

It is open source and its deepest integrations assume OpenAI models, so it runs best there. Teams that need model portability across providers usually choose a provider-neutral framework instead.

Summarize this page with

See this working in a system we built