New Feature AI Tools 2026 Guide

OpenAI Agents API Explained: What the New Cloud Agent Platform Actually Does

OpenAI spent 2025 teaching Codex to write and fix code inside a sandbox. The Agents API, now in public beta, is what happens when that sandbox gets an address a developer's own app can call. Instead of copying a Codex conversation by hand, a program can now hand off a coding task, let it run for minutes or hours in an isolated cloud container, and get back a diff, a test run, and a summary of what happened. Here's what actually changed, what it costs, and where it fits next to Codex CLI and ChatGPT Work.

Published September 2026 By the AI Help Guide editorial team 9 minute read
Developer reviewing code changes and pull requests on a laptop screen

The Agents API runs the same Codex harness developers already use in the CLI, just reachable from any app over HTTP.

Watch: OpenAI's own walkthrough of a coding agent running inside the new hosted API.

Sep 10, 2026
the date the Agents API entered public beta
1
API call to start a fully sandboxed coding agent run
Codex
the harness powering every agent run under the hood
Usage-based
pricing — tokens plus sandbox compute time, no flat fee

A Coding Agent You Can Call From Your Own App

Until now, using OpenAI's Codex agent meant sitting in the ChatGPT app, the Codex CLI, or the Codex IDE extension and watching it work. The Agents API turns that same agent into a hosted service any developer can call programmatically. Send a task description and a reference to a code repository, and OpenAI spins up an isolated cloud sandbox, checks out the code, and lets the agent plan, edit files, run tests, and iterate — the same loop Codex already runs, just triggered by an API request instead of a person typing into a chat window.

The practical shift is where the agent can now live. A CI pipeline can call the Agents API when a ticket is labeled "good first bug." An internal tool can queue up a batch of small refactors overnight. A support platform can let a non-engineer describe a bug in plain language and have an agent open a real pull request against it. None of that was possible when the only door into Codex was a chat interface built for one human at a time.


What Happens Inside a Single Agent Run

Each call to the Agents API creates its own sandboxed container with a checkout of the target repository, network access scoped to what the task needs, and a time or turn budget the caller sets up front. Inside that sandbox, the agent follows the same read-plan-edit-verify loop as Codex CLI: it reads the relevant files, drafts a plan, makes changes, and runs the project's own test suite before declaring the task finished. The API streams back events as the agent works — file edits, shell commands, test results — so a calling application can show live progress instead of a blank spinner.

Sandboxed Execution

Every run gets its own isolated container. Nothing the agent does touches another run or a shared filesystem by default.

Structured Output

A finished run returns a diff, a test log, and a plain-language summary rather than just a block of chat text.

Configurable Autonomy

Callers can cap how many turns or how much wall-clock time an agent gets before it has to stop and report back.

Tool Access Scoping

Which package registries, internal APIs, or shell commands an agent can reach is set per call, not left wide open.

It's the same model, not a separate one. The Agents API doesn't introduce a new coding model — it exposes the existing Codex agent harness (built on OpenAI's GPT-5.6-class reasoning models) as an API product, the way Claude Code's SDK exposes Claude's agent loop for developers to embed.


How a Typical Integration Looks

1

Connect a repository

Point the API at a GitHub repo (or upload a code archive) so the sandbox has something to check out and work against.

2

Describe the task

Send a plain-language task description, the same way you'd write a ticket for a human contributor.

3

Set the guardrails

Choose a turn or time budget and which tools and network destinations the sandbox is allowed to reach.

4

Receive the result

Get back a diff, test output, and a summary — ready to open as a pull request or hand to a human for review.

Bottom Line

The Agents API doesn't make Codex smarter — it makes it embeddable. For a team that already trusts Codex's coding output, this turns it from a tool one developer drives by hand into infrastructure a whole engineering org can wire into CI, ticketing, and internal tools. For a solo developer who's happy typing into the Codex CLI or ChatGPT, it changes very little day to day; the value shows up once you want an agent triggered by something other than a person opening a chat window.


How This Stacks Up Against Claude Code's SDK and Gemini's Agent Tools

The Agents API doesn't arrive into an empty field. Anthropic already exposes Claude Code's agent loop through its own SDK for developers who want to embed coding automation into their own products, and Google has been building similar agent-facing tooling around Gemini through Antigravity and its developer APIs. What OpenAI brings that's genuinely distinct is the direct pairing with Codex specifically, which has built a strong reputation through 2026 for handling long, autonomous coding sessions without losing track of a task's original goal.

For a team evaluating all three, the practical difference tends to show up less in raw capability and more in integration details: how granular the permission scoping is, how the billing model handles long-running tasks, and how easy it is to stream progress back into an existing internal tool. Anthropic, OpenAI, and Google are all converging on roughly the same shape of product — a hosted, sandboxed coding agent reachable by API — which suggests this has become a baseline expectation for any serious frontier lab, not a differentiator any one of them can hold onto for long.


What to Check Before You Build on It

A beta label matters here in a concrete way: interfaces, pricing, and default behaviors can still change before the Agents API reaches general availability, so a production integration built today should expect to revisit its assumptions as the product matures. Rate limits, the maximum sandbox runtime per call, and exactly which shell commands and package registries are reachable by default are the kinds of details worth checking against OpenAI's current documentation directly rather than relying on any early third-party writeup, including this one, since these specifics are the parts most likely to shift during a beta period.

It's also worth thinking about review workflow before wiring the Agents API into anything that touches a real codebase. A finished agent run returns a diff ready to become a pull request, but "ready to open as a PR" isn't the same as "ready to merge" — treating agent output the same way a team would treat a junior contributor's first pull request, with normal code review before it lands, is the sensible default regardless of how capable the underlying model is.

More AI Guides, Written Clearly

Browse our full library of AI tool guides, updated regularly as models and features change.

Common Questions

What is the OpenAI Agents API?

It's a hosted API, in public beta since September 10, 2026, that lets developers programmatically run OpenAI's Codex coding agent inside an isolated cloud sandbox and get back a diff, test results, and a summary — instead of using Codex only through a chat interface.

Is the Agents API the same as Codex?

It uses the same underlying Codex agent harness and reasoning models. The API is a new way to call that agent from your own code, not a separate, more capable model.

What does the Agents API cost?

Pricing is usage-based: standard token costs for the underlying model plus metered charges for sandbox compute time, rather than a flat monthly fee.

Can I control how much an agent is allowed to do?

Yes. Callers set a turn or time budget per run and scope which tools, package registries, and network destinations the sandbox can access.

Can the Agents API work with private repositories?

Yes. The API is designed to check out a connected repository, including private ones, inside its sandbox for the duration of a task, subject to whatever access the calling application has been granted.

How does this compare to using Codex CLI directly?

Codex CLI is built for a single developer working interactively in their own terminal. The Agents API exposes the same underlying agent as a service other applications can call programmatically, without a person driving each session by hand.

Is the Agents API suitable for production use today?

Because it's in public beta, interfaces and default behaviors may still change before general availability, so most teams should expect to revisit their integration as the product matures rather than treating it as fully stable yet.

Sources: OpenAI — Introducing the Agents API · OpenAI Platform Docs — Agents API Guide
OTHER PROJECTS

More from the creator

Explore two other projects from the same creator.

Didn't find exactly what you needed here? Chat with our AI — it can search and point you to the right guide.