@laguagu/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.

View in AI SkillSafe app
0 downloads
0 stars
0 demos
SKILL.md
nameopenai-agents-sdk
argument-hint[question or feature]
descriptionOpenAI 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.

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). There is no
                          # bare "gpt-5.6" — every GPT-5.6 call names a variant. 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

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 Isolated execution environment for agents
Subagents Spawn specialized subordinate agents (Python; TS in beta/development)
Observability Built-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

Embed badges

Add these to your README to show the skill's verification status.

SkillSafe verified badge
Verified badge
[![SkillSafe verified badge](https://api.skillsafe.ai/v1/badge/@laguagu/openai-agents-sdk/verified)](https://skillsafe.ai/skill/@laguagu/openai-agents-sdk/)
Installs badge
Installs badge
[![Installs badge](https://api.skillsafe.ai/v1/badge/@laguagu/openai-agents-sdk/installs)](https://skillsafe.ai/skill/@laguagu/openai-agents-sdk/)
Scan badge
Scan badge
[![Scan badge](https://api.skillsafe.ai/v1/badge/@laguagu/openai-agents-sdk/scan)](https://skillsafe.ai/skill/@laguagu/openai-agents-sdk/)
Eval pass rate badge
Eval pass rate
[![Eval pass rate badge](https://api.skillsafe.ai/v1/badge/@laguagu/openai-agents-sdk/eval)](https://skillsafe.ai/skill/@laguagu/openai-agents-sdk/)