OpenAI Agents API favicon

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.

Code & ITExecuting code and system commands…Editing files and producing persistent…Preserving session state across…Connecting to external tools and data…
OpenAI Agents API product interface screenshot
Estimated monthly visits
204.3M
Data period:
Listed on AIToolly

What Is OpenAI Agents API? Product Overview

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.

What Can You Use OpenAI Agents API For?

Source-supported ways to use the product

Automated Incident Investigation

Investigates infrastructure alerts, evaluates incident data, and requests confirmation before executing remediation tasks.

Bug Reproduction and Issue Triage

Executes reproduction scripts in a sandbox environment to investigate reported software bugs and share results on GitHub.

Read-Only Database Analytics

Queries data warehouses using read-only SQL to analyze operational data and answer business questions.

Multi-Agent Document Review

Evaluates submitted documents against formal policy skills by delegating specific checks to specialist subagents.

How to Use OpenAI Agents API

The documented workflow, where available

  1. 1

    Create a Session

    Configure the agent's model, instructions, and tools while OpenAI provisions the execution environment.

  2. 2

    Give It a Task

    Submit user input to initiate a turn of work once the configured environment is prepared.

  3. 3

    Follow Progress

    Stream execution output or listen to webhooks to track progress and detect when the agent requires input or finishes.

  4. 4

    Continue or Steer

    Guide the agent during an active turn or submit follow-up tasks to the existing durable session.

Managed Codex Harness and Execution Architecture

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.

  • Durable sessions maintain turn state and history without client-side context reconstruction.
  • Context compaction summarizes previous actions to help reduce context window exhaustion.
  • Environments support file modifications, command execution, and artifact generation.
  • Native multi-agent support allows delegating discrete tasks to parallel subagents.

What to Test Before Choosing OpenAI Agents API

Checks to run with your own material and workflow

  • Confirm whether organizational data residency policies permit processing restricted to the United States.
  • Verify that compliance requirements do not necessitate Zero Data Retention, as the API does not support ZDR even with self-hosted sandboxes.
  • Check whether target tool integrations can be implemented through web search, programmatic tool calling, or Model Context Protocol servers.
  • Review whether code execution requirements are satisfied by an OpenAI-hosted sandbox or require a self-hosted environment.

OpenAI Agents API Sources and Last Checked

What was checked and when

Last checked
Category
Code & IT

OpenAI Agents API Frequently Asked Questions

Answers based on the source-checked product record

What execution environments are supported by the Agents API?

Agents can run in an OpenAI-hosted sandbox managed by OpenAI or within a self-hosted environment configured with local capability directories.

Does the Agents API support Zero Data Retention?

Zero Data Retention is not supported by the Agents API, and choosing a self-hosted sandbox does not make the implementation eligible for ZDR.

Where is data stored when using the Agents API?

Data residency for the Agents API is currently supported exclusively within the United States.

How does the API prevent conversational context windows from overflowing?

The managed Codex harness provides automatic context compaction, summarizing previous work to maintain the active context window within model limits.

Can an agent delegate subtasks to other agents?

Yes, the API supports multi-agent execution, allowing an agent to partition complex tasks and delegate them to concurrent subagents.

Explore other recently added tools in the same category.