Python SDK for building multi-agent workflows with instructions, tools, guardrails, and handoffs. It supports OpenAI APIs and many other language models.
Overview
OpenAI Agents SDK is a Python package for building agentic applications where language models use tools, delegate work, and run until tasks finish. It wraps model calls in a runtime that can manage turns, tool execution, safety checks, sessions, and tracing.
Core pieces include configurable agents, function and MCP tools, guardrails for input and output validation, handoffs between agents, and optional human-in-the-loop steps. Sessions keep conversation context across runs, and built-in tracing helps inspect and debug flows.
You can run plain text agents, sandbox agents that work in isolated workspaces with files and commands, realtime voice agents over WebSocket, or pipelines that chain speech-to-text, an agent, and text-to-speech. The design is provider-agnostic beyond OpenAI defaults.
Compared with calling the Responses API directly, the SDK fits when you want the runtime to handle loops, tools, guardrails, and multi-step coordination. Optional extras add voice support and Redis-backed sessions.
Key features
- Multi-agent handoffs and orchestration
- Function tools and MCP integration
- Input and output guardrails
- Sandbox agents in isolated workspaces
- Realtime and voice agent pipelines
- Session memory across runs
- Built-in run tracing
- Human-in-the-loop hooks
Use cases
- Coordinated multi-step agent workflows
- Coding agents with sandbox workspaces
- Low-latency voice assistant apps
- Tool-using assistants with safety checks