The OpenAI Agents SDK is a Python framework for building multi-agent workflows from a small set of primitives: agents (LLMs configured with instructions, tools, guardrails, and handoffs), agents as tools and handoffs for delegating work to other agents, and guardrails for validating inputs and outputs. Orchestration uses ordinary Python language features rather than a new set of abstractions. It succeeds Swarm, OpenAI's earlier experimental agents project, and a JavaScript/TypeScript version lives in a separate repository.
The SDK uses the OpenAI Responses API by default for OpenAI models and also supports the Chat Completions API and more than 100 other LLMs through optional LiteLLM and any-llm dependencies. It wraps model calls in a runtime with a built-in agent loop that continues until the task is complete.
Agents run in four ways: text agents for ordinary workflows, sandbox agents that work in an isolated container workspace over long 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. Built-in tracing records each run for visualizing, debugging, and monitoring, and connects to OpenAI's evaluation, fine-tuning, and distillation tools.
Features
- Agents and handoffs: agents delegate to other agents as tools or through handoffs for specific tasks
- Sandbox agents: inspect files, run commands, apply patches, and keep workspace state in local, Docker, or hosted sandboxes, with manifest-defined files and resumable sessions
- Realtime agents: low-latency voice agents with interruption detection, context management, and guardrails
- Voice pipelines: combine speech-to-text, an agent workflow, and text-to-speech
- Guardrails: input and output validation that runs in parallel with the agent and fails fast
- Function tools: turns any Python function into a tool with automatic schema generation and Pydantic validation
- MCP tools: exposes remote MCP server tools to agents alongside function tools and hosted tools
- Sessions: automatic conversation history across agent runs, with SQLite and Redis options
- Human in the loop: built-in mechanisms for involving people during agent runs
- Tracing: records agent runs for debugging and monitoring, with links to OpenAI evaluation and fine-tuning tools



