OpenAI Agents SDK
The OpenAI Agents SDK is a lightweight Python framework for building multi-agent workflows. It supports OpenAI APIs and 100+ other LLMs, and includes features like tools, guardrails, handoffs, sessions, and tracing. It is designed for developers who need to create complex agent-based applications.
✨ Key features
- Provider-agnostic: supports OpenAI and 100+ LLMs
- Agents with instructions, tools, guardrails, handoffs
- Sandbox agents for long-running tasks with workspace
- Realtime agents for low-latency voice/multimodal
- Voice pipelines for speech-to-text and text-to-speech
- Built-in tracing for debugging and optimization
🎯 Use cases
- Build multi-agent workflows with delegation via handoffs
- Create voice assistants using realtime or voice pipelines
- Automate tasks that require file inspection and command execution
- Add guardrails for input/output validation in agent runs
- Manage conversation history with sessions
📦 Installation
🧰 Requirements: Python 3.10 or newer, and an OpenAI API key (set OPENAI_API_KEY) for using OpenAI models.
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install openai-agents
For voice support: pip install 'openai-agents[voice]'
For Redis session support: pip install 'openai-agents[redis]'
Alternatively with uv:
uv init
uv add openai-agents
For voice: uv add 'openai-agents[voice]'
For Redis: uv add 'openai-agents[redis]'
🚀 Usage
from agents import Agent, Runner
agent = Agent(name="Assistant", instructions="You are a helpful assistant")
result = Runner.run_sync(agent, "Write a haiku about recursion in programming.")
print(result.final_output)
❓ FAQ
What Python version is required?
Python 3.10 or newer is required.
Can I use models other than OpenAI?
Yes, the SDK is provider-agnostic and supports 100+ other LLMs via the Chat Completions API.
How do I install voice support?
Install with the optional voice group: pip install 'openai-agents[voice]' or uv add 'openai-agents[voice]'.
What are the different ways to run agents?
The SDK supports text agents, sandbox agents, realtime agents, and voice pipelines.
📊 Repository
🤖 Overview, features, install steps and FAQ were generated from the project's README on Sep 4, 2026. Always check the original source before running commands.