Back to all posts
Guide
8 min read

OpenAI Agents API: What You Actually Get

DevToolLab Team

DevToolLab Team

September 13, 2026

OpenAI Agents API: What You Actually Get

Anyone who has shipped an LLM agent past a demo has written the same three pieces of plumbing: something to compact context before the window fills, something to keep a long task alive across restarts, and something to fan work out to sub-tasks and collect the results. None of it is the product, all of it breaks in interesting ways, and every model upgrade invites a rewrite.

On September 10, 2026, OpenAI put that plumbing behind an API. The Agents API entered public beta as a managed version of the harness that powers Codex, and the openai npm package shipped support the same day in version 7.15.0 at 19:46 UTC. There is no separate fee for the service, though as the docs make clear, the sandbox your agent runs in is billed separately.

OpenAI announcement page headlined "Introducing the Agents API" dated September 10, 2026, with the subtitle "Build and run cloud agents with the Codex harness, fully managed by OpenAI"
OpenAI announcement page headlined "Introducing the Agents API" dated September 10, 2026, with the subtitle "Build and run cloud agents with the Codex harness, fully managed by OpenAI"

What the Agents API Actually Is

The Agents API gives an application access to the Codex harness through an OpenAI-managed API. In OpenAI's own framing, it manages sessions, orchestration, context compaction and recovery, while your application supplies the tools and picks where the agent executes.

That division is the whole point. You are not handing over your business logic, you are handing over the agent loop. The docs describe four concepts: the agent (model, instructions, tools and MCP servers), the environment (an optional sandbox where it accesses files, loads skills and runs commands), the session (a durable instance that works on tasks and responds to input), and events and items (the inputs you send and the output produced).

The word doing the most work there is durable. A session is designed to survive, and OpenAI says the infrastructure keeps agents running reliably for days.

What the Managed Harness Handles For You

Four capabilities in the beta map directly onto code that agent teams have been maintaining by hand.

Context compaction. The API automatically compacts earlier context as a session approaches its context limit, preserving what the agent needs to continue. Workflows can span multiple context windows without you implementing compaction logic.

Tool search. Rather than pushing every tool definition into the prompt, tool search loads relevant definitions as needed. OpenAI says this reduces token usage and cost while preserving the model's cache, which matters because a cache miss on a large prompt is the expensive failure mode.

Programmatic tool calling. Agents can run calls in parallel, chain related operations, and filter or combine results in code, so they work through large volumes of data while bringing only relevant results back into context.

Subagents. With multi-agent support the API splits a task into independent pieces and delegates them to subagents running in parallel, each with its own context, while the main agent coordinates and merges results. The configuration is two lines:

JSON
"agent": {
  "model": "gpt-6-astra",
  "multi_agent": { "enabled": true, "max_concurrent_subagents": 3 }
}
OpenAI Agents API documentation page headed "Build durable cloud agents with a managed Codex harness", showing the pricing section stating that model usage bills at API rates and OpenAI-hosted sandboxes use standard container rates
OpenAI Agents API documentation page headed "Build durable cloud agents with a managed Codex harness", showing the pricing section stating that model usage bills at API rates and OpenAI-hosted sandboxes use standard container rates

OpenAI published a customer quote from Jack Weissenberger, CTO of Ciridae, reporting an evaluation score moving from 0.71 to 0.85 and a 4x latency reduction after adopting the subagent flows. Treat a vendor-published customer quote as a directional claim rather than a benchmark, but the shape of it is consistent with what parallel delegation should do to wall-clock time.

Where Your Agent Runs

You choose the compute. There are three options: an OpenAI-hosted sandbox, your own infrastructure, or a partner sandbox. OpenAI named nine launch partners for that last category: Blaxel, Cloudflare, Daytona, DigitalOcean, E2B, Modal, Oracle, Runloop and Vercel.

The hosted sandbox runs on the same infrastructure behind Codex and ChatGPT, and can be configured with your files, packages, skills and plugins. The self-hosted and partner routes exist for the cases that usually kill a managed service: deployment inside your own VPC, specific secret storage, or particular CPU, GPU and memory profiles.

What It Really Costs

OpenAI's announcement says there are no additional fees for using the Agents API, and that is true in the narrow sense that no line item says "Agents API". The docs are more precise: model usage bills at the selected model's API rates, OpenAI tools bill at standard rates, and OpenAI-hosted sandboxes bill at standard container rates.

Those container rates are published and worth knowing before you architect around long-lived sessions, because a durable agent is a container that stays warm.

Line itemRate, as of September 13, 2026
Agents API service fee$0
gpt-6-astra short context$10.00 input, $1.00 cached input, $50.00 output per 1M tokens
gpt-6-astra long context$20.00 input, $2.00 cached input, $75.00 output per 1M tokens
Container, 1 GB$0.03 per 20-minute session
Container, 4 GB$0.12 per 20-minute session
Container, 16 GB$0.48 per 20-minute session
Container, 64 GB$1.92 per 20-minute session

Eligible container sessions bill by the minute with a five-minute minimum. The sandbox is therefore cheap per hour and easy to leave running, which is exactly the cost shape that surprises people on the first invoice. The model tokens, not the container, are where the money goes.

It Is Already in the SDK

The fastest way to check whether a beta is real is to look for it in the published client rather than the blog post. Installing the version released alongside the announcement and walking the namespace:

JavaScript
import OpenAI from "openai";
const client = new OpenAI({ apiKey: "sk-not-a-real-key-surface-check-only" });

let cur = client, trail = "client";
for (const p of ["beta", "agents", "sessions", "create"]) {
  cur = cur?.[p];
  trail += "." + p;
  console.log(`${trail.padEnd(38)} ${cur === undefined ? "MISSING" : typeof cur}`);
}
client.beta                            object
client.beta.agents                     object
client.beta.agents.sessions            object
client.beta.agents.sessions.create     function

It is shipped, not staged. Requests need the OpenAI-Beta: agents=v1 header, which the SDKs add automatically, and an application API key granted api.agents.read, api.agents.write and api.responses.write. The docs are blunt about one thing worth repeating: keep that key outside the agent's sandbox.

How This Changes the Framework Decision

The Agents API is powered by the open-source Codex harness, which means the orchestration logic is inspectable rather than a black box. openai/codex is Apache-2.0, written in Rust, and carried 123,764 stars when checked on September 13, 2026.

GitHub repository page for openai/codex showing the Apache-2.0 license, 123.8k stars, 19.1k forks and the description "Lightweight coding agent that runs in your terminal"
GitHub repository page for openai/codex showing the Apache-2.0 license, 123.8k stars, 19.1k forks and the description "Lightweight coding agent that runs in your terminal"

That is a real difference from a closed managed runtime, and a real difference from a framework you vendor into your own repo. You get to read the loop, you do not get to modify the one OpenAI runs for you.

ConcernFramework you runAgents API
Context compactionYou write itManaged
Session durabilityYour queue and storageManaged, multi-day
Subagent orchestrationYou write itmulti_agent config
Model portabilityAny providerOpenAI models
Harness upgradesYour migrationVersioned per model launch
Where it runsAnywhereHosted, self-hosted or partner

The row that decides it for most teams is model portability. A framework like LangGraph or CrewAI is an abstraction over providers; the Agents API is OpenAI's runtime for OpenAI's models. Choosing it is choosing a provider, not just a library.

Should You Move?

Building a new agent on GPT-6 Astra: start here. The compaction and subagent code you would otherwise write first is the part being handed to you, and there is no service fee for taking it.

Running a framework in production that works: stay, and read the harness. The migration cost is real and the beta is three days old. Revisit at general availability.

Multi-provider by requirement or policy: keep your abstraction. This runtime is OpenAI-only by construction, and no amount of managed convenience changes that.

Regulated or VPC-bound: the self-hosted and partner environments are the reason this is worth a look at all. Confirm your sandbox provider is on the supported list before planning around it.

Conclusion

The interesting thing here is not that OpenAI shipped an agent API, it is which layer it chose. Compaction, tool search, parallel tool calls and subagent orchestration are the four pieces every serious agent team wrote in 2025 and 2026, and they are now a configuration object. The catch is the one every managed runtime has: the harness improves on OpenAI's schedule and runs OpenAI's models.

Before building on it, ask what your agent does when a session dies at hour six. If your answer is "the harness handles it", make sure you have tested that during a public beta rather than assumed it.

  • AI Token Counter - the entire bill is tokens, so estimate a session's prompt before you leave a long-running agent unattended.
  • Webhook Receiver - the docs suggest webhooks to learn when an agent finishes or needs input; catch and inspect those payloads before wiring them to anything.
  • JSONPath Tester - pull a single field out of a session's event stream without writing a parser to find out what the agent actually returned.
  • JSON Schema Generator - define the structured output a custom tool returns so the agent gets a predictable shape back.

Related Posts

Best Load Testing Tools in 2026 Compared

k6, Gatling, Locust, JMeter and Artillery compared on the prices their own pages publish, plus which engines still ship releases and which have gone quiet.

By DevToolLab Team

GPT-6 Astra: OpenAI's Riskiest Model Yet

OpenAI GPT-6 Astra broken down for developers: real pricing, the 1M token context window, a code example, and the risk OpenAI flagged in its own system card.

By DevToolLab Team

Best Merchant of Record Platforms in 2026

Paddle, Lemon Squeezy, Polar, Stripe Managed Payments and FastSpring compared on real fees, and why merchant of record has no open source alternative.

By DevToolLab Team