OpenAI Agents SDK
by OpenAI · Framework · also known as openai-agents (PyPI), @openai/agents, Swarm (predecessor)
Lightweight open-source Python and TypeScript framework for agents, handoffs, guardrails, sessions and tracing, defaulting to OpenAI's Responses API with adapters for other providers
Overview
The OpenAI Agents SDK is OpenAI's MIT-licensed framework for building agentic applications with few abstractions, released as the production successor to the experimental Swarm project. An agent is a model plus instructions and tools, run in a built-in loop until the task completes. Handoffs (or agents-as-tools) delegate work between agents, guardrails validate inputs and outputs in parallel and fail fast, sessions persist working memory across turns, and tracing records every run for debugging and for OpenAI's evaluation and fine-tuning tools. Function tools are generated from Python functions with automatic schemas and Pydantic validation, and MCP servers can be attached so their tools appear alongside local ones.
The SDK uses the Responses API for OpenAI models by default but ships adapters (LiteLLM and others) for non-OpenAI providers. Additional modules cover realtime voice agents, speech-to-text/text-to-speech voice pipelines, sandboxed agents running in isolated workspaces and human-in-the-loop approval. A TypeScript edition (@openai/agents) mirrors the Python package. The framework is attractive for teams committed to OpenAI who want minimal ceremony; its tracing and some hosted tools are tied to the OpenAI platform, so provider portability is weaker than with LangGraph or Pydantic AI.
Capabilities
- Agents, handoffs, guardrails, sessions and tracing primitives
- Function tools with automatic schema generation and validation
- MCP server integration
- Realtime voice agents and STT/TTS voice pipelines
- Sandboxed agents and human-in-the-loop approvals
- Python and TypeScript packages with non-OpenAI provider adapters
Typical workflows
- Build a triage agent that hands off to specialist agents
- Add input and output guardrails to an existing assistant
- Prototype a voice agent on the Realtime API
Strengths
- Minimal abstractions and short learning curve
- First-class support for OpenAI hosted tools and tracing
- MIT license with Python and TypeScript parity
Limitations
- Defaults and tracing favor the OpenAI platform
- Younger than LangChain with fewer third-party integrations
- Durable execution is less developed than in LangGraph
Prerequisites
- Python 3.9+ or Node.js
- OpenAI API key (or configured alternative provider)
Who it is for
- Developers on the OpenAI platform
- Teams building voice or multi-agent workflows quickly
Alternatives & comparison
- AutoGen
Microsoft's multi-agent framework (Core, AgentChat, Extensions, Studio) for Python and .NET, now archived with users directed to Microsoft Agent Framework
Open sourceOpen source - CrewAI
Open-source Python framework for role-based multi-agent crews and event-driven flows, with a commercial enterprise console for deploying, monitoring and triggering automations
MixedOpen source - LangChain
Open-source Python and JavaScript framework whose create_agent harness builds tool-using agents on the LangGraph runtime with swappable model providers and middleware
Open sourceOpen source - LangGraph
Low-level orchestration framework and runtime for stateful, long-running agents expressed as graphs, with durable execution, checkpointing, human-in-the-loop and streaming
Open sourceOpen source - Model Context Protocol
Open JSON-RPC standard for connecting AI applications to tools, data and prompts through servers, now stewarded under the Linux Foundation with SDKs in many languages
Open sourceOpen source - Pydantic AI
Type-safe Python agent framework from the Pydantic team with validated structured outputs, dependency injection, swappable model providers, MCP, durable execution and evals
Open sourceOpen source
Sources & verification
Primary sources consulted for this record. Claims are tied to the fields each source supports; the automated link checker re-verifies every URL on a schedule.
- Licensehttps://github.com/openai/openai-agents-python/blob/main/LICENSEchecked Nov 1, 2026
Supports: license_spdx, source_model
- Official documentationchecked Nov 1, 2026
- Official siteOpenAI Agents SDK documentationchecked Nov 1, 2026
https://openai.github.io/openai-agents-python
Supports: name, summary, capabilities
- Repositoryhttps://github.com/openai/openai-agents-pythonchecked Nov 1, 2026
Supports: license_spdx, languages
- Confidence
- High
- Reviewed
- Nov 1, 2026
- Links
- Verified · Nov 2, 2026
Spotted an error?
More in Agent frameworks & orchestration
Apify
Apify Technologies s.r.o. · Data collection & crawling
Cloud platform and marketplace for running web-scraping and automation programs (Actors), with storages, proxies, scheduling, an API and an MCP server for agents
Claude Code
Anthropic · Coding agents & AI IDEs
Anthropic's agentic coding tool that reads a codebase, edits files and runs commands from the terminal, IDEs, a desktop app, the web and CI, with MCP, hooks, skills and subagents
Claude Platform
Anthropic · Model providers & APIs
Anthropic's developer platform for the Claude models: Messages API, tool use, structured outputs, prompt caching, batch processing and Managed Agents, plus cloud availability
OpenAI API
OpenAI · Model providers & APIs
OpenAI's hosted developer platform: Responses and Chat Completions APIs, Realtime voice, embeddings, images, audio, fine-tuning, evals and managed agents
Model Context Protocol
Model Context Protocol, a Series of LF Projects, LLC (originated by Anthropic) · Agent frameworks & orchestration
Open JSON-RPC standard for connecting AI applications to tools, data and prompts through servers, now stewarded under the Linux Foundation with SDKs in many languages
LlamaIndex
LlamaIndex, Inc. · Agent frameworks & orchestration
Open-source Python framework for retrieval-augmented agents over your data, with connectors, indexes, query engines and event-driven workflows, alongside the commercial LlamaParse document platform