A Python framework for building LLM-powered applications and agents, with standard interfaces for models, embeddings, vector stores and third-party integrations.
openai/openai-agents-python
A lightweight Python framework for building multi-agent workflows with tools, handoffs, guardrails, sessions and tracing, provider-agnostic across OpenAI and 100+ LLMs.
- Stars
- 30,164
- Forks
- 5,079
- Open issues
- 23
- Last commit
- 16 hours ago
What is it?
The OpenAI Agents SDK is a Python framework for building agents: LLMs configured with instructions, tools, guardrails and handoffs that delegate work to other agents. It supports the OpenAI Responses and Chat Completions APIs as well as 100+ other LLMs, so it is not tied to a single provider.
Beyond text agents, the SDK includes sandbox agents that work inside a container across longer tasks, realtime agents for low-latency voice and multimodal sessions over WebSocket, and voice pipelines that chain speech-to-text, an agent workflow and text-to-speech. Sessions manage conversation history across runs, and built-in human-in-the-loop hooks let people step into an agent run.
Tracing records agent runs so developers can view, debug and optimize their workflows. A JavaScript/TypeScript version is maintained separately in a sibling repository.
Key features
- 01Agents configured with instructions, tools, guardrails and handoffs
- 02Works with OpenAI Responses and Chat Completions APIs and 100+ other LLMs
- 03Sandbox agents that inspect files, run commands and apply patches in a workspace
- 04Realtime and voice agents for WebSocket-based voice pipelines
- 05Automatic session history management and built-in tracing
Use cases
- Building a multi-agent system where specialist agents handle delegated subtasks
- Creating a voice assistant that combines speech recognition, an agent and speech synthesis
- Running a coding or research agent that needs to read files and execute commands in a sandbox
- Debugging and monitoring agent runs in production with built-in tracing
Quick start
- 1
Create a virtual environment
python -m venv .venv - 2
Activate the virtual environment
source .venv/bin/activate - 3
Install the openai-agents package
pip install openai-agents - 4
Set the OPENAI_API_KEY environment variable, then run a text agent
Things to know
- Requires Python 3.10 or newer.
- Needs an OpenAI API key (OPENAI_API_KEY) to run the examples.
Topics
FAQ
- What is openai-agents-python?
- A lightweight Python framework for building multi-agent workflows with tools, handoffs, guardrails, sessions and tracing, provider-agnostic across OpenAI and 100+ LLMs. The OpenAI Agents SDK is a Python framework for building agents: LLMs configured with instructions, tools, guardrails and handoffs that delegate work to other agents. It supports the OpenAI Responses and Chat Completions APIs as well as 100+ other LLMs, so it is not tied to a single provider.
- Is openai-agents-python free to use? What license does it have?
- openai-agents-python is open source under the MIT license. Check the license terms before using it in commercial products.
- Is openai-agents-python still maintained?
- Actively maintained. The last commit to openai-agents-python was on Oct 20, 2026.
- What can I use openai-agents-python for?
- Building a multi-agent system where specialist agents handle delegated subtasks Creating a voice assistant that combines speech recognition, an agent and speech synthesis Running a coding or research agent that needs to read files and execute commands in a sandbox Debugging and monitoring agent runs in production with built-in tracing
- How do I install openai-agents-python?
- Create a virtual environment: python -m venv .venv Activate the virtual environment: source .venv/bin/activate Install the openai-agents package: pip install openai-agents Set the OPENAI_API_KEY environment variable, then run a text agent
- Where can I get openai-agents-python?
- The source code and installation instructions are on GitHub: https://github.com/openai/openai-agents-python
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Open-source Python framework for orchestrating role-based autonomous AI agents (Crews) and event-driven workflows (Flows).
A minimal Python library for building AI agents that write and run their actions as Python code.
An SDK for building AI agents and multi-agent systems in Python, .NET and Java, with model, plugin and vector database integrations.
Python framework for building autonomous AI agents that research, plan, code and run tasks, with memory, RAG and 100+ LLM providers.
A Python framework for building RAG, agent and document-processing applications that connect LLMs to your own data.