OpenAI Agents SDK

27.6k · GitHub →

OpenAI's deliberately small agent framework: agents, tools, handoffs, guardrails — and little else.

Install

$ pip install openai-agents

What is OpenAI Agents SDK?

The OpenAI Agents SDK (successor to the experimental Swarm project) bets that agent frameworks got too big. Its whole surface fits in a handful of primitives: an Agent is a model plus instructions, tools, and guardrails; a handoff transfers the conversation to another agent; a Runner drives the loop; Sessions manage history. Multi-agent orchestration is just agents handing off to each other or being called as tools — no graph compiler, no role metaphors, no YAML.

Despite the name, it is provider-agnostic: beyond OpenAI's Responses and Chat Completions APIs it supports 100+ models through LiteLLM-style adapters. It has grown carefully rather than sprawling — built-in tracing with a visual UI, human-in-the-loop approval, realtime voice agents, and sandbox agents that operate on a real filesystem for long-horizon coding work. MIT-licensed, with an equivalent JS/TS SDK.

Its limits are the flip side of its size. There is no durable-execution story comparable to LangGraph's checkpointers — long-running state is on you — and while other providers work, the polish (tracing, hosted tools, realtime) is clearly best inside OpenAI's platform. It is the framework equivalent of a sharp small knife: superb for what it cuts, not a toolbox.

Key capabilities

  • Minimal primitives: Agents, tools, handoffs, guardrails, sessions — learnable in an afternoon
  • Built-in tracing with a visual UI for debugging and optimizing agent runs
  • Provider-agnostic: OpenAI APIs plus 100+ other models via adapters
  • Sandbox agents for long-horizon work against a real filesystem, and realtime voice agents
  • Human-in-the-loop approval hooks and input/output guardrails as first-class concepts

When to use it

Pick the OpenAI Agents SDK when you want the shortest path from idea to working agent — especially if you are already on OpenAI models and want tracing, guardrails, and handoffs without learning a framework's worldview. Its handoff pattern is the cleanest way to build small agent teams. Look elsewhere if you need durable long-running workflows with checkpointing (LangGraph), deep AWS/Bedrock integration (Strands), or if betting your architecture on OpenAI's roadmap feels uncomfortable despite the multi-provider support.

Alternatives

Frequently asked questions

Does the OpenAI Agents SDK only work with OpenAI models?

No. It is provider-agnostic by design: besides the OpenAI Responses and Chat Completions APIs, it supports 100+ other LLMs through adapter integrations. That said, some features — hosted tools, the tracing dashboard, realtime voice — are most polished when running against OpenAI's own platform, so the multi-provider experience is functional rather than equal.

What is a handoff in the OpenAI Agents SDK?

A handoff transfers control of the conversation from one agent to another — a triage agent routing to a billing agent, for example. The receiving agent gets the conversation context and continues the run. Combined with "agents as tools" (calling an agent like a function), handoffs are how the SDK does multi-agent orchestration without any graph or workflow engine.

What happened to OpenAI Swarm?

Swarm was OpenAI's educational, experimental multi-agent framework. The Agents SDK is its production-ready successor: it keeps Swarm's lightweight agents-and-handoffs philosophy but adds the missing production pieces — tracing, guardrails, sessions, human-in-the-loop, and broad model support. OpenAI recommends the Agents SDK for all real projects; Swarm is effectively retired.

Star count updated 2026-07-02 · refreshed weekly from the GitHub API · browse all tools →