Skip to content
BENIBIX Learn

OpenAI Agents SDK

Development🧬 AI EngineeringLLM Frameworks

Also known as Agents SDK (OpenAI), openai-agents, OpenAI Agents Library

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

Think of it like

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

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.

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.

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 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.
The OpenAI Agents SDK is the one where agents hand work to each other.

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.

Key takeaways

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