OpenAI Agents SDK (JavaScript/TypeScript)

A lightweight yet powerful framework for multi-agent workflows and voice agents in JavaScript/TypeScript.

Stars
★ 3.9k
Last updated
3d ago
License
MIT
Primary language
TypeScript

At a glance

How it runs
Library / SDKFramework
Works with
Platform-specificOpenAI API
Cost
Free software; you pay for model usage
Setup effort
Low · running in minutes
You'll need
Node.js 22 or laternpmzodShell / CLINetwork accessLocal filesystem
Typical use
Developers building complex workflows that require multi-step, multi-agent collaboration, such as code review, data analysis, or automated report generation.
Not a fit if
  • Projects stuck on Node.js versions below 22
  • Teams needing production-stable sandbox agents (still beta)

What does this agent do, and when should you use it?

This SDK is OpenAI's official framework for building multi-agent workflows in JavaScript/TypeScript, offering three agent modes: text, sandbox, and realtime. Core concepts include agents, sandbox agents, realtime agents, agents as tools, handoffs, tools, guardrails, human-in-the-loop, sessions, and tracing. It is provider-agnostic in design but primarily relies on the OpenAI API. Requirements include Node.js 22+, Deno, or Bun, with experimental support for Cloudflare Workers (with nodejs_compat). It includes built-in tracing for debugging and optimization. Licensed under MIT, it comes with an extensive examples directory. Installation is straightforward via npm install @openai/agents zod.

The SDK provides programmatic interfaces to create and run agents. Text agents use the Agent class and run() function to execute tasks, handling instructions and tool calls. Sandbox agents operate within a filesystem workspace, can run commands, manage file state, and support local and Docker clients. Realtime agents enable low-latency voice interactions in the browser via WebRTC. It supports tool definitions (including MCP), guardrails, handoffs, and session management, with built-in tracing of agent runs. Typical flow: define an agent (instructions, tools, guardrails), then call run() or connect a realtime session; the SDK handles scheduling, tracing, and output final results.

  1. Developers building complex workflows that require multi-step, multi-agent collaboration, such as code review, data analysis, or automated report generation.
  2. Teams needing to run code or commands in an isolated sandbox, allowing agents to safely operate on filesystems and execute commands.
  3. Products requiring voice interaction, such as voice assistants, customer support bots, or real-time voice translation, using RealtimeAgent.
  4. Developers wanting to use agents as tools for other agents, enabling modular task delegation, e.g., one agent for data extraction and another for summarization.
  5. Ensuring output quality through guardrails for input/output validation or human-in-the-loop mechanisms for approvals.

How do you install or deploy this agent?

Requires Node.js 22 or later. Install via npm: npm install @openai/agents zod. For sandbox agents, you may need to install Docker or configure a local client. For realtime agents, browser support for WebRTC is required, and you need to set OPENAI_API_KEY on the server to generate ephemeral tokens.

How do you use this agent?

  1. Install dependencies: npm install @openai/agents zod. 2. Set environment variable OPENAI_API_KEY. 3. Create a text agent: import Agent and run, define the agent, and run it. 4. For sandbox agents, import SandboxAgent and a client, configure the workspace. 5. For realtime agents, import RealtimeAgent and RealtimeSession, connect via WebRTC. See the README and examples directory for code samples.

What are this agent's strengths and limitations?

Pros
  • Official OpenAI product, ensuring compatibility and future updates with OpenAI API.
  • Offers three agent modes (text, sandbox, realtime) covering different use cases.
  • Built-in tracing for debugging and optimizing workflows.
  • Supports advanced features like handoffs, guardrails, and tools, simplifying multi-agent orchestration.
  • MIT license, open source, community-contributable.
Limitations
  • Reliance on OpenAI API; core features (like sandbox and realtime) may not work with other providers.
  • Sandbox agents are in beta, potentially unstable.
  • High runtime requirement (Node.js 22+) may limit deployment on older environments.
  • Experimental support for Cloudflare Workers requires extra configuration and may have issues.
  • Realtime agents require handling WebRTC and ephemeral tokens, adding frontend complexity.

How does this agent compare with similar options?

Key facts side by side with the most closely related agents.

Agent Source review Form / cost Stars Updated Language Full support on
OpenAI Agents SDK (JavaScript/TypeScript) This agent 55 · Major gaps Library / SDKFree + model costs ★ 3.9k 3d ago TypeScript OpenAI API
AgentOS 52 · Major gaps Library / SDKFree + model costs ★ 680 today TypeScript Claude Code · OpenAI API · Claude API
OpenCode Swarm 74 · Some gaps Agent plugin / skillFree + model costs ★ 506 today TypeScript —
Octomind 70 · Some gaps CLIFreemium ★ 167 today Rust OpenAI API · Claude API

How does FollowAgents rate this agent?

FollowAgents source review · FARS-2.1
Major gaps
55/ 100 5-point scale 2.8 / 5
This review covers the source as of Aug 09, 2026. The project has shipped 17 stable release(s) since, which have not been re-reviewed. The score and verdict describe the reviewed version only. Recent releases ↓
Trust 11/29
Reliability 9/14
Adaptability 12/18
Convention 10/18
Effectiveness 9/13
Verifiability 4/8
Why each dimension lost points
Trust11 / 29 · 1.9/5

Evidence shows the repository provides a security policy (SECURITY.md) and coordinated disclosure policy, but does not detail specific mechanisms for least privilege, user confirmation, data flow transparency, etc. For dependency security, package.json lists dependencies but no security audit or vulnerability scanning evidence. For external effects, examples show tool calls (e.g., shell, file operations) but no explicit permission controls. Rollback is not mentioned. For source attribution, the repository belongs to the official OpenAI organization, but no specific author or maintainer information is provided. Therefore, most criteria score low, with source attribution scoring higher due to official organization.

Reliability9 / 14 · 3.2/5

The repository contains extensive tests (e.g., ReactNativeWebRTCTransport.test.ts), indicating good internal consistency. For dependency availability, package.json lists dependencies but no lock file or mirror information. For failure messages, tests show error handling but not systematically. Therefore, self-consistency and failure messages score 2, dependency availability scores 2.

Adaptability12 / 18 · 3.3/5

README describes multiple use cases (text, sandbox, realtime) and provides examples, indicating a broad audience. For capability boundaries, documentation mentions sandbox and realtime agents but no explicit limitations. For trigger precision, examples show precise instructions and tool calls. For environment fit, supports Node.js, Deno, Bun, etc., with experimental support for Cloudflare Workers. Therefore, each criterion scores 2.

Convention10 / 18 · 2.8/5

Information architecture is clear, README provides core concepts and quick start. Install notes are clear. For naming stability, package name and API names are consistent. Examples and FAQ are abundant. For known limitations, sandbox agents are marked as beta but not detailed. License is MIT, versioning uses changesets but no changelog file. For maintenance responsibility, there are CI and publish scripts. Therefore, most criteria score 2, known limitations and versioning score 1.

Effectiveness9 / 13 · 3.5/5

For output usability, examples show clear outputs (e.g., finalOutput). For marginal value, provides advanced features like multi-agent workflows and realtime agents. For cost-benefit, as an open-source framework, free to use but requires API keys. Therefore, each criterion scores 2.

Verifiability4 / 8 · 2.5/5

For claim traceability, README feature descriptions align with code and examples. For cross-source corroboration, only relies on internal repository evidence, no external verification. For fact-inference separation, documentation distinguishes feature descriptions and examples. Therefore, claim traceability and fact-inference separation score 2, cross-source corroboration scores 1.

Risks and how to mitigate them
  • Static review cannot verify actual runtime behavior; all conclusions are based on source code and documentation.
  • Sandbox and realtime agents may involve sensitive operations; carefully review permissions and data handling.
  • Dependency security lacks audit evidence; recommend checking for dependency vulnerabilities.
Evidence confidence: Low Reviewed Aug 09, 2026 Reviewed revision c12ebc1c2019 New commits since this review; the score may not cover them
See the full review method →

Recent releases

Latest entries from the project's GitHub Releases. Notes are quoted from upstream as written, not rewritten or tested by FollowAgents.

  1. Release notes excerpt
    Minor Changes - edfa410: fix: Use current Vercel authentication configuration for restored sessions and disable legacy authentication fallback when current authentication is configured; retain per-create authentication choices for live sessions. Keep restoration credentials runtime-only and honor per-run resume overrides. Patch Changes - 2f3591b: fix: preserve sticky permission bits through manifest normalization and local and remote materialization, and reapply manifest sticky intent to restored Unix-local and Docker snapshot directories - Updated dependencies [40f7de2] …
    View on GitHub ↗
  2. Release notes excerpt
    Patch Changes - Updated dependencies [40f7de2] - Updated dependencies [836cb50] - Updated dependencies [05241c7] - Updated dependencies [4137680] - Updated dependencies [8ee5055] - Updated dependencies [df20529] - Updated dependencies [b89905c] - Updated dependencies [d8fa6c3] - Updated dependencies [9e32e88] - Updated dependencies [2f3591b] - Updated dependencies [8567e09] - @openai/[email protected] - @openai/[email protected] - @openai/[email protected]
    View on GitHub ↗
  3. Release notes excerpt
    Patch Changes - df20529: fix: Preserve audio interruption after generation with transport-appropriate buffer clearing and response-specific playback duration. - Updated dependencies [40f7de2] - Updated dependencies [836cb50] - Updated dependencies [05241c7] - Updated dependencies [4137680] - Updated dependencies [8ee5055] - Updated dependencies [b89905c] - Updated dependencies [d8fa6c3] - Updated dependencies [9e32e88] - Updated dependencies [2f3591b] - Updated dependencies [8567e09] - @openai/[email protected]
    View on GitHub ↗

FAQ

Which models does this SDK support?
Primarily OpenAI API, but the framework is provider-agnostic; theoretically you can integrate other models, but you'd need to implement adapters yourself.
What environment does the sandbox agent require?
Sandbox agents support macOS and Linux (using UnixLocalSandboxClient); on Windows, use DockerSandboxClient or a hosted sandbox client.
How do I get an API key?
Sign up for an OpenAI API key and set it as the OPENAI_API_KEY environment variable. For realtime agents, generate ephemeral tokens on the server and pass them to the client.
Can this SDK be used in production?
Text and realtime agents are relatively stable, but sandbox agents are in beta and should be used with caution. Tracing helps monitor and debug.
View on GitHub ↗ Install ↓

Compare agents like this one

The same FARS review applied across the shortlist this agent qualifies for.

Related agents