OpenAI Agents API
OpenAI Agents API provides a managed Codex harness for deploying durable, stateful AI agents capable of running sandbox code, calling tools, and delegating subtasks.
OpenAI Agents API provides a managed Codex harness for deploying durable, stateful AI agents capable of running sandbox code, calling tools, and delegating subtasks.
What the product does and how it is positioned
The OpenAI Agents API grants applications programmatic access to the Codex harness as a managed service. It handles session persistence, execution orchestration, turn recovery, and automated context compaction while developers configure models, instructions, and tools.
Agents operate within either OpenAI-managed sandboxes or self-hosted environments to execute code, edit files, and create artifacts. Workflows support live steering, external data connections via Model Context Protocol servers, and parallel delegation to specialized subagents.
Source-supported ways to use the product
Investigates infrastructure alerts, evaluates incident data, and requests confirmation before executing remediation tasks.
Executes reproduction scripts in a sandbox environment to investigate reported software bugs and share results on GitHub.
Queries data warehouses using read-only SQL to analyze operational data and answer business questions.
Evaluates submitted documents against formal policy skills by delegating specific checks to specialist subagents.
The documented workflow, where available
Configure the agent's model, instructions, and tools while OpenAI provisions the execution environment.
Submit user input to initiate a turn of work once the configured environment is prepared.
Stream execution output or listen to webhooks to track progress and detect when the agent requires input or finishes.
Guide the agent during an active turn or submit follow-up tasks to the existing durable session.
The Agents API centers on a managed Codex harness that abstracts complex execution logic away from the client application. The platform maintains persistent sessions across multiple turns, eliminating the need to resend prior conversational history with every request. To stay within model context limits, the harness compacts context automatically by summarizing past turns.
Execution occurs within configured environments, supporting both OpenAI-hosted sandboxes and self-hosted environments. Within these environments, agents can access local file systems, load custom skills from capability directories, execute shell commands, interact with Model Context Protocol servers, and output generated artifacts.
Checks to run with your own material and workflow
What was checked and when
Answers based on the source-checked product record
Agents can run in an OpenAI-hosted sandbox managed by OpenAI or within a self-hosted environment configured with local capability directories.
Zero Data Retention is not supported by the Agents API, and choosing a self-hosted sandbox does not make the implementation eligible for ZDR.
Data residency for the Agents API is currently supported exclusively within the United States.
The managed Codex harness provides automatic context compaction, summarizing previous work to maintain the active context window within model limits.
Yes, the API supports multi-agent execution, allowing an agent to partition complex tasks and delegate them to concurrent subagents.