openai-agents-sdk

openai-agents-sdk is a skill for Claude Code, Codex from laguagu/claude-code-nextjs-skills. It costs 125 tokens per session (1,357 once invoked), scanned B, original, MIT.

A Python toolkit guide for building AI agents—programs that use language models to complete tasks. It covers single agents, teams of agents, tools, safety checks, conversations, live output, and tracing their work.

In plain words
What is it for?
Use it to build Python agents, pass work between multiple agents, add function tools and safety checks, keep session history, stream responses, validate JSON with Pydantic, or connect through Azure OpenAI using LiteLLM.
Why use it?
It helps developers follow the SDK's patterns when connecting agents to models and external actions. This reduces guesswork when choosing between synchronous and asynchronous runs or adding structured results.

Skill for Claude CodeCodex

Written for Claude Code and Codex: shipped in a Claude Code plugin, but also reads ~/.codex or $CODEX_HOME. Also seen: mentions subagents; mentions Claude Code; mentions Codex.

Part of the claude-code-nextjs-skills plugin — 24 skills, 2 agents, 2 MCP servers shipped together

not rated 62repo changed 8d ago B scan Socket: passSnyk: warnSkillSpector: warn 125 tokens original MIT

Good fit Use it to build Python agents, pass work between multiple agents, add function tools and safety checks, keep session history, stream responses, validate JSON with Pydantic, or connect through Azure OpenAI using LiteLLM.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/laguagu/claude-code-nextjs-skills/openai-agents-sdk
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add laguagu/claude-code-nextjs-skills --skill openai-agents-sdk
Clone the repo
git clone --depth 1 https://github.com/laguagu/claude-code-nextjs-skills

Made for: Claude Code, Codex.

Or install claude-code-nextjs-skills, the plugin that ships this one along with the rest of its 24 skills, 2 agents, 2 MCP servers.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for openai-agents-sdk

README.md
[![agentmods](https://agentmods.dev/badge/skills/laguagu/claude-code-nextjs-skills/openai-agents-sdk/github.svg)](https://agentmods.dev/skills/laguagu/claude-code-nextjs-skills/openai-agents-sdk)
Your own site
<a href="https://agentmods.dev/skills/laguagu/claude-code-nextjs-skills/openai-agents-sdk"><img src="https://agentmods.dev/badge/skills/laguagu/claude-code-nextjs-skills/openai-agents-sdk/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for openai-agents-sdk

Your own site · 80×15
<a href="https://agentmods.dev/skills/laguagu/claude-code-nextjs-skills/openai-agents-sdk"><img src="https://agentmods.dev/badge/skills/laguagu/claude-code-nextjs-skills/openai-agents-sdk.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 125 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,357 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 20 Apr 2026
  • Snyk warn 20 Apr 2026
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Agent Snooping · line 85
    Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.
    Fix: Remove all code or instructions that access agent configuration directories (.claude/, .codex/, .gemini/). If configuration values are needed, pass them explicitly as parameters or environment variabl
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00125 $0.01357
Opus 5 $0.00063 $0.00678
Sonnet 5 $0.00025 $0.00271
Haiku 4.5 $0.00013 $0.00136

Measured 8d ago against content hash 64c4b50b4a24, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade B, and why

openai-agents-sdk scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

Or config (`~/.codex/config.toml`, VS Code `.vscode/mcp.json`, Cursor `~/.cursor/mcp.json`):
skills/openai-agents-sdk/SKILL.md · 119 lines

How it starts

The opening of the file, as written. The whole thing — 119 lines — stays where its author put it; the contents beside it link to each section on GitHub.

OpenAI Agents SDK (Python)

Use this skill when developing AI agents using OpenAI Agents SDK (openai-agents package).

Quick Reference

Installation

uv add openai-agents        # or `pip install openai-agents` outside a uv project

Environment Variables

OPENAI_API_KEY=sk-...

Using Azure or another provider instead? See agents.md — don't hardcode provider env vars here, they vary and go stale.

Basic Agent

from agents import Agent, Runner

agent = Agent(
    name="Assistant",
    instructions="You are a helpful assistant.",
    model="gpt-5.6-sol",  # or "gpt-5.6-terra" / "gpt-5.6-luna" (cheaper tiers).
                          # "gpt-5.6" is an alias for gpt-5.6-sol. Verify
                          # current IDs from the model catalog.
)

# Synchronous
result = Runner.run_sync(agent, "Tell me a joke")
print(result.final_output)

# Asynchronous
result = await Runner.run(agent, "Tell me a joke")

Omitting model= uses the SDK's built-in default (currently gpt-5.6-luna with low-effort reasoning settings) — set it explicitly in production so an upstream default change cannot swap tiers silently.

Key Patterns

Pattern Purpose
Basic Agent Simple Q&A with instructions
Azure/LiteLLM Azure OpenAI integration
AgentOutputSchema Strict JSON validation with Pydantic
Function Tools External actions (@function_tool)
Streaming Real-time UI (Runner.run_streamed)
Handoffs Specialized agents, delegation
Agents as Tools Orchestration (agent.as_tool)
LLM as Judge Iterative improvement loop
Guardrails Input/output validation
Sessions Automatic conversation history
Multi-Agent Pipeline Multi-step workflows
Sandboxing SandboxAgent — filesystem, shell and skills inside a local/Docker sandbox (beta)
Tracing Built-in spans for runs, tools, handoffs and guardrails; pluggable processors

Read the full file on GitHub · 119 lines

Files

What ships with it

9 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago Changed · +10 lines · +16 tokens per session 64c4b50b4a24
  2. 12d ago First seen · 109 lines · 109 tokens per session scan B 1920b2e8e04d

Subscribe to this mod's changes

openai-agents-sdk is a skill published in the GitHub repository laguagu/claude-code-nextjs-skills (62 stars, last pushed 10d ago), licensed MIT. It adds 125 tokens to every session and 1,357 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

port-sacred-terminal-ui-to-python

Take a React Window.tsx (or any sacred component) and produce a terminal CLI screen written in Python that uses Simulacrum's Python mirror in scripts/python/sacredcli/. Simulacrum is the sacred CLI framework — the JavaScript half lives in scripts/cli/lib/, the Python half is a one-to-one snakecase mirror.

internet-development/www-sacred · 0 tokens

python-agent-engine

A production-ready Python AI Agent engine using LangChain. Supports ReAct pattern, tool calling, and thinking process tracking.

kennyzir/7deer_skills · 28 tokens

python

The Vovk.ts Python client — generating a typed Python package from a Vovk API with vovk-python, the py / pySrc templates, TypedDict shapes, JSON + JSON Lines consumption, client-side validation, and PyPI publishing. Use whenever the user wants a typed Python SDK, ongoing Python integration, or PyPI publishing …

finom/vovk · 261 tokens

leiloeiro-edital-ranbot-ai

Analise e auditoria de editais de leilao judicial e extrajudicial. Riscos ocultos, clausulas perigosas, debitos, ocupante e classificacao da oportunidade.

ThomasMoreAI/legal-skills-open · 51 tokens

jupyter-live-kernel

Iterative Python via live Jupyter kernel (hamelnb).

kevinnft/ai-agent-skills · 19 tokens

pennylane

Hardware-agnostic quantum ML framework with automatic differentiation. Use when training quantum circuits via gradients, building hybrid quantum-classical models, or needing device portability across IBM/Google/Rigetti/IonQ. Best for variational algorithms (VQE, QAOA), quantum neural networks, and integration with…

K-Dense-AI/scientific-agent-skills · 98 tokens