OpenAI Agents SDK
OpenAI's lightweight, open-source framework for agents — handoffs, guardrails, sessions, and built-in tracing.
OpenAI's open-source Agents SDK is a small, unopinionated framework for building agents: a core agent loop plus handoffs (delegation between agents), guardrails (input/output validation), sessions (memory), and built-in tracing. The production-grade successor to Swarm; works with non-OpenAI models too.
The OpenAI Agents SDK is OpenAI's lightweight, open-source framework for building agentic applications. It's the production-ready successor to the experimental Swarm project, and its design philosophy is "few primitives, learned fast": a core agent loop, plus a handful of well-chosen building blocks rather than a large abstraction layer.
It is aimed at developers who want a minimal, Pythonic framework with the essentials built in. Although it comes from OpenAI, it is provider-agnostic — you can run agents on non-OpenAI models — which makes it a reasonable default even outside the OpenAI ecosystem.
Highlights
- Agents & the loop — define an agent with instructions and tools; the SDK runs the model-tool-observation loop for you.
- Handoffs — delegate from one agent to another, the SDK's mechanism for multi-agent systems.
- Guardrails — validate inputs and outputs (and run checks in parallel) to keep agents safe and on-task.
- Sessions — built-in conversation memory across runs.
- Tracing — first-class tracing for debugging and evaluating agent runs.
In an AI-assisted workflow
from agents import Agent, Runner
agent = Agent(name="Support", instructions="Help with billing", tools=[lookup_invoice])
result = Runner.run_sync(agent, "Why was I charged twice?")TIP
Reach for the Agents SDK when you want a small, standard agent loop with handoffs and guardrails and minimal ceremony. For explicit state graphs and checkpointing, compare LangGraph; for role-based crews, CrewAI.
Good to know
The Agents SDK is open source (MIT) and free; you pay your model provider for tokens. It works with OpenAI models out of the box and with other providers through compatible interfaces. See the agent framework comparison for how it stacks up against LangGraph, CrewAI, AutoGen, and the Claude Agent SDK.
Related
- LangGraphA low-level library for building stateful, controllable agents as graphs, with checkpointing and human-in-the-loop.
- CrewAIA Python framework for orchestrating role-playing AI agents as collaborating 'crews', plus event-driven flows.
- AutoGen (AG2)A multi-agent conversation framework where agents collaborate via message-passing, with group chat and code execution.
- Which Agent Framework in 2026? LangGraph vs CrewAI vs AutoGen vs OpenAI Agents SDK vs Claude Agent SDKA decision guide to the major AI agent frameworks — control vs. abstraction, multi-agent models, state and durability, and which fits your project.