
OpenAI Agents SDK
A Python SDK for building AI agents that use tools, hand off tasks, and keep conversation history.openai/openai-agents-python
- Stars
- 30.5k
- Forks
- 5k
- Licence
- MIT
- Language
- Python
- Last update
- 5 days ago
- Type
- Library
What it is
The OpenAI Agents SDK is a Python library for building workflows where one or more LLM-powered agents work together. Each agent can be given instructions, tools, guardrails, and the ability to hand tasks to other agents. The README says it works with the OpenAI Responses and Chat Completions APIs and with 100+ other LLMs.
- Build a single agent that answers questions with a short run call, as in the text agent example
- Create an agent that inspects a Git repository inside a sandbox and summarizes it
- Build a voice agent that takes audio input and streams spoken replies
- Set up guardrails that check agent input and output for safety
Great for
- Python developers building multi-step AI workflows
- Teams that want agents to call tools and delegate work to other agents
- Developers building voice assistants with speech-to-text and text-to-speech
- Builders who want built-in tracing to debug agent runs
Not ideal for
- Non-programmers, since it is a code library with no graphical interface (reason: it is used by writing Python)
- Projects that need a non-Python stack, since the README points to a separate JavaScript/TypeScript version (reason: this repo is Python-only)
- Anyone who cannot use an OpenAI API key or another supported LLM provider (reason: the examples require OPENAI_API_KEY)
How to get it
- 1
Install with a package manager
You'll need: Python 3.10 or newer
Create and activate a virtual environment
python -m venv .venvInstall the package with pip
pip install openai-agents - 2
Run it
- Set the OPENAI_API_KEY environment variable
- Create a file with the text agent example from the README
- Run the script with Python to get a haiku printed to the terminal
- 3
Get the most out of it
- Install the voice group with pip install 'openai-agents[voice]' to use voice pipelines
- Install the redis group with pip install 'openai-agents[redis]' for Redis-backed session support
- Use the examples directory in the repository to see working code for each feature
- Read the documentation site for guides on tools, handoffs, guardrails, and tracing
Downloads
Strengths
- Small, focused API: an Agent plus a Runner covers the basic case, per the README examples
- Built-in features such as tools, handoffs, sessions, guardrails, and tracing are listed in the README
- Provider-agnostic design, supporting OpenAI APIs and 100+ other LLMs according to the README
Trade-offs
- Requires an OpenAI API key or another LLM provider and usage may incur costs (the README sets OPENAI_API_KEY for examples)
- Some features depend on the platform: the sandbox example uses UnixLocalSandboxClient, which the README says is for macOS and Linux, so Windows users need Docker or a hosted client
- Contributions are limited to repository collaborators, so outside pull requests are not accepted per the README
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| openai-agents-python (this) | 30.5k | Library | intermediate | 5 days ago | Python developers building multi-step AI workflows |
| langgraph | 44.3k | Library | intermediate | 4 days ago | Python developers building multi-step AI agents that must survive failures or long waits |
| crewAI | 60.4k | Library | intermediate | 4 days ago | Python developers prototyping multi-agent workflows |
| llama_index | 52.8k | Library | intermediate | 10 days ago | Python developers building retrieval-augmented generation (RAG) apps over private documents |
| langchain | 149k | Framework | intermediate | 4 days ago | Python developers building LLM-powered applications |
| SuperAGI | 17.7k | AI model / agent | advanced | 1.8 years ago | Python developers experimenting with autonomous AI agents |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.