Skip to content

OpenAI Agents SDK (Python)

The official production-ready replacement for Swarm. Lightweight primitives (Agent, Handoff, Guardrail, Session, Tool) with built-in tracing, MCP support, and provider-agnostic LLM access (OpenAI + 100+ via LiteLLM).

Install

Terminal window
pip install "openai>=2.0" openai-agents

Version

v0.15.1 · May 2026 · Python 3.10+

Best for

Multi-agent handoffs, customer-service bots, tracing-first apps.

  • v0.15.1 (May 2) — Patch release; stability and dependency updates.
  • v0.15.0 (May 1) — Minor release; stability and dependency updates.
  • v0.14.8 (April 29) — Patch release; stability improvements.
  • v0.14.7 (April 28) — Patch release; stability improvements.
  • Sandbox agents — persistent isolated workspaces with files, directories, Git repos, snapshots. Backends: local Unix, Docker, Blaxel, E2B, Modal, Runloop, Vercel.
  • WebSocket transport for OpenAI Responses models — low-latency multi-turn conversations via responses_websocket_session().
  • Sync function tools now run on worker threads via asyncio.to_thread().
from agents import Agent, Runner
agent = Agent(
name="Assistant",
instructions="You are a helpful assistant.",
)
result = Runner.run_sync(agent, "What is 2 + 2?")
print(result.final_output)

Ready? Start Zero → Hero Step 1 →


DateVersionChangesReviewer
2026-05-020.15.1Version bumped 0.15.0 → 0.15.1; “What’s new” heading updated; comprehensive guide header updated; revision history entry added. Agent, Runner, Handoff, guardrail imports verified against installed 0.15.1 (.routine-envs/check-openai-0502).Claude routine
2026-05-010.15.0Version bumped 0.14.8 → 0.15.0; “What’s new” heading updated; comprehensive guide header updated; revision history entry added. Agent, Runner, Handoff, guardrail imports verified against installed 0.15.0 (.routine-envs/check-openai-0501).Claude routine
2026-04-290.14.8Version bumped 0.14.7 → 0.14.8; “What’s new” heading updated; comprehensive guide header updated; revision history entry added. Snippets verified against installed 0.14.8 (.routine-envs/main-py-0429).Claude routine
2026-04-280.14.7Version bumped 0.14.6 → 0.14.7; “What’s new” heading updated; comprehensive guide header updated; revision history entry added. Snippets verified against installed 0.14.7.Claude routine
2026-04-250.14.6Version bumped 0.14.5 → 0.14.6; “What’s new” heading updated; comprehensive guide header updated; revision history entry added. Snippets verified against installed 0.14.6.Claude routine
2026-04-240.14.5Version bumped 0.14.4 → 0.14.5; “What’s new” heading updated; comprehensive guide header updated; revision history entry added.
2026-04-210.14.3Index redesigned with Zero → Hero + Jump-to-topic grid.
2026-04-200.14.3Patch release; no breaking changes from 0.14.2.
April 16, 20260.14.0Sandbox agents; WebSocket transport; openai v2 requirement; Python 3.9 dropped.
November 20250.6.1Initial 2025 features; Swarm migration; MCP; guardrails; sessions.

Note: TypeScript implementation lives at OpenAI Agents SDK (TypeScript).