Agents SDK

The OpenAI Agents SDK is an open-source library for Python (openai-agents) and TypeScript (@openai/agents) that runs agents with tools, handoffs and tracing inside your own app. OpenAI also offers the hosted Agents API (beta since Sep 10, 2026) and ChatKit, while Agent Builder shuts down Nov 30, 2026.

The OpenAI Agents SDK is a free, open-source library for building AI agents in your own code: install it with pip install openai-agents for Python or npm install @openai/agents zod for TypeScript, define an agent with instructions and tools, and let its runner handle the loop of model calls, tool calls and handoffs between agents (Agents SDK quickstart). You pay only for the OpenAI API tokens and tools it uses. It is one of four ways OpenAI offers to build agents as of Nov 6, 2026: the hosted Agents API, the Agents SDK, the plain Responses API, and ChatKit for an embedded chat window (agents guide). Agent Builder, the visual workflow editor launched with ChatKit in October 2025, shuts down on Nov 30, 2026.

A smiling man at a laptop with the words Agents API
A smiling man at a laptop with the words Agents API OpenAI

Quick facts

What Open-source agent framework that runs in your application
Python package openai-agents, import from agents import Agent, Runner
TypeScript package @openai/agents (with zod)
Released Python Mar 11, 2025; TypeScript Jun 3, 2025
Latest Python release v0.24.0, Oct 15, 2026 (v0.24.0-alpha.6 pre-release Nov 3, 2026)
Latest TypeScript release @openai/agents-extensions 0.21.0, Oct 20, 2026
Cost Free library; model and tool use billed at API prices
Hosted alternative Agents API, public beta since Sep 10, 2026
Agent Builder Shuts down Nov 30, 2026; ChatKit stays

Which OpenAI agent option should you use?

OpenAI's agents guide lays the four options out by how much you manage yourself (agents guide, read Nov 6, 2026):

Option Who runs the loop Integration effort Good for
Agents API OpenAI (a managed Codex harness) Low Long-running tasks, with saved sessions and an OpenAI-hosted, self-hosted or no sandbox
Agents SDK Your application Medium Reusable agents, tools and handoffs under your control
Responses API You, call by call High Full control over history and each step
ChatKit Embedded UI on top of a backend Low for the UI A chat window for an agent inside your product

In short: choose the Agents API if you want OpenAI to host the agent and its sandbox, the Agents SDK if the agent must run in your own servers or call your own systems, and the Responses API if you want no framework at all.

How to build a first agent with the Agents SDK

  1. Install the package: pip install openai-agents (Python) or npm install @openai/agents zod (TypeScript).
  2. Set OPENAI_API_KEY in the environment.
  3. Create an Agent with a name, instructions and any tools.
  4. Run it with Runner (Python) or run (TypeScript) and read the final output.
  5. Open the Traces dashboard to see each model call, tool call, handoff and guardrail check (quickstart).
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)

That is the hello-world example from the SDK's own Python documentation, which calls its building blocks "a very small set of primitives": agents, agents as tools and handoffs, and guardrails.

Core concepts

Agents and tools. An agent is a model with instructions and tools. Tools can be your own functions, MCP servers, or OpenAI's hosted tools such as web search and file search (agents guide).

Handoffs. A workflow can be split into specialist agents, with a router that delegates to them through handoffs (quickstart).

Sessions. The SDK can load and save the conversation history for you between turns. An SDK session is a different thing from an Agents API session or a Responses conversation (agents guide).

Guardrails and tracing. Guardrails validate an agent's inputs and outputs (Agents SDK docs), and their checks show up in traces next to model calls and handoffs; "the normal server-side SDK path includes tracing" (quickstart).

Sandboxes. Sandboxes and harness customization came to the Agents SDK on Apr 15, 2026, and sandbox agents reached the TypeScript SDK on May 6, 2026. The SDK uses your own runtime or a sandbox provider integration.

The Agents API

The Agents API is OpenAI's hosted agent service: "a managed Codex harness for long-running tasks" with automatic compaction, multi-agent orchestration, Programmatic Tool Calling (on by default) and MCP (agents guide, tools guide). Its timeline from the changelog:

  • Sep 10, 2026: public beta.
  • Sep 29, 2026 (DevDay 2026): computer use. Unite.AI's DevDay report adds multi-agent, tool search and compaction, and Amazon Bedrock Managed Agents running the Agents API inside AWS (Unite.AI).
  • Oct 9, 2026: sandbox prewarming, with compute billed only during active turns.
  • Oct 16, 2026: Ultrafast mode, plus the Artifact SDK and document skills in sandboxes.

The guide read for this page states no separate Agents API price; tokens and tools are billed at the API rates. For the coding agent built on the same harness, see Codex and the Codex SDK.

AgentKit, Agent Builder and ChatKit

At DevDay on Oct 6, 2025, OpenAI launched Agent Builder, a visual canvas for agent workflows, and ChatKit, an embeddable chat UI. OpenAI's pricing page still groups ChatKit under the label "Agent Kit" (pricing); the changelog itself does not use the name AgentKit.

  • Agent Builder was marked for retirement on Jun 3, 2026 and shuts down on Nov 30, 2026. OpenAI's named replacements are the Agents SDK or ChatGPT Workspace Agents. Move workflows out before that date.
  • ChatKit "remains available" (deprecations). Files and images uploaded through it are stored at $0.10 per GB-day after 1 GB free per account per month.
  • Evals, often used to test Agent Builder workflows, went read-only on Oct 31, 2026 and shuts down Nov 30, 2026; OpenAI names Promptfoo as the replacement (deprecations).

Multi-agent features in the Responses API

Agents can also be built without either framework. The changelog lists a Responses multi-agent beta with GPT-5.6 (Jul 9, 2026), async tool calling and mid-turn steering with GPT-6 Astra (Sep 3, 2026), and beta multi-agent delegation with GPT-6.1 Sol (Sep 29, 2026).

At DevDay 2026 OpenAI also put a Decisions API, which uses GPT-6 Luna to classify, route or choose an agent's next action, into limited preview (Unite.AI). In OpenAI's video introducing it, you give it text or an image, the question and the possible answers, and it replies in "a fraction of a second"; OpenAI says focusing the model on a few choices makes it nearly 10 times faster.

For agents inside ChatGPT rather than your own product, see Agent Mode and Plugins. To compare OpenAI's agent stack with Anthropic's, see OpenAI API vs Claude API.

Frequently asked questions

Is the OpenAI Agents SDK free? Yes. The Agents SDK is open source and free to install for Python and TypeScript; you pay only for the OpenAI API tokens and hosted tools your agents use.

How do I install the OpenAI Agents SDK? Run pip install openai-agents for Python or npm install @openai/agents zod for TypeScript, then set OPENAI_API_KEY in your environment.

What is the difference between the Agents SDK and the Agents API? The Agents SDK runs the agent loop inside your own application, while the Agents API, in public beta since Sep 10, 2026, is OpenAI's hosted harness that runs long tasks and sandboxes for you.

Is OpenAI Agent Builder shutting down? Yes. OpenAI shuts down Agent Builder on Nov 30, 2026 and points users to the Agents SDK or ChatGPT Workspace Agents; ChatKit remains available.

What is AgentKit? "Agent Kit" is the heading OpenAI's API pricing page still uses for ChatKit storage, as of Nov 6, 2026. The agent tools OpenAI launched at DevDay on Oct 6, 2025 were Agent Builder, which shuts down Nov 30, 2026, and ChatKit, which stays.

Sources

Moments

Introducing the Agents API

OpenAI

  1. In short: choose the Agents API if you want OpenAI to host the agent and its sandbox, the Agents SDK if the agent must…
  2. The Agents API is OpenAI's hosted agent service: "a managed Codex harness for long-running tasks" with automatic…

Introducing the Decisions API

OpenAI

  1. At DevDay 2026 OpenAI also put a Decisions API, which uses GPT-6 Luna to classify, route or choose an agent's next…

Photos

A smiling man at a laptop with the words Agents API

See also

About this page

Last updated Nov 6, 2026 by the Vi.ki team. Page text CC BY-SA 4.0.

Edit History

Hotkeys

/
Jump to the search box
? or Ctrl + /
Open this list
Esc
Close this list, the photo viewer, or the account menu

Video

Space or K
Play or pause
← →
Back or forward 5 seconds
J L
Back or forward 10 seconds
0 to 9
Go to 0% to 90% of the video
, .
Previous or next frame, while paused
M
Mute or unmute
C
Captions on or off
F
Full screen on or off
A D
Previous or next moment

Photo viewer

← → or A D
Previous or next photo
↑ ↓ or W S
Previous or next photo
Home End
First or last photo
I
Show or hide the photo's info
Z
Clickless on or off: a pointer over a thumbnail shows it
N
Compare with the last photo: back to the one shown before this, and N again comes back
Q
Move the thumbnails to the next edge: top, bottom, left and round
, or Ctrl + ,
Open or close the viewer's settings
V
Clickless pan: a zoomed photo follows the pointer, rather than being dragged
Shift
Browse on or off
B
Show or hide the button bar
T
Show or hide the thumbnails
1
100% zoom on or off
0
Rate the photo as no opinion; again takes the answer back
+ -
Rate the photo a step higher or lower
F
Full screen: the photo alone. F again puts everything back.
Back to top