Agents API logo

Agents API

Freemium
Visit

Agents API gives applications access to an OpenAI-managed Codex harness for building durable cloud agents. It manages sessions, orchestration, context compaction, and recovery while the application supplies tools and selects the execution environment.

What is Agents API?

Agents API is an API runtime for applications that need agents to perform multi-step work over durable sessions. It exposes the Codex harness through an OpenAI-managed API, separating the agent’s task execution from the application’s user interface or surrounding workflow. OpenAI manages session state, orchestration, context compaction, and recovery, while the application configures the agent, provides tools, and chooses whether to use an OpenAI-hosted sandbox, a self-hosted sandbox, or no sandbox.

An agent is configured with a model, instructions, tools, and optional MCP servers. An environment can provide a sandbox or computer where the agent accesses files, loads skills, and runs commands. During a session, the application sends input and receives events and items representing progress and output. Applications can stream output or use webhooks to learn when work finishes or when the agent needs input, then continue the same session with another task or steer the agent during its current turn.

What can Agents API do?

Managed durable sessions

OpenAI manages session configuration, turns, and items so an application can continue work in the same session, send additional tasks, or resume where the agent left off.

Orchestration and context management

The harness handles orchestration, automatic context compaction, and recovery. It can also summarize previous work to help manage the agent’s context window.

Sandbox and environment options

Agents can run commands and code, edit files, load skills, and access a workspace. Applications can use an OpenAI-hosted sandbox, a self-hosted sandbox, or no sandbox, subject to the selected environment’s setup and limitations.

Tools and MCP connectivity

An agent can use configured tools and connect to external data through MCP servers. The documented configuration also supports web search and programmatic tool calling.

Multi-agent delegation

The managed harness can break work into subtasks and delegate independent work to subagents, with multi-agent behavior configured when a session is created.

Progress events and steering

Applications can stream agent output or use webhooks to track progress, detect completion or requests for input, and guide the agent during an active turn.

Use Cases

“Research and technical investigation”

Configure an agent with web search and an MCP server to investigate a technical question, check recent information, and combine findings from delegated research tasks.

“Incident response”

Use an agent to investigate alerts and request approval before recovery actions, keeping the investigation and subsequent turns in a durable session.

“Data analysis”

Build a data analyst workflow that answers warehouse questions with read-only SQL, using the application’s configured tools and execution environment.

“Document review”

Set up a reviewer that applies policy skills and specialist agents to examine documents and return consolidated findings.

“Connected workplace and code workflows”

Use connected tools for requests in a workplace system, or investigate a GitHub issue by reproducing a reported bug and sharing the findings on GitHub.

Frequently Asked Questions

What does Agents API manage for my application?

OpenAI manages the Codex harness, including sessions, orchestration, context compaction, and recovery. Your application configures the agent, provides tools, selects the environment, sends input, and consumes events and output.

Where can an Agents API agent run?

The documented options are an OpenAI-hosted sandbox, a self-hosted sandbox, or no sandbox. A sandbox can provide access to files, skills, commands, and code execution; setup and limitations depend on the environment option.

How does an application follow or continue agent work?

After creating a session and giving the agent a task, the application can stream output or use webhooks to learn when the agent finishes or needs input. It can send another task to the same session or steer the agent during its current turn.

Can Agents API use external services or other agents?

Yes. Agents can be configured with tools and MCP servers for external data connections, and the managed harness supports delegating subtasks to subagents. The application must configure the relevant tools, servers, and permissions.

How is Agents API different from the Agents SDK?

Agents API runs a managed Codex harness and saves session progress. The Agents SDK runs in the application and gives the application more control over deployment, storage, approvals, and runtime integration.

Quick Facts

Product type
Managed agent runtime API
Primary platform
OpenAI API
Core runtime
OpenAI-managed Codex harness
State model
Durable sessions with saved configuration, turns, and items
Environment options
OpenAI-hosted sandbox, self-hosted sandbox, or no sandbox
Billing basis
Selected model API rates, standard rates for OpenAI tools, and standard container rates for OpenAI-hosted sandboxes

Agents API Alternatives

Claude Platform logo

Claude Platform

platform.claude.com

Claude Platform gives developers programmatic access to Claude models and managed agent infrastructure for building agents and applications. It includes a REST API, official client SDKs, a web Console, and documentation for direct integrations.

Statewave logo

Statewave

www.statewave.ai

Statewave is an open-source, self-hosted memory runtime for AI agents. It stores durable episodes, compiles structured memories with provenance, and returns ranked context bundles for applications that need continuity across sessions.

deadeye logo

deadeye

deepaksinghcs14.github.io

deadeye is a plugin for coding agents that selects a suitable model and effort level for each task, while trimming verbose command output before it enters context. It is built for Claude Code and also supports Codex CLI, Gemini CLI, Cursor, and Windsurf on an experimental basis.

Kody logo

Kody

kody.codes

Kody is a software platform that gives connected AI agents shared memory, credentials, reusable packages, integrations, and scheduled execution. It helps developers carry work between agents such as Cursor, Claude, ChatGPT, and Codex without rebuilding the same automation each time.

AgentOps logo

AgentOps

www.agentops.ai

AgentOps is a developer platform for building, tracing, debugging, and deploying AI agents and LLM applications. It provides observability for agents built with OpenAI, CrewAI, AutoGen, and more than 400 LLMs and frameworks.

Cognee logo

Cognee

www.cognee.ai

Cognee is an open-source memory platform for AI agents and applications. It connects data across sources, builds connected memory using vector, graph, and relational storage, and makes that context available through SDK, cloud, or self-hosted deployments.