# OpenAI Agents SDK

> OpenAI's small kit for agents that use tools and pass on work.

**Field:** Software Development  
**Category:** AI Engineering  
**Also known as:** Agents SDK (OpenAI), openai-agents, OpenAI Agents Library

## Think of it like

It is like a relay race. Each runner does a part and hands on the stick.

## Definition

The OpenAI Agents SDK is a small kit from OpenAI for making AI agents in Python or TypeScript. An agent is a model with instructions and tools. One agent can hand a task to another, or call another one as a tool. Guardrails check what goes in and what comes out. Built-in tracing records each run, so you can see what happened. It took over from Swarm, an earlier test project, and it can use other providers' models too.

## Example

Jack builds a front-desk agent that reads each ticket. Billing questions are handed off to a billing agent, and the trace shows every step.

## Example code

```python
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)
```

An agent is a name and its instructions. Runner runs it until it has a final answer.

## Why it matters

It gives agents the parts most of them need, with very little to learn. Tracing makes a run of many steps easy to check.

## Common mistake

Adding a handoff for every small step. Each handoff is one more model call, so a long chain is slow and hard to follow.

## Three principles

- **Agents and tools.** A model with instructions.
- **Handoffs.** One agent passes the work on.
- **Guardrails and tracing.** Check and record each run.

## Related terms

- [Agent SDK](https://learn.benibix.com/term/development/agent-sdk)
- [LLM Framework](https://learn.benibix.com/term/development/llm-framework)
- [Agent Handoff](https://learn.benibix.com/term/ai/agent-handoff)
- [Guardrail (AI)](https://learn.benibix.com/term/ai/guardrail)
- [Claude Agent SDK](https://learn.benibix.com/term/ai/claude-agent-sdk)
- [OpenAI API](https://learn.benibix.com/term/development/openai-api)
- [Google Agent Development Kit (ADK)](https://learn.benibix.com/term/development/google-adk)

![A table of five frameworks, with columns for framework, language and what each is built around. Vercel AI SDK, TypeScript, streaming chat screens. OpenAI Agents SDK, Python and TypeScript, agents handing work to each other. CrewAI, Python, a crew of agents, each with a role. Pydantic AI, Python, answers as typed, checked data. DSPy, Python, tuning prompts from examples. A strip along the bottom says all of them call model APIs underneath.](https://learn.benibix.com/diagrams/dev6-agent-frameworks.svg)

---

Source: https://learn.benibix.com/term/development/openai-agents-sdk
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-20
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
