OpenAI Agents SDK logo

OpenAI Agents SDK

Visit

OpenAI's official Python and TypeScript agent runtime: agents, handoffs, guardrails, sessions, and tracing.

Share:
View alternatives

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

  1. Read the Python docs.
  2. pip install openai-agents.
  3. Create an Agent, then Runner.run_sync(agent, "Hello").
  4. 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

  1. Keep agents small and hand off. Do not grow one god agent.
  2. Turn on tracing before the first production incident.
  3. 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!