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.
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
- Install the package:
pip install openai-agents(Python) ornpm install @openai/agents zod(TypeScript). - Set
OPENAI_API_KEYin the environment. - Create an
Agentwith a name, instructions and any tools. - Run it with
Runner(Python) orrun(TypeScript) and read the final output. - 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
- Agents, OpenAI, read Nov 6, 2026
- Agents SDK quickstart, OpenAI, read Nov 6, 2026
- Tools, OpenAI, read Nov 6, 2026
- Pricing, OpenAI, read Nov 6, 2026
- Changelog, OpenAI, read Nov 6, 2026
- Deprecations, OpenAI, read Nov 6, 2026
- OpenAI Agents SDK (Python) documentation, OpenAI, read Nov 6, 2026
- openai-agents-python releases, GitHub, read Nov 6, 2026
- openai-agents-js releases, GitHub, read Nov 6, 2026
- OpenAI unveils GPT-6.1 Sol at DevDay with new Codex and ChatGPT tools, Unite.AI, read Nov 6, 2026
- Introducing the Agents API, OpenAI, Sep 10, 2026 (video)
- Introducing the Decisions API, OpenAI, Oct 6, 2026 (video)
Moments
Introducing the Agents API
OpenAI
Introducing the Decisions API
OpenAI
Photos
See also
-
OpenAI APIThe OpenAI API lets programs call OpenAI's models (GPT-6 Astra, GPT-6.1 Sol, GPT-6.1 Terra, GPT-6 Luna, image, voice and transcription models) with an API key, billed per token. New projects use the Responses API through the official SDKs, with documentation at developers.openai.com.
-
Responses APIThe Responses API is OpenAI's recommended endpoint for new projects, combining model calls, built-in tools, structured outputs and conversation state in one request. Chat Completions is still supported, and the Assistants API it replaced shut down on Aug 26, 2026.
-
CodexCodex is OpenAI's coding agent: it reads a codebase, edits files, runs commands and tests, reviews pull requests and works in the cloud. As of Nov 6, 2026 it lives inside the ChatGPT desktop app, in the Codex CLI, in IDE extensions, in Codex Cloud and on mobile, and every ChatGPT plan includes some of it, Free and Go too.
- Codex SDKThe Codex SDK lets programs run OpenAI's Codex agent: npm install @openai/codex-sdk for TypeScript (Node.js 18 or later) or pip install openai-codex for Python (3.10 or later). For CI there is also codex exec, the non-interactive CLI mode, and the GitHub Action openai/codex-action@v1; the App Server is the protocol for building full Codex clients.
-
Agent ModeAgent mode (ChatGPT agent) lets ChatGPT do tasks on the web in its own virtual browser, such as filling forms or booking, asking before important steps. It launched on Jul 17, 2025, replacing Operator; it is for paid plans, with 40 tasks a month on Plus and 400 on Pro, and longer agentic work now also runs in ChatGPT Work. -
PluginsPlugins are ChatGPT's 2026 name for apps and connectors: packages that connect ChatGPT to services such as Gmail, Google Drive, Slack or iCloud and bundle skills for a task. You find them under Plugins in the sidebar or at chatgpt.com/plugins, on every plan.