Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
laguagu avatar

Openai Agents Sdk

  • 1.3k installs
  • 57 repo stars
  • Updated August 3, 2026
  • laguagu/claude-code-nextjs-skills

openai-agents-sdk is a Claude Code skill that provides expert guidance for building, debugging, and extending AI agents with the official OpenAI Agents SDK Python package.

About

openai-agents-sdk is a Claude Code skill from laguagu/claude-code-nextjs-skills for developing AI agents with the official OpenAI Agents SDK (`openai-agents` / `agents` Python package). It triggers on imports from `agents`, uses of `Runner.run_sync` and `Runner.run_streamed`, `@function_tool`, `AgentOutputSchema`, `SQLiteSession`, guardrails, multi-agent handoffs, streaming, and tracing—including Azure OpenAI via LiteLLM. Installation is `pip install openai-agents`. Developers reach for this skill when implementing production agent loops, debugging tool-calling failures, or extending sessions and guardrails beyond quick-start examples.

  • Handles OpenAI Agents SDK (`openai-agents` package) including Azure OpenAI via LiteLLM
  • Triggers on imports, Runner.run_sync/run_streamed, @function_tool, AgentOutputSchema, SQLiteSession
  • Supports multi-agent handoffs, function tools, guardrails, sessions, streaming and tracing
  • Provides ready-to-use patterns for basic agents, Azure integration, and advanced workflows

Openai Agents Sdk by the numbers

  • 1,268 all-time installs (skills.sh)
  • +72 installs in the week ending Aug 4, 2026 (Skillselion tracking)
  • Ranked #900 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/laguagu/claude-code-nextjs-skills --skill openai-agents-sdk

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1.3k
repo stars57
Security audit2 / 3 scanners passed
Last updatedAugust 3, 2026
Repositorylaguagu/claude-code-nextjs-skills

How do you build agents with OpenAI Agents SDK Python?

Get expert guidance when writing, debugging, or extending agents with the official OpenAI Agents SDK in Python.

Who is it for?

Python developers implementing multi-agent workflows with the official openai-agents package and LiteLLM Azure support.

Skip if: Developers building agents exclusively with LangChain, CrewAI, or non-OpenAI SDK frameworks without the agents Python package.

When should I use this skill?

Code imports from agents, uses Runner.run_sync, @function_tool, SQLiteSession, or asks about openai-agents-python SDK behavior.

What you get

Working agent code with Runner loops, function tools, guardrails, sessions, and trace-ready configuration.

  • Agent implementation code
  • Function tool definitions
  • Session and guardrail configuration

Files

SKILL.mdMarkdownGitHub ↗

OpenAI Agents SDK (Python)

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

Quick Reference

Installation

pip install openai-agents

Environment Variables

# OpenAI (direct)
OPENAI_API_KEY=sk-...
LLM_PROVIDER=openai

# Azure OpenAI (via LiteLLM)
LLM_PROVIDER=azure
AZURE_API_KEY=...
AZURE_API_BASE=https://your-resource.openai.azure.com
AZURE_API_VERSION=2024-12-01-preview

Basic Agent

from agents import Agent, Runner

agent = Agent(
    name="Assistant",
    instructions="You are a helpful assistant.",
    model="gpt-5.4",  # or "gpt-5.4-mini", "gpt-5.4-nano"
)

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

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

Key Patterns

PatternPurpose
Basic AgentSimple Q&A with instructions
Azure/LiteLLMAzure OpenAI integration
AgentOutputSchemaStrict JSON validation with Pydantic
Function ToolsExternal actions (@function_tool)
StreamingReal-time UI (Runner.run_streamed)
HandoffsSpecialized agents, delegation
Agents as ToolsOrchestration (agent.as_tool)
LLM as JudgeIterative improvement loop
GuardrailsInput/output validation
SessionsAutomatic conversation history
Multi-Agent PipelineMulti-step workflows
SandboxingIsolated execution environment for agents
SubagentsSpawn specialized subordinate agents (Python + TS)
ObservabilityBuilt-in execution graph recording

Preferred: Live Docs via MCP

Model names and API details change frequently. When available, consult the OpenAI Developer Docs MCP server (openaiDeveloperDocs) before relying on the static references below.

Setup (Codex CLI):

codex mcp add openaiDeveloperDocs --url https://developers.openai.com/mcp

Or config (~/.codex/config.toml, VS Code .vscode/mcp.json, Cursor ~/.cursor/mcp.json):

[mcp_servers.openaiDeveloperDocs]
url = "https://developers.openai.com/mcp"

Key tools: mcp__openaiDeveloperDocs__search_openai_docs, fetch_openai_doc, list_api_endpoints, get_openapi_spec.

Rules: Cite fetched docs. Never speculate on field names, defaults, or current model IDs — fetch first. Keep quotes under 125 chars.

Fallback when MCP is unavailable: https://developers.openai.com/api/docs/llms.txt (plain-text index of all API docs; each entry has a .md twin at /api/docs/<slug>.md).

Reference Documentation

Offline/quick-lookup snippets. Verify model names and API signatures against the MCP or docs when accuracy matters.

  • agents.md - Agent creation, Azure/LiteLLM integration
  • tools.md - Function tools, hosted tools, agents as tools
  • structured-output.md - Pydantic output, AgentOutputSchema
  • streaming.md - Streaming patterns, SSE with FastAPI
  • handoffs.md - Agent delegation
  • guardrails.md - Input/output validation
  • sessions.md - Sessions, conversation history
  • patterns.md - Multi-agent workflows, LLM as judge, tracing

Official Documentation

  • Docs: https://openai.github.io/openai-agents-python/
  • Examples: https://github.com/openai/openai-agents-python/tree/main/examples
  • Major update: https://openai.com/index/the-next-evolution-of-the-agents-sdk/
  • Docs MCP setup: https://developers.openai.com/learn/docs-mcp
  • Docs index (llms.txt): https://developers.openai.com/api/docs/llms.txt
  • Current model IDs: https://platform.openai.com/docs/models

Related skills

How it compares

Use openai-agents-sdk for the official OpenAI agents Python package; choose LangChain- or CrewAI-focused skills for those alternative agent stacks.

FAQ

Which Python package does openai-agents-sdk cover?

openai-agents-sdk covers the official OpenAI Agents SDK installed with pip install openai-agents, imported as agents or openai-agents. It includes Runner APIs, function tools, guardrails, sessions, streaming, and tracing.

Does openai-agents-sdk support Azure OpenAI?

openai-agents-sdk includes guidance for Azure OpenAI integration through LiteLLM alongside standard OpenAI Agents SDK Runner and tool patterns in Python.

Is Openai Agents Sdk safe to install?

skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

AI & Agent Buildingagentsllmautomation

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.