OpenAI Agents SDK
The OpenAI Agents SDK is OpenAI's official Python and TypeScript runtime for production agents. It is the hardened successor to the Swarm experiment. Newer first-party pages add sandbox agents, realtime agents on gpt-realtime-2.1, voice agents, MCP server tools, and human-in-the-loop.
Install with pip install openai-agents or npm install openai-agents. The hello world is from agents import Agent, Runner then Runner.run_sync(.).
Key Features
- Agents: An LLM plus instructions, tools, and settings.
- Handoffs / agents-as-tools: Send work to a specialist, or call another agent as a tool.
- Guardrails: Input and output checks that run beside the agent loop.
- Sessions + tracing: Persist conversations and watch runs. LangSmith, Langfuse, and AgentOps still plug in.
- Sandbox, realtime, voice, MCP, HITL: Current docs cover these on top of the original Swarm-era surface.
Use Cases
- OpenAI-first production agents that want the official thin runtime.
- Modular specialist graphs built from handoffs instead of a custom router.
- Voice or realtime loops that now have first-party agent types.
Limitation: this is not a graph runtime. If you need durable checkpoints and a hand-drawn state machine, use LangGraph.
Pricing
| Plan | Price | Notes |
|---|---|---|
| Open source SDK | $0 | MIT. You pay the model provider. |
Getting Started
- Read the Python docs.
pip install openai-agents.- Create an
Agent, thenRunner.run_sync(agent, "Hello"). - Add a guardrail and a session before you ship.
Frequently Asked Questions
Is this Swarm?
It is Swarm's production successor, not the educational experiment.
Python only?
No. TypeScript still exists (npm install openai-agents).
Can I use non-OpenAI models?
Yes, if the provider is OpenAI-compatible.
Alternatives
- LangGraph: Durable graphs and human-in-the-loop as a first-class runtime.
- CrewAI: Role-based multi-agent teams.
- Google ADK: Google's agent framework.
Tips
- Keep agents small and hand off. Do not grow one god agent.
- Turn on tracing before the first production incident.
- Confirm the realtime and sandbox pages. Those surfaces moved after the first writeup.
Conclusion
The Agents SDK is still the official, thin OpenAI agent runtime: agents, handoffs, guardrails, sessions, tracing, now with sandbox, realtime, voice, MCP, and HITL. Start at the docs, then compare LangGraph if you need a graph.
Comments
No comments yet. Be the first to comment!
Related Tools
Related Insights

Anthropic Subagent: The Multi-Agent Architecture Revolution
Deep dive into Anthropic multi-agent architecture design. Learn how Subagents break through context window limitations, achieve 90% performance improvements, and real-world applications in Claude Code.
The Twilight of Low-Code Platforms: Why Claude Agent SDK Will Make Dify History
A deep dive from first principles of large language models on why Claude Agent SDK will replace Dify. Exploring why describing processes in natural language is more aligned with human primitive behavior patterns, and why this is the inevitable choice in the AI era.
Stop Cramming AI Assistants into Chat Boxes: Clawdbot Picked the Wrong Battlefield
Clawdbot is convenient, but putting it inside Slack or Discord was the wrong design choice from day one. Chat tools are not for operating tasks, and AI isn't for chatting.