OpenAI Agents SDK

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. Handoffs: A specialized tool call used by the Agents SDK for transferring control between agents
  3. Guardrails: Configurable safety checks for input and output validation
  4. Sessions: Automatic conversation history management across agent runs
  5. Tracing: Built-in tracking of agent runs, allowing you to view, debug and optimize your workflows

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

Get started

  1. Set up your Python environment
python -m venv env
source env/bin/activate  # On Windows: env\\Scripts\\activate
uv venv
source .venv/bin/activate  # On Windows: .venv\\Scripts\\activate
  1. Install Agents SDK
pip install openai-agents