openai-agents 0.19.1


pip install openai-agents

  Latest version

Released: Jul 29, 2026


Meta
Author: OpenAI
Requires Python: >=3.10

Classifiers

Intended Audience
  • Developers

License
  • OSI Approved :: MIT License

Operating System
  • OS Independent

Programming Language
  • Python :: 3
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13
  • Python :: 3.14

Topic
  • Software Development :: Libraries :: Python Modules

Typing
  • Typed

OpenAI Agents SDK PyPI

The OpenAI Agents SDK is a lightweight yet powerful framework for building multi-agent workflows. It is provider-agnostic, supporting the OpenAI Responses and Chat Completions APIs, as well as 100+ other LLMs.

Image of the Agents Tracing UI

[!NOTE] Looking for the JavaScript/TypeScript version? Check out Agents SDK JS/TS.

Core concepts:

  1. Agents: LLMs configured with instructions, tools, guardrails, and handoffs
  2. Sandbox Agents: Agents preconfigured to work with a container to perform work over long time horizons.
  3. Agents as tools / Handoffs: Delegating to other agents for specific tasks
  4. Tools: Various Tools let agents take actions (functions, MCP, hosted tools)
  5. Guardrails: Configurable safety checks for input and output validation
  6. Human in the loop: Built-in mechanisms for involving humans across agent runs
  7. Sessions: Automatic conversation history management across agent runs
  8. Tracing: Built-in tracking of agent runs, allowing you to view, debug and optimize your workflows
  9. Realtime Agents: Build powerful voice agents with gpt-realtime-2.1 and full agent features

Explore the examples directory to see the SDK in action, and read our documentation for more details.

Get started

To get started, set up your Python environment (Python 3.10 or newer required), and then install OpenAI Agents SDK package.

venv

python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
pip install openai-agents

For voice support, install with the optional voice group: pip install 'openai-agents[voice]'. For Redis session support, install with the optional redis group: pip install 'openai-agents[redis]'.

uv

If you're familiar with uv, installing the package would be even easier:

uv init
uv add openai-agents

For voice support, install with the optional voice group: uv add 'openai-agents[voice]'. For Redis session support, install with the optional redis group: uv add 'openai-agents[redis]'.

Run your first agents

The SDK supports three primary ways to run agents. Set the OPENAI_API_KEY environment variable before running any of these examples.

Run a sandbox agent

Use a SandboxAgent when the agent needs to inspect files, run commands, apply patches, or preserve workspace state across longer tasks.

This example uses UnixLocalSandboxClient, which is supported on macOS and Linux. On Windows, use DockerSandboxClient with the openai-agents[docker] extra or a hosted sandbox client instead; see Sandbox clients for setup details.

from agents import Runner
from agents.run import RunConfig
from agents.sandbox import Manifest, SandboxAgent, SandboxRunConfig
from agents.sandbox.entries import GitRepo
from agents.sandbox.sandboxes import UnixLocalSandboxClient

agent = SandboxAgent(
    name="Workspace Assistant",
    instructions="Inspect the sandbox workspace before answering.",
    default_manifest=Manifest(entries={"repo": GitRepo(repo="openai/openai-agents-python", ref="main")}),
)

result = Runner.run_sync(
    agent,
    "Inspect the repo README and summarize what this project does.",
    run_config=RunConfig(sandbox=SandboxRunConfig(client=UnixLocalSandboxClient())),
)
print(result.final_output)

Run a text agent

Use a text Agent for workflows that do not need a persistent realtime connection or a sandbox workspace.

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)

# Code within the code,
# Functions calling themselves,
# Infinite loop's dance.

(For Jupyter notebook users, see hello_world_jupyter.ipynb)

Run a realtime agent

Use a RealtimeAgent for low-latency, server-side voice and multimodal experiences over WebSocket.

import asyncio
from agents.realtime import RealtimeAgent, RealtimeRunner

async def main() -> None:
    agent = RealtimeAgent(name="Assistant", instructions="You are a helpful voice assistant. Keep responses short.")
    runner = RealtimeRunner(starting_agent=agent)
    session = await runner.run()

    async with session:
        await session.send_message("Say hello in one short sentence.")
        async for event in session:
            if event.type == "audio":
                # Forward or play event.audio.data.
                pass
            elif event.type == "history_added":
                print(event.item)
            elif event.type == "agent_end":
                break

if __name__ == "__main__":
    asyncio.run(main())

Explore the examples directory to see the SDK in action, and read our documentation for more details.

Acknowledgements

We'd like to acknowledge the excellent work of the open-source community, especially:

This library has these optional dependencies:

We also rely on the following tools to manage the project:

We're committed to continuing to build the Agents SDK as an open source framework so others in the community can expand on our approach.

0.19.1 Jul 29, 2026
0.19.0 Jul 27, 2026
0.18.3 Jul 17, 2026
0.18.2 Jul 11, 2026
0.18.1 Jul 09, 2026
0.18.0 Jul 07, 2026
0.17.8 Jul 06, 2026
0.17.7 Jun 24, 2026
0.17.6 Jun 19, 2026
0.17.5 Jun 11, 2026
0.17.4 May 26, 2026
0.17.3 May 19, 2026
0.17.2 May 12, 2026
0.17.1 May 11, 2026
0.17.0 May 08, 2026
0.16.1 May 07, 2026
0.16.0 May 07, 2026
0.15.3 May 06, 2026
0.15.2 May 06, 2026
0.15.1 May 02, 2026
0.15.0 May 01, 2026
0.14.8 Apr 29, 2026
0.14.7 Apr 28, 2026
0.14.6 Apr 25, 2026
0.14.5 Apr 23, 2026
0.14.4 Apr 21, 2026
0.14.3 Apr 20, 2026
0.14.2 Apr 18, 2026
0.14.1 Apr 15, 2026
0.14.0 Apr 15, 2026
0.13.6 Apr 09, 2026
0.13.5 Apr 06, 2026
0.13.4 Apr 01, 2026
0.13.3 Mar 31, 2026
0.13.2 Mar 26, 2026
0.13.1 Mar 25, 2026
0.13.0 Mar 23, 2026
0.12.5 Mar 19, 2026
0.12.4 Mar 18, 2026
0.12.3 Mar 16, 2026
0.12.2 Mar 14, 2026
0.12.1 Mar 13, 2026
0.12.0 Mar 12, 2026
0.11.1 Mar 09, 2026
0.11.0 Mar 09, 2026
0.10.5 Mar 05, 2026
0.10.4 Mar 03, 2026
0.10.3 Mar 02, 2026
0.10.2 Feb 26, 2026
0.10.1 Feb 24, 2026
0.10.0 Feb 23, 2026
0.9.3 Feb 20, 2026
0.9.2 Feb 19, 2026
0.9.1 Feb 17, 2026
0.9.0 Feb 13, 2026
0.8.4 Feb 11, 2026
0.8.3 Feb 10, 2026
0.8.2 Feb 09, 2026
0.8.1 Feb 06, 2026
0.8.0 Feb 05, 2026
0.7.0 Jan 23, 2026
0.6.9 Jan 20, 2026
0.6.8 Jan 19, 2026
0.6.7 Jan 16, 2026
0.6.6 Jan 15, 2026
0.6.5 Jan 06, 2026
0.6.4 Dec 19, 2025
0.6.3 Dec 11, 2025
0.6.2 Dec 04, 2025
0.6.1 Nov 20, 2025
0.6.0 Nov 18, 2025
0.5.1 Nov 13, 2025
0.5.0 Nov 05, 2025
0.4.2 Oct 24, 2025
0.4.1 Oct 22, 2025
0.4.0 Oct 17, 2025
0.3.3 Sep 30, 2025
0.3.2 Sep 23, 2025
0.3.1 Sep 18, 2025
0.3.0 Sep 11, 2025
0.2.11 Sep 03, 2025
0.2.10 Aug 29, 2025
0.2.9 Aug 22, 2025
0.2.8 Aug 15, 2025
0.2.7 Aug 14, 2025
0.2.6 Aug 11, 2025
0.2.5 Aug 07, 2025
0.2.4 Jul 29, 2025
0.2.3 Jul 21, 2025
0.2.2 Jul 17, 2025
0.2.1 Jul 16, 2025
0.2.0 Jul 15, 2025
0.1.0 Jun 27, 2025
0.0.19 Jun 18, 2025
0.0.18 Jun 16, 2025
0.0.17 Jun 04, 2025
0.0.16 May 21, 2025
0.0.15 May 15, 2025
0.0.14 Apr 30, 2025
0.0.13 Apr 24, 2025
0.0.12 Apr 22, 2025
0.0.11 Apr 15, 2025
0.0.10 Apr 15, 2025
0.0.9 Apr 07, 2025
0.0.8 Apr 03, 2025
0.0.7 Mar 26, 2025
0.0.6 Mar 20, 2025
0.0.5 Mar 19, 2025
0.0.4 Mar 13, 2025
0.0.3 Mar 11, 2025
0.0.2 Mar 11, 2025
0.0.1 Mar 04, 2025

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras:
Dependencies:
griffelib (<3,>=2)
mcp (<2,>=1.19.0)
openai (<3,>=2.45.0)
pydantic (<3,>=2.12.2)
requests (<3,>=2.0)
typing-extensions (<5,>=4.12.2)
websockets (<17,>=15.0)