DEV.co
AI Frameworks · openai

openai-agents-python

OpenAI Agents SDK is a Python framework for building multi-agent workflows that delegate tasks between LLM-powered agents. It supports 100+ LLMs, includes sandbox environments for long-running tasks, and provides guardrails, tracing, and human-in-the-loop capabilities.

Source: GitHub — github.com/openai/openai-agents-python
27.7k
GitHub stars
4.3k
Forks
Python
Primary language
MIT
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositoryopenai/openai-agents-python
Owneropenai
Primary languagePython
LicenseMIT — OSI-approved
Stars27.7k
Forks4.3k
Open issues65
Latest releasev0.18.0 (2026-07-07)
Last updated2026-07-07
Sourcehttps://github.com/openai/openai-agents-python

What openai-agents-python is

A provider-agnostic Python SDK enabling agentic orchestration with LLM routing, tool integration (functions, MCP, hosted), session management, and realtime voice agent support via gpt-realtime-2.1. Includes optional Redis sessions, SQLAlchemy persistence, and WebSocket support.

Quickstart

Get the openai-agents-python source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/openai/openai-agents-python.gitcd openai-agents-python# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Multi-agent task delegation workflows

Build systems where agents hand off tasks to specialized peers based on skill or domain. Examples: customer support escalation, code review pipelines with different agent roles.

Sandbox-based automation with long-lived state

Use SandboxAgent for file inspection, command execution, and repository manipulation across extended interactions. Useful for code generation, patch application, and workspace-aware debugging.

Voice-enabled agent systems

Leverage realtime agents with gpt-realtime-2.1 for interactive voice workflows with full agentic features (tools, guardrails, handoffs).

Implementation considerations

  • Requires Python 3.10+; plan dependency management for optional voice and Redis packages.
  • OpenAI API key and billing model required; multi-model support via any-llm/LiteLLM adds abstraction but increases configuration surface.
  • Sandbox agents require local filesystem or container client setup; UnixLocalSandboxClient may need hardening for production use.
  • Human-in-the-loop workflows demand external approval mechanisms; framework provides hooks but you must implement the UI/workflow.
  • Sessions auto-manage conversation history, but Redis or SQLAlchemy persistence setup needed for multi-instance deployments.

When to avoid it — and what to weigh

  • Simple single-agent retrieval-augmented generation (RAG) — If you only need a single LLM with basic retrieval, this framework adds unnecessary complexity. Consider simpler libraries like LangChain's BasicRetriever or direct API calls.
  • Strict air-gapped or offline deployments — Framework ties closely to OpenAI APIs and cloud-based tracing. Disconnected environments will require significant adaptation or forking.
  • Non-Python ecosystems — Python-only implementation. JavaScript/TypeScript teams should use the separate openai-agents-js SDK.
  • Real-time sub-100ms latency requirements — Agent orchestration overhead and LLM round-trips incompatible with ultra-low-latency applications.

License & commercial use

MIT License. Permissive OSI-compliant license allowing commercial use, modification, and redistribution with attribution.

MIT permits commercial use without restriction. However, verify OpenAI API Terms of Service for your specific use case (cost implications, data handling, content policies). SDK dependencies (Pydantic, SQLAlchemy, websockets) are also OSI-compatible; no licensing conflicts apparent. Requires review if deploying proprietary agent systems or in regulated industries.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationStrong
License clarityClear
Deployment complexityModerate
DEV.co fitStrong
Assessment confidenceHigh
Security considerations

Framework includes guardrails for input/output validation, but effectiveness depends on configuration. Tool execution (external functions, MCP servers) introduces attack surface; no mention of sandboxing isolation beyond optional container runtime. Tracing sends agent execution details to OpenAI; ensure sensitive prompts/outputs are handled appropriately. Sandbox agents run arbitrary commands if misconfigured; validate manifest entries. No security audit references provided—requires independent review for high-stakes deployments.

Alternatives to consider

LangChain AgentExecutor / LangGraph

Broader LLM ecosystem support and maturity. LangGraph offers explicit graph-based workflows; less opinionated on handoffs and sandbox patterns.

AutoGen (Microsoft)

Focus on multi-agent conversation and nested tasks. Stronger emphasis on code execution in isolated Docker containers; less voice/realtime integration.

Claude SDK (Anthropic) + tool_use

If locked into Claude models, native tool calling is simpler. No multi-agent handoff framework, but lower operational overhead and cost per request.

Software development agency

Build on openai-agents-python with DEV.co software developers

OpenAI Agents SDK simplifies handoffs and orchestration. Start with a sandbox agent example, validate your cost model, and plan session persistence early.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

openai-agents-python FAQ

Can I use non-OpenAI LLMs?
Yes, via any-llm or LiteLLM adapters (100+ models supported). However, core tracing and some realtime features are optimized for OpenAI models.
How do I persist agent state across restarts?
Sessions auto-manage conversation history. For workspace state, SandboxAgent retains filesystem; for distributed setups, configure Redis or SQLAlchemy session backends.
Is this suitable for regulated industries (healthcare, fintech)?
Requires review. Framework includes guardrails, but data sent to OpenAI for tracing may violate compliance (HIPAA, PCI-DSS). Consider self-hosted tracing or air-gapped alternatives.
How is cost managed when agents call many LLM APIs?
Framework does not enforce cost limits. Each agent call consumes tokens; multi-turn handoffs can cascade costs. Implement budget guardrails and monitor usage externally.

Software development & web development with DEV.co

Adopting openai-agents-python is usually one piece of a larger software development effort. As a software development agency, DEV.co provides software development services and web development expertise — pairing senior software developers and web developers with your team to design, build, and operate ai frameworks software in production.

Ready to architect multi-agent systems?

OpenAI Agents SDK simplifies handoffs and orchestration. Start with a sandbox agent example, validate your cost model, and plan session persistence early.