by OpenAI
Managed API for cloud agents on the Codex runtime: hosted sandboxes, 9 sandbox partners, subagents and computer use, in public beta since Sept 2026.
Pick it if you want a Codex-style agent inside your own product without building session storage, sandboxes or compaction yourself. It replaces a homegrown agent loop, not a no-code builder. The catch is beta status: OpenAI lists the agents endpoint as ineligible for Zero Data Retention, with 30-day abuse monitoring logs.
A managed Codex-style runtime that handles sessions, sandboxes, compaction and subagents behind one API call.
OpenAI controls the models, the sandbox and the runtime, so the pieces are tuned together, but the beta label and single-vendor model support limit lock-in until general availability.
Main trade-off
Public beta status and no Zero Data Retention eligibility for the agents endpoint.
| Plan | Monthly price | What it includes |
|---|---|---|
| GPT-6 Astra | Custom | per-token |
| GPT-6.1 Sol | Custom | per-token |
| GPT-6 Luna | Custom | per-token |
There is no separate Agents API fee: you pay the selected model's per-token rate plus the standard rates for any OpenAI tools and hosted containers. Standard short-context rates per 1M tokens: GPT-6 Astra $10.00 input, $1.00 cached input, $50.00 output; GPT-6.1 Sol $2.00 input, $10.00 output; GPT-6 Luna $0.10 input, $0.50 output. Long-context prompts cost more (GPT-6 Astra: $20.00 input, $75.00 output). Web search is $10.00 per 1,000 calls plus search content tokens at model rates. OpenAI-hosted sandboxes bill at container rates, from $0.03 (1 GB) to $1.92 (64 GB) per 20-minute session. Read from the OpenAI pricing page on 2026-09-30.
OpenAI Agents API entered public beta on 10 September 2026 as a managed service for running long-lived cloud agents. It runs the Codex agent runtime, so OpenAI handles sessions, sandboxes, context compaction and subagents. Developers choose an OpenAI-hosted sandbox, their own infrastructure, or one of nine named sandbox partners.
Sessions from one call
A single sessions.create call sets the model, tools, environment and first task, and the launch example needs 29 lines of JavaScript.
Three environment routes
Run agents in an OpenAI-hosted sandbox, on your own infrastructure with the self_hosted type, or on one of 9 named sandbox partners.
Automatic context compaction
Earlier context is summarized as a session nears its limit, so one task can continue across several context windows without your own compaction code.
Tool search and programmatic tool calling
Tool definitions load on demand to cut token use, and agents can run tool calls in parallel and filter results in code before they reach the model.
Subagents
The multi_agent setting lets a main agent delegate to subagents that each keep their own context; the launch examples cap concurrency at 3 and 4.
Computer use
The computer_use tool runs a browser in an OpenAI-hosted environment, with optional screenshots and an approval step for each website the agent wants to reach.
Open-source runtime
The Codex agent runtime behind the API has a public codebase, so developers can read how model calls, tools and context are coordinated.
Most users expect these and they are not currently supported.
| Tool | Price from | Free plan | Runs on | Rating |
|---|---|---|---|---|
| Quote | No | Web | -- | |
| $39/mo | Yes | Web · Mac · Windows | -- | |
| $250/mo | Yes | Web · Mac · Windows | -- | |
| $150/mo | Yes | Web | 3.9 |
Proprietary hosted API. OpenAI describes the underlying Codex agent runtime as open source.
There are no plans and no separate Agents API fee. You pay the chosen model's per-token rate, with GPT-6 Astra at $10.00 input and $50.00 output per 1M tokens on short context, plus standard rates for tools: $10.00 per 1,000 web search calls and $0.03 to $1.92 per 20-minute hosted container session. Long-context prompts and larger sandboxes raise the bill.
The documentation describes no free plan or free allowance for the Agents API. Public beta access is open to all developers and adds no fee of its own, but every run is billed at model, tool and container rates. The cheapest way to test is a small model and a short task.
LangChain and Mastra suit teams that want an open-source framework they host themselves and that can call several model vendors. E2B fits when you only need sandboxes for code your own agent writes. n8n is the pick for visual workflows with little code.
Pick the Agents API when you want OpenAI to run sessions, the sandbox and context compaction, and you are happy to use OpenAI models. Pick LangChain when portability across model vendors matters more than a managed runtime, or when your data cannot go through an endpoint that is not Zero Data Retention eligible.
You need an OpenAI API key and the OpenAI SDK for your language. The quickstart runs a directory-tree script in an OpenAI-hosted sandbox, and the cURL examples require Bash and jq. A first session is one sessions.create call.
OpenAI Agents API is a developer API from OpenAI that runs long-lived cloud agents on your behalf. It was announced on 10 September 2026 and is in public beta. It exposes the same agent runtime that powers Codex as a managed service: OpenAI keeps the sessions, orchestration, context compaction and recovery, while your application supplies the tools and chooses where the agent runs.
You create a session with one call to client.beta.agents.sessions.create (or a POST to /v1/agents/sessions with the OpenAI-Beta: agents=v1 header). The call names a model such as GPT-6 Astra, a list of tools and an environment. Tools include MCP servers, custom functions, web search, programmatic tool calling, where the agent writes code to chain several tool calls and trim their output, and computer use, which drives a browser in an OpenAI-hosted environment. Turning on multi_agent lets the main agent hand pieces of a task to subagents; the launch examples set max_concurrent_subagents to 3 and 4.
The environment is the main design choice. The openai_hosted type gives you an OpenAI-managed sandbox where the agent runs code, edits files and produces artifacts. The self_hosted type points the agent at your own machines and private network. OpenAI also names nine sandbox partners: Blaxel, Cloudflare, Daytona, DigitalOcean, E2B, Modal, Oracle, Runloop and Vercel. As a session nears its context limit, the API compacts earlier context automatically, so one task can span several context windows.
It suits teams that want a Codex-style coding or research agent inside their own product without building a session store, a sandbox pool and compaction logic. OpenAI's cookbook ships five sample apps: an incident response agent, a Slack bot, a data analyst that runs read-only SQL, a GitHub issue investigator and a document reviewer. Against open-source frameworks such as LangChain or Mastra, you trade portability for a managed runtime, since the documentation shows OpenAI models only. For visual workflow building, n8n is the closer fit.
Because the product is in public beta, endpoints, parameters and the beta header can change before general availability. Related OpenAI products on Hokai include Codex Security, dots and the GPT-6 Sol model.
Product facts on this page (pricing, plans, integrations, compliance) are read from OpenAI's own pages and documentation. The verdict is Hokai's reading of them, not the vendor's claim.