# OpenAI Agents SDK

> Canonical: https://skillalmanac.com/glossary/openai-agents-sdk | Last verified: 2026-11-24 | Index status: not offered to search engines

The OpenAI Agents SDK is a code library from OpenAI for building agent applications in your own environment. The SDK runs the agent loop and supports handoffs between agents while your application keeps control of deployment, tools, storage and approvals.

Also called: agents sdk, openai agent sdk, OpenAI Agents SDK Python, openai agents python.

## In plain language

The OpenAI Agents SDK is a set of building blocks from OpenAI for developers who want to write their own AI agent. An agent here is a language model given instructions and tools, such as a search function or a database lookup. The library runs the back-and-forth in which the model asks for a tool, gets the result and decides what to do next, and it can pass a conversation from one agent to a specialist agent. Your own server still runs the tools and stores the data. The model can still make mistakes, and each extra step costs model calls, so test with limits before you let it act.

## Technical definition

OpenAI's guide describes the Agents SDK as the option in which the SDK runs inside your application, while the Agents API runs a managed harness in OpenAI's service. The SDK runs the agent loop, calls your tool implementations and supports handoffs; your server handles deployment, state storage and approvals. The guide describes guardrails as validation and human review that can block or pause risky work, and tracing as the first tool for debugging before evaluation. The SDK is available in Python and TypeScript.

## How it shows up when you use agents

The Agents SDK is for building an agent into your own product. It does not replace a coding agent such as Codex or Claude Code. You meet it when a team wants a support assistant, a triage workflow or an internal tool in which a model uses tools and passes work between specialist agents.

- **Your application owns the risk.** OpenAI's guide says the SDK runs in your application, so deployment, tool implementations, storage and approvals are yours. A tool that deletes records is as dangerous as you make it. Add approvals for risky actions.
- **Handoffs carry context.** A third-party guide (Blaxel, which sells sandbox infrastructure) reports that each handoff passes the full conversation history by default, so budget multi-agent runs. Check OpenAI's documentation for the current behaviour. See [Agent loop](/glossary/agent-loop).
- **Trace before you tune.** OpenAI's guide recommends using traces for debugging first and then moving to evaluation. See [Observability](/glossary/observability).
- **Pin versions.** The Blaxel guide says the SDK was pre-1.0 when it was written and that minor versions can carry breaking changes. Verify this against the release notes you use.

Next action: write down which tools the agent may call and which of them need a human check, then add guardrails for those. See [Guardrails](/glossary/guardrails).

## Common confusions

- **Agents SDK versus Agents API.** OpenAI's guide contrasts them: the SDK runs in your application, the API runs a managed harness in OpenAI's service.
- **Agents SDK versus Codex.** Codex is a coding agent product; the SDK is a library for building agents. See [AI agent framework](/glossary/ai-agent-framework).
- **Agents SDK versus the Claude Agent SDK.** They come from different vendors and have different design choices. See [Claude Agent SDK](/glossary/claude-agent-sdk).
- **Handoff versus tool call.** A handoff passes the conversation to another agent; a tool call runs a function and returns to the same agent. See [Tool calling](/glossary/tool-calling).

## Worked examples in this catalogue

### [What Is OpenAI Codex? Surfaces and Their Uses](https://skillalmanac.com/learn/what-is-openai-codex)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: The guide explains Codex as a set of surfaces: a terminal CLI, an IDE extension, a cloud agent and a desktop app, and what each is for.

Why it exercises the concept: Codex is OpenAI's coding agent product you run. The Agents SDK is a library for building your own agent application. Reading the guide first makes that difference clear.

### [openai-docs](https://skillalmanac.com/skills/openai/openai-docs)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: The skill answers questions about Codex and first OpenAI API integrations and model migrations.

Why it exercises the concept: It is a catalogue route into OpenAI's documentation when you start wiring an application to OpenAI's APIs, which is the setting the SDK is built for.

### [Codex](https://skillalmanac.com/tools/codex)

```
codex
```

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: You can use Codex interactively from your terminal.

Why it exercises the concept: It shows a finished agent product whose loop you do not write. The SDK gives you the pieces to write that kind of loop for your own application.

### [How to Build an AI Agent: A Minimal Tool Loop](https://skillalmanac.com/learn/build-an-ai-agent)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: The guide builds a minimal agent in Python as a tool-use loop with a cap on iterations, using Claude's Messages API.

Why it exercises the concept: It shows the loop that an agent SDK's runner packages, using a different provider's API. The structure, not the vendor, is the point.

## Related terms

- [AI agent framework](https://skillalmanac.com/glossary/ai-agent-framework.md)
- [AI agent](https://skillalmanac.com/glossary/ai-agent.md)
- [Tool calling (function calling)](https://skillalmanac.com/glossary/tool-calling.md)
- [Guardrails](https://skillalmanac.com/glossary/guardrails.md)
- [Agent loop](https://skillalmanac.com/glossary/agent-loop.md)
- [AI observability (LLM observability)](https://skillalmanac.com/glossary/observability.md)

## Sources

- [Agents SDK](https://developers.openai.com/api/docs/guides/agents/sdk), OpenAI (accessed 2026-11-24)
- [OpenAI Agents SDK (Python documentation)](https://openai.github.io/openai-agents-python/), OpenAI (accessed 2026-11-24)
- [OpenAI Agents SDK guide to tools, handoffs, and sandboxes](https://blaxel.ai/blog/openai-agents-sdk-guide), Blaxel (accessed 2026-11-24)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-24. [Glossary index](https://skillalmanac.com/glossary.md).
