OpenAI Agents SDK

Python framework from OpenAI for building agents with instructions, tools, handoffs, guardrails, and built-in tracing.

Ask your AI about this, with this page as the source:ChatGPT ↗Claude ↗Perplexity ↗

The OpenAI Agents SDK is OpenAI's open-source library for building agents in Python, with a TypeScript version alongside it. It is the production successor to Swarm, OpenAI's earlier agents experiment with a deliberately small set of building blocks.

An Agent is instructions, a model and tools; any Python function becomes a tool with its schema generated automatically and inputs validated by Pydantic. A Runner executes the loop: call the model, run the tool calls it asks for, repeat until there is a final output. Agents can hand the conversation off to another agent or be called as tools by a manager agent, and guardrails check inputs and outputs in parallel and stop the run early when a check fails. OpenAI models are called through the Responses API by default.

Tracing is on by default and shows each run, model call, tool call and handoff in OpenAI's Traces dashboard. Sessions keep conversation history between runs, runs can pause for human approval and resume, agents can call MCP server tools, and sandbox agents work inside isolated local or Docker workspaces. It is a library, so it runs in your own process on any host.

It is built around OpenAI's API. Other providers work through an OpenAI-compatible endpoint, a custom model provider, or the LiteLLM and Any-LLM adapters, which are beta and best-effort, and some features only work on the Responses API. Tracing needs an OpenAI key and is unavailable to organizations under Zero Data Retention.

Where it fits

How OpenAI Agents SDK itself is built

5 tools, from its own code, website and Product Hunt page.

Who uses it

1 makers' products, each linked to the source that shows it, and 39 open-source projects that declare it in their code.

The maker says so 1Declared in code 39How evidence is collected →
DeepvBrowserLightning-fast AI voice browser turning words into workflows

“Simplifies task decomposition and tool orchestration—define tools once and reuse across multiple browsing flows. Strong state management, invocation constraints, and observability, so we focus on user experience instead of glue code.”

AI SDK & Agent FrameworkMaker says so · source ↗
omiOpen-source AI wearable with mobile and desktop apps that records conversations and meet…AI SDK & Agent FrameworkIn its code · source ↗

Open source: a project that declares OpenAI Agents SDK as a dependency in its public code — verifiable, but not necessarily a live product.

What makers say

1 makers on why they use OpenAI Agents SDK, in their own words on Product Hunt.

Simplifies task decomposition and tool orchestration—define tools once and reuse across multiple browsing flows. Strong state management, invocation constraints, and observability, so we focus on user experience instead of glue code.
DeepvBrowserSep 2026 ↗

Loved and watch-outs

Themes that recur in makers' words and Hacker News comments, each linked to what it summarises.

Most loved
  • Minimal and simpler than most agent frameworks, a sensible default when starting out. HNHN 2
  • Its abstractions for handoffs, subagents, tools, guardrails and structured output hold up in real use. HNPHHN 2
  • MIT-licensed and self-hosted, so you control integrations and what gets exposed to the model provider. HNHN 2
Watch-outs
  • Hosting, observability and reliable scaling are left to you, which is the bigger effort. HN

Alternatives to OpenAI Agents SDK

All alternatives by situation →

Questions makers ask about OpenAI Agents SDK

Is there a TypeScript version?

Yes. The Agents SDK for TypeScript has the same primitives (agents, handoffs, guardrails, function tools and tracing) and its own documentation. source ↗

Can I use non-OpenAI models?

Yes. Point the SDK at any OpenAI-compatible endpoint, set a custom model provider for a run, or set a model per agent; LiteLLM and Any-LLM adapters are available as beta. Without an OpenAI key, the docs recommend disabling tracing or sending traces elsewhere. source ↗

Where do traces go, and can I turn them off?

By default to OpenAI's Traces dashboard. Disable them globally with OPENAI_AGENTS_DISABLE_TRACING=1 or per run, or add custom processors to send them to another destination. Tracing is not available under a Zero Data Retention policy. source ↗

How does the agent remember earlier turns?

Pass a session to the runner and it loads and saves history automatically; SQLite is built in, with Redis, SQLAlchemy, MongoDB and encrypted options. Alternatively use OpenAI's server-side conversation state, but not both in the same run. source ↗

When should I use the Responses API directly instead?

When you want to own the loop, tool dispatch and state yourself, or the job is a short call that just returns the model's answer. The SDK is for when you want it to manage turns, tools, guardrails, handoffs and sessions, and many apps use both. source ↗

Is OpenAI Agents SDK free?

Yes — it is free, open-source software.

Is OpenAI Agents SDK open source or self-hostable?

Open source, and you can self-host it. source ↗

Can AI coding agents work with OpenAI Agents SDK?

No llms.txt, official MCP server or CLI found yet.

Who uses OpenAI Agents SDK?

1 makers' products we track, each with a source, and 39 open-source projects declare it in their code. source ↗