skillZs
LIVE SKILL TAGS
>>> LIVE SKILLS INDEX <<<
* OPEN SOURCE *
NO LOGIN, NO TRACKING
REAL INSTALL DATA
← back to all skills
laguagu/claude-code-nextjs-skills1k installs

openai-agents-sdk

OpenAI Agents SDK (Python) development. Use when building AI agents, multi-agent handoffs, function tools, guardrails, sessions, streaming, or tracing with the `openai-agents` / `agents` Python package — including Azure OpenAI via LiteLLM. Triggers on imports from `agents`, uses of `Runner.run_sync`/`Runner.run_streamed`, `@function_tool`, `AgentOutputSchema`, `SQLiteSession`, or questions about the openai-agents-python SDK.

How do I install this agent skill?

npx skills add https://github.com/laguagu/claude-code-nextjs-skills --skill openai-agents-sdk
view source ↗

Is this agent skill safe to install?

  • Gen Agent Trust Hubpass

    The skill provides documentation and code snippets for the OpenAI Agents SDK. It follows security best practices by demonstrating how to implement guardrails for input/output validation and tool access control. All external references point to official and trusted OpenAI domains.

  • Socketpass

    No alerts

  • Snykwarn

    Risk: MEDIUM · 1 issue

  • Runlayerpass

    2/9 files flagged

What does this agent skill do?

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_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",  # or "gpt-5.6-terra" / "gpt-5.6-luna" (cheaper tiers); 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")

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 in beta/development)
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.

Official Documentation

Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.

<a href="https://skillzs.dev/skills/laguagu/claude-code-nextjs-skills/openai-agents-sdk">View openai-agents-sdk on skillZs</a>