Openai Agents Js is the JavaScript and TypeScript edition of the OpenAI Agents SDK, a framework for building single-agent and multi-agent workflows with few abstractions. It works with OpenAI APIs and other model providers.
You define agents as LLMs configured with instructions, tools, guardrails, and handoffs, then run them with a single call. Agents can delegate to other agents either as tools or through handoffs, and built-in tracing records each run so you can view and debug the workflow.
Three agent types cover different workloads. A regular agent handles text workflows. A sandbox agent pairs an agent with a filesystem workspace so it can run commands and carry state across longer tasks, using a local Unix sandbox, a Docker sandbox, or a hosted sandbox client. A realtime agent handles low-latency spoken interaction in the browser over WebRTC, with tools, guardrails, handoffs, and conversation history.
The SDK runs on Node.js, Deno, and Bun, with experimental support for Cloudflare Workers.
Features
- Agents: LLMs configured with instructions, tools, guardrails, and handoffs
- Sandbox agents: agents with a filesystem workspace and sandbox environment for longer-running work
- Realtime agents: low-latency voice agents in the browser with tools, guardrails, and conversation history
- Handoffs and agents as tools: delegate specific tasks to other agents
- Tools: function tools, MCP servers, and hosted tools
- Guardrails: configurable input and output validation checks
- Human in the loop: built-in mechanisms for involving people across agent runs
- Sessions: automatic conversation history across runs
- Tracing: built-in tracking of agent runs for viewing and debugging workflows