Openai Agents SDK
Agent Buildingopenai-agents-sdkOpenai Agents SDK is an Agent Skill for agent building published in the mkurman/zorai repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
OpenAI Agents SDK — build agentic workflows with handoffs, guardrails, and tool integration. Single-agent to multi-agent orchestration. Tracing and observability. Python-first SDK from OpenAI.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/mkurman/zorai/blob/HEAD/skills/scientific-skills/openai-agents-sdk/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/openai-agents-sdk, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Overview
OpenAI Agents SDK provides a lightweight framework for building agentic AI workflows. Supports tool use, handoffs (agent-to-agent routing), guardrails, and tracing — built on the OpenAI API's native agent primitives.
Installation
uv pip install openai-agents
Basic Agent
from agents import Agent, Runner
agent = Agent(name="Helper", instructions="You are a helpful assistant.")
result = Runner.run_sync(agent, "What is the capital of France?")
print(result.final_output)
Tool Use
from agents import Agent, Runner, function_tool
@function_tool
def get_weather(city: str) -> str:
return f"Weather in {city}: sunny, 22°C"
agent = Agent(name="WeatherBot", instructions="Use tools to answer weather queries.", tools=[get_weather])
result = Runner.run_sync(agent, "What's the weather in London?")
print(result.final_output)
Handoffs
from agents import Agent, Runner
triage = Agent(name="Triage", instructions="Route to the right specialist.")
billing = Agent(name="Billing", instructions="Handle billing questions.")
triage.handoffs = [billing]
result = Runner.run_sync(triage, "My invoice didn't arrive")