OpenAI Agents SDK overview
The OpenAI Agents SDK is a Python library that runs an agent loop: it sends your instructions and the conversation to a model, runs any tool the model asks for, and repeats until the model returns a final answer.
Last updated: 28 Sep, 2026 · openai-agents 0.22.3
It is built by OpenAI and released as the open-source package openai-agents. The docs describe it as a lightweight framework for multi-agent workflows with a small set of pieces you combine yourself.
What the SDK gives you
- Agent: a model paired with a name, instructions and a list of tools.
- Runner: runs an agent and returns a result you can read.
- Tools: Python functions the model may call during a run.
- Handoffs: one agent passing control to another.
- Guardrails: checks on the input and the final answer.
- Sessions: memory that carries across runs.
The shop agent you build
The running example across this course is a shop support agent. It starts as an agent that only greets the customer. Over the lessons it looks up an order with a tool, hands a refund to a specialist agent, refuses unsafe input, and remembers the customer between runs.
How a run works
You call the Runner with an agent and a message. The SDK sends the message to the model. If the model asks to call a tool, the SDK runs that tool, feeds the result back, and asks the model again. When the model replies with text instead of a tool request, that text is the final answer.
Running without an API key
A model normally needs an API key and a network call. To keep every lesson runnable offline, lesson 3 builds a small deterministic stand-in model called ShopModel. It follows fixed rules instead of calling a service, so the agent runs with no key. The final part of the course shows the one line that swaps in a real model.
Where you use the Agents SDK
- Support assistants that look things up with tools and answer in your own words.
- Workflows where one agent routes work to specialist agents.
- Flows that must check input or output against a rule before acting.
- Assistants that remember a customer across separate conversations.
Prerequisites
- Python functions, dictionaries and async/await at a reading level.
- No API key needed: lessons 1 to 6 run against the stand-in model.
- Python 3.9 or newer and the
openai-agentspackage.
Related
Every expert started right here.