Heads up: this page was last verified on 2026-04-17 (62days ago). Some details may be out of date — check the vendor's official docs before copying commands.
The OpenAI Agents SDK is a production-ready Python framework for building agentic AI apps with very few abstractions. It's the successor to OpenAI's earlier Swarm project and uses native Python constructs — functions, decorators, dataclasses — rather than bespoke DSLs.
A triage agent that hands off to specialized agents:
from agents import Agent, Runnerbilling_agent = Agent( name="Billing", instructions="Handle billing questions. Be concise.",)tech_agent = Agent( name="Tech Support", instructions="Handle technical support. Ask for reproduction steps.",)triage = Agent( name="Triage", instructions="Route the user to Billing or Tech Support based on their question.", handoffs=[billing_agent, tech_agent],)result = Runner.run_sync(triage, "My invoice is wrong")print(result.final_output)
The triage agent picks the right specialist via a handoff, which is a tool call under the hood. You get tracing, sessions, and the agent loop for free.