Openai Agents Sdk logo

Openai Agents Sdk

Community
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. Python only — not the TypeScript `@openai/agents` SDK.

Overview

Publisherlaguagu
Repositoryclaude-code-nextjs-skills
Skill nameopenai-agents-sdk
Stars
64
Forks
18
Bundled files
9
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 9 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by laguagu on GitHub. Read the source before you install it.

Installation

Install the Openai Agents Sdk AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/laguagu/claude-code-nextjs-skills.git /tmp/claude-code-nextjs-skills
mkdir -p .claude/skills
cp -r /tmp/claude-code-nextjs-skills/skills/openai-agents-sdk .claude/skills/openai-agents-sdk
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Openai Agents Sdk in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Openai Agents Sdk on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Openai Agents Sdk is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

OpenAI Agents SDK (Python)

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

Quick Reference

Installation

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

Environment Variables

bash
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

python
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

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
SandboxingSandboxAgent — filesystem, shell and skills inside a local/Docker sandbox (beta)
TracingBuilt-in spans for runs, tools, handoffs and guardrails; pluggable processors

The SDK has no separate Subagent class: express delegation with handoffs or agent.as_tool(). For model-written tool orchestration, use ProgrammaticToolCallingTool and verify its Responses-only constraints.

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):

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

Setup (Claude Code):

bash
claude mcp add --transport http openaiDeveloperDocs https://developers.openai.com/mcp

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

toml
[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 - read when choosing or wiring a model: default-model caveat, LiteLLM, native Azure client
  • tools.md - read when adding function tools, hosted tools, or agents-as-tools
  • structured-output.md - read when the output must be a Pydantic/dataclass shape (AgentOutputSchema, strict vs non-strict)
  • streaming.md - read when streaming to a UI (event types, SSE with FastAPI)
  • handoffs.md - read when one agent delegates to another (handoff vs as_tool, input filters)
  • guardrails.md - read when validating input/output or gating tool calls
  • sessions.md - read when conversation history must persist across requests (SQLite, SQLAlchemy, Redis, OpenAI Conversations)
  • patterns.md - read for multi-agent pipelines, LLM-as-judge loops, tracing controls, max_turns, parallelization
  • sandbox.md - read when the agent must edit files or run commands in an isolated workspace (SandboxAgent, beta)

Official Documentation

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Openai Agents Sdk AI skill do?

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. Python only — not the TypeScript `@openai/agents` SDK.

Why use Openai Agents Sdk on TypingMind?

Because you install it once and use it with any model. Openai Agents Sdk is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Openai Agents Sdk in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/laguagu/claude-code-nextjs-skills/tree/main/skills/openai-agents-sdk. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Openai Agents Sdk?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Openai Agents Sdk?

As many as you like. As long as a model supports skills, you can use Openai Agents Sdk with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Openai Agents Sdk AI skill free?

Yes. It is published on GitHub by laguagu under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇