Skip to main content

OpenAI Agents SDK

Project description

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-1.5 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 Sandbox Agent

Sandbox Agents are new in version 0.14.0. A sandbox agent is an agent that uses a computer environment to perform real work with a filesystem, in an environment you configure and control. Sandbox agents are useful when the agent needs to inspect files, run commands, apply patches, or carry workspace state across longer tasks.

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 this agent on the local filesystem
    run_config=RunConfig(sandbox=SandboxRunConfig(client=UnixLocalSandboxClient())),
)
print(result.final_output)

# This project provides a Python SDK for building multi-agent workflows.

(If running this, ensure you set the OPENAI_API_KEY environment variable)

(For Jupyter notebook users, see hello_world_jupyter.ipynb)

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.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openai_agents-0.14.2.tar.gz (5.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openai_agents-0.14.2-py3-none-any.whl (807.4 kB view details)

Uploaded Python 3

File details

Details for the file openai_agents-0.14.2.tar.gz.

File metadata

  • Download URL: openai_agents-0.14.2.tar.gz
  • Upload date:
  • Size: 5.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for openai_agents-0.14.2.tar.gz
Algorithm Hash digest
SHA256 fd4e1ae84e00aef4339ad39913468a0da34cba8ff5382925d38028ac3b435ef2
MD5 e3c4038320116f691481833fc8193131
BLAKE2b-256 e22c74fea5c1b20f107d19742af400045542e17eb449d044f950758a6f68f32f

See more details on using hashes here.

Provenance

The following attestation bundles were made for openai_agents-0.14.2.tar.gz:

Publisher: publish.yml on openai/openai-agents-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openai_agents-0.14.2-py3-none-any.whl.

File metadata

  • Download URL: openai_agents-0.14.2-py3-none-any.whl
  • Upload date:
  • Size: 807.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for openai_agents-0.14.2-py3-none-any.whl
Algorithm Hash digest
SHA256 acd75132f2ec70413a4e95680b629ccbc6f4f5d0d63414980153de09d409e695
MD5 7f4f022fe3f2ffdea8c739e36c26af67
BLAKE2b-256 0b02bb3ddff9bca543cbcca0d362a645b03a0708b6c2cd6eb620d5f3de810bb3

See more details on using hashes here.

Provenance

The following attestation bundles were made for openai_agents-0.14.2-py3-none-any.whl:

Publisher: publish.yml on openai/openai-agents-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page