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.
Sources
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.

Obsidian CLI + Codex: Turn Your Vault into an Agent Knowledge Engine
Obsidian CLI gives Codex and other agents a searchable, auditable, link-aware interface to a local Vault, using real cases and reproducible workflows.

After Code Stopped Being Scarce (Part II): From AI Writing Code to AI Taking Part in Delivery
A year after leaving my previous employer, I document the delivery workflow for our financial business that we built around Claude Code and Opus 5.5: XaC, progressive rules, independent review and testing by Grok Bot, PR watch, and our actual delivery over the past three months.