Skip to main content
TokenCost logoTokenCost
IndustrySeptember 13, 2026ยท15 min read

OpenAI says the Agents API has no additional fees, and it does not. The sandbox every hosted session runs in bills at a container card whose rates have not moved since March, on a memory tier you cannot pick and a clock OpenAI has not said when it starts.

The Agents API went into public beta on Thursday, September 10. It is the Codex harness as a service: you send a task, OpenAI runs the loop, and the agent's shell commands land in a sandbox that OpenAI hosts unless you bring your own. The launch post prices it in one sentence, "you simply pay for the tokens and tools your agents use," and the sentence is accurate. The sandbox is a tool. It bills at OpenAI's existing container rates, $0.03 to $1.92 per 20 minutes depending on memory, and the Create Session API has no field for memory. So we spent the weekend working out what an hour of agent actually costs on this thing, and the short answer is that it depends on two things OpenAI has not written down. The long answer, the one with numbers in it, is below, next to Anthropic's $0.08 an hour for the same job.

OpenAI's Agents API diagram: application sends tasks to the managed Codex harness, which makes tool calls to a sandbox

Image source: OpenAI

Four numbers, two of them OpenAI's

$0.03 to $1.92

OpenAI container, per 20 minutes, 1 GB to 64 GB

0 fields

in the Create Session API that pick the size

$0.08 an hour

Claude Managed Agents, up to 8 GB, idle time free

76%

of a GPT-5.6 Luna hour that is the box, not the model

The pricing page did not change on launch day

We looked for the Agents API on OpenAI's pricing page and it is not there, in the sense that no row carries its name. The Wayback Machine has captures from September 9, 10 and 12, and the built-in tools table is byte-identical across the launch. What the hosted sandbox doc does instead is point at an existing row: "OpenAI-hosted sandboxes use standard container rates. Model usage is billed separately at the selected model's API rates." The row it points at is the one Code Interpreter and the shell tool have billed against all year.

ContainerPer 20-min sessionPer minute5-min minimumPer hour
1 GB (Code Interpreter default)$0.03$0.0015$0.0075$0.09
4 GB$0.12$0.006$0.03$0.36
16 GB$0.48$0.024$0.12$1.44
64 GB$1.92$0.096$0.48$5.76
Web search$10.00 per 1,000 calls, plus search content tokens at model rates
Agents APINo row, and not on the page's list of APIs that are "not priced separately" either

The first four rows are OpenAI's; the per-minute, minimum and hourly columns are ours, and they are just the row divided by 20 and multiplied back out. The GB is a gibibyte, which the page says in a footnote. So an hour of agent in the smallest box is nine cents before a single token, and an hour in the biggest is $5.76, which at gpt-6-astra's $50 output rate is the price of 115,200 output tokens. Whether that matters depends on which row you are on, and that is the first thing OpenAI has not told you.

There is no memory parameter

When you call Code Interpreter through the Responses API you pass a container object with a memory_limit of 1g, 4g, 16g or 64g, and the docs say "1g (default)" and "the selected memory_limit applies for the entire life of that container." That is how you know which of the four rows you are paying. The Agents API Create Session reference has an environment object of type openai_hosted, and its fields are type, capability_directories, env, environment_template_id, files, network, packages, plugins, setup_commands and skills. No memory_limit. No cpu. No gpu. The launch post's line about "different CPU, GPU, and memory configurations, with performance, cold-start, and cost profiles" is in the paragraph about the nine partner clouds, not the OpenAI-hosted option, and the hosted doc describes its box only as "a Linux workspace with Python, Node.js, and command-line tools."

So the price of the sandbox is one of four numbers, the largest 64 times the smallest, and nothing in the API or the docs says which. Our guess is 1 GB, because that is the default on the shared rate card and because OpenAI would presumably say so if it were charging $1.92 a session. But a guess is what it is. We have used the 1 GB row for the base case in everything below and shown the 4 GB row alongside it, and if OpenAI publishes a tier we will correct this post and say so at the top.

Two related things we did find. The usage endpoint that reports container spend, GET /organization/usage/code_interpreter_sessions, returns one number per bucket, num_sessions, with no minutes and no tier, so you cannot audit the bill from the API either. And the second reply to the launch thread on OpenAI's own forum, from the community moderator who posted the thread, reads: "PSA: If you are new to using hosted sandboxes, please be careful when spinning up new containers and calculate the costs first. I learned this the hard way." We would like to calculate the costs first. That is the point of this post.

Eligible is not defined

The container row says "per 20-minute session per container." The footnote under it says "eligible container sessions will be billed by the minute, with a 5-minute minimum per session." Those are two different billing units on one page, and the word doing the work is eligible, which the page does not define. We went back through the Wayback captures to see where the footnote came from, and it turns out this rate card has been restructured twice this year without a single rate moving.

CaptureBilling unit on the page4 GB rate
March 11, 2026"$0.12 / container", with a "Starting March 31st" block showing "$0.12 / 20 minutes / container"$0.12
April 1 to May 28"per 20-minute session per container"; footnote "eligible container sessions are billed at the full 20-minute session rate"$0.12
June 5 onwardSame row; footnote becomes "billed by the minute, with a 5-minute minimum per session"$0.12
September 9, 10, 12Unchanged through the Agents API launch$0.12

When we wrote up Codex container billing in March the unit was a flat fee per container. Three weeks later it was a 20-minute block, which made long containers dearer and short ones no cheaper, and two months after that a per-minute meter with a floor, which is the change that cut the short-work bill. Neither touched the four numbers. That history matters for the Agents API because a Code Interpreter container has a natural end: the docs say it "expires if it is not used for 20 minutes," and a 20-minute block is that lifetime priced. An Agents API sandbox does not end that way. The hosted doc says "connected sandboxes receive keep-alives, including between turns. If activity and keep-alives stop for an hour, the sandbox can be deleted. This timeout isn't configurable." A sandbox that is kept alive between turns is, on the pricing page's own terms, a session, and the page says a session bills by the minute. It does not say whether a minute in which the agent is waiting for your next message is a billed minute.

We are not the only ones who noticed. The Hacker News thread has 345 points and 183 comments as we write, and the most upvoted question about money is Simon Willison's: "The pricing on this is a bit confusing. Does each execution of an agent session create a new environment? And is that environment then billed for at least a full hour (despite prices being quoted per 20 minutes), after which it naturally expires? Is there a way to deliberately shut down an environment so you don't have to keep paying for it?" The best answer in the thread is from another user, who worked out that an activated environment costs at least $0.0075 at the 1 GB rate and that you can opt out of a sandbox entirely with environment.type set to none. Nobody from OpenAI has answered.

The closest thing to an OpenAI statement on idle billing is from a different product and a different year. In November 2025 developers found the Responses API creating a container on every call and charging $0.03 each time whether or not the model used it; one team reported 100,000 to 150,000 containers and "several thousand dollars in unexpected charges." OpenAI Support's last word in that thread was "we no longer charge for unused containers." That is a statement about containers the model never touched, not about a sandbox the agent used at 14:02 and is holding open at 14:40 waiting for you. If idle minutes bill, the hour between your last message and deletion costs $0.09 at 1 GB and $5.76 at 64 GB, per session, per forgotten tab. The one documented control is the sentence "delete the session when you're done to request sandbox cleanup," followed by the advice to retry on a 409. Delete your sessions.

The same hour on Anthropic

Anthropic has sold the equivalent product since April under the name Claude Managed Agents, and its pricing page answers both of the questions above in one table row and one paragraph. Session runtime is "$0.08 per session-hour," metered on "running status duration," and: "Runtime is measured to the millisecond and accrues only while the session's status is running. Time spent idle (waiting for your next message or a tool confirmation), rescheduling, or terminated does not count toward runtime." There is one rate, not four, and the cloud sandbox reference lists its box as "Memory: Up to 8 GB." Anthropic also says explicitly that this replaces its older $0.05-per-container-hour code execution meter, so you are not paying both.

Sandbox cost for one hour of running agent, dollars

Anthropic Managed Agents, any size to 8 GB
$0.08
OpenAI hosted sandbox, 1 GB
$0.09
OpenAI hosted sandbox, 4 GB
$0.36
OpenAI hosted sandbox, 16 GB
$1.44
OpenAI hosted sandbox, 64 GB
$5.76

OpenAI rows are the published 20-minute rate times three. Anthropic's hour excludes idle time by definition; OpenAI's may or may not.

Per hour, then, OpenAI's 1 GB box costs a cent more than Anthropic's 8 GB one, and the 4 GB box that a coding agent running a test suite is more likely to want is four and a half times it. The 64 GB row is 72x, which is an odd number to be comparing against a competitor that charges a flat rate up to 8 GB, and it is the row we think almost nobody is on. But the sandbox is the small line on both bills. Anthropic's pricing page works one example: a one-hour Opus 5 session that consumes 50,000 input tokens and 15,000 output tokens costs $0.25 plus $0.375 in tokens and $0.08 in runtime, $0.705 total, so runtime is 11.3% of it. We ran the same 50,000 and 15,000 through OpenAI's four Agents-API-era models and the 1 GB and 4 GB sandbox rows.

One hour, 50K in / 15K outTokensSandboxTotalSandbox share
Claude Opus 5, Managed Agents$0.625$0.08$0.70511.3%
Claude Haiku 4.5, Managed Agents$0.125$0.08$0.20539.0%
GPT-6 Astra, 1 GB / 4 GB$1.25$0.09 / $0.36$1.34 / $1.616.7% / 22.4%
GPT-5.6 Sol, 1 GB / 4 GB$0.50$0.09 / $0.36$0.59 / $0.8615.3% / 41.9%
GPT-5.6 Terra, 1 GB / 4 GB$0.28$0.09 / $0.36$0.37 / $0.6424.3% / 56.3%
GPT-5.6 Luna, 1 GB / 4 GB$0.028$0.09 / $0.36$0.118 / $0.38876.3% / 92.8%

Where the dollar goes: tokens (left) against sandbox (right) for the same hour

Opus 5 + Managed Agents
11.3%
Haiku 4.5 + Managed Agents
39.0%
GPT-6 Astra + 1 GB
6.7%
GPT-5.6 Sol + 1 GB
15.3%
GPT-5.6 Terra + 1 GB
24.3%
GPT-5.6 Luna + 1 GB
76.3%
GPT-5.6 Luna + 4 GB
92.8%

Percentage is the sandbox's share of the hour's bill. 50,000 input and 15,000 output tokens at list, no cache, no tools, from Anthropic's published worked example.

Two readings of that table. On the flagship it does not matter. Astra's tokens are $1.25 for the hour and the sandbox is nine cents or 36, so whichever row OpenAI has you on the sandbox is under a quarter of the bill, and the reason an Astra hour costs nearly double an Opus 5 hour is the $10 and $50 on the token card, not the box. We covered that card when it shipped. On the cheap model it is the whole story. Luna at $0.20 and $1.20 is the tier you would put a high-volume, low-stakes agent on, and at that rate the hour of tokens is 2.8 cents. The 1 GB sandbox costs more than three times the model. The 4 GB sandbox costs nearly thirteen times the model. Anthropic's runtime fee is also large next to Haiku, at 39%, but a Haiku hour is still $0.205 all in; a Luna hour is $0.118 at the tier we are guessing and $0.388 at the one we are not. The whole reason to pick a model at a twentieth of Sol's input price evaporates if the box around it is priced by a different department.

One fairness note. Anthropic's example is light: 65,000 tokens is a few turns of a real coding agent, not an hour of one, and a session that runs 40 tool-calling turns at 30,000 input and 2,000 output each is over a million input tokens. With 85% of that input hitting the cache, the sandbox share on Astra falls to 1.3% at 1 GB and 5.0% at 4 GB, and on Luna to 37.1% and 70.3%. The shape of the conclusion does not change. The sandbox is a rounding error on the model that costs $50 a million and the main event on the one that costs $1.20.

What the box costs if you bring your own

The other half of the launch is that the sandbox does not have to be OpenAI's. You run codex exec-server in your own container, hand the session a restricted executor key, and the harness talks to it over a websocket. OpenAI names nine partners with setup guides. Seven of them publish a per-second or per-hour rate, so we priced the same 20 minutes of a 2 vCPU, 4 GB box on each, which is the comparison the $0.12 row invites. OpenAI, for what it is worth, publishes no vCPU count for its containers at all, so its column is a memory match only.

ProviderPublished rate20 min, 2 vCPU / 4 GBvs OpenAI $0.12
OpenAI hosted, 4 GB$0.12 per 20-minute session, vCPU unpublished$0.1201.00x
Cloudflare Sandbox, standard-3 (2 vCPU, 8 GiB)$0.0000025 per GiB-s, $0.00002 per active vCPU-s, $0.00000007 per GB-s disk$0.025 to $0.0730.21x to 0.61x
Vercel Sandbox (Pro)$0.128 per active CPU-hour, $0.0212 per GB-hour$0.028 to $0.1140.24x to 0.95x
E2B$0.000028/s for 2 vCPU, $0.000018/s for 4 GB$0.0550.46x
Daytona$0.0504 per vCPU-hour, $0.0162 per GiB-hour$0.0550.46x
Blaxel$0.0000115 per GB RAM per second, CPU scales with memory$0.0550.46x
Modal Sandbox$0.00003942 per physical core-s (2 vCPU), $0.00000667 per GiB-s$0.0790.66x
Runloop$0.108 per CPU-hour, $0.0252 per GB-hour$0.1060.88x
DigitalOcean, OraclePrivate preview and beta respectively. No public rate.

Three providers land on $0.0552 to the cent, which we checked twice because it looked like a copy error. It is not: E2B's two per-second lines, Daytona's two hourly lines and Blaxel's single RAM line all reduce to the same number for this shape, which tells you where the sandbox market has settled. OpenAI's 4 GB box is a little over double that. The ranges on Cloudflare and Vercel are because both bill CPU only while it is busy, so an agent that spends most of its 20 minutes waiting on a model pays the low end. That is the same idle distinction Anthropic draws and OpenAI does not.

What you buy for the extra six and a half cents is not nothing. The hosted sandbox is provisioned in the session create call, there is no executor to run and no key to rotate, and the box is, in OpenAI's words, "the same sandboxing infrastructure that powers Codex and ChatGPT." A commenter on the HN thread put the trade as "ease of setup and accepting the lock-in; in exchange for OpenAI handling security-patching the environment, scaling containers, etc." That is a reasonable thing to pay six and a half cents per 20 minutes for. It is a harder thing to price when you do not know whether the box is the $0.12 one or the $0.48 one, or whether the meter stops when the agent does.

Google, for completeness

Gemini's code execution tool has no runtime charge at all: the pricing page says "costs are determined solely by the tool's usage, no charges are accrued for the session runtime," and its managed agent preview says "environment compute (CPU, memory, sandbox execution) is not billed during the preview period." Neither is comparable. The code execution environment has a 30-second maximum runtime and you cannot install libraries in it, and "not billed during the preview period" is a price with an unannounced end date, a pattern we have catalogued before. But it does mean that of the three labs selling a hosted agent, one charges nothing for the box today, one charges eight cents an hour and says exactly when, and one charges between nine cents and $5.76 and says neither which nor when.

What we could not find

We would rather list these than pretend the numbers above are firmer than they are. None of the following is published by OpenAI as of September 13, and we checked the pricing page, the six Agents API environment docs, the Create Session reference, the changelog and the rate limits guide.

  • Which container tier an openai_hosted sandbox is billed at. There is no parameter to set one.
  • What makes a container session "eligible" for per-minute billing, and when the meter starts and stops.
  • Whether the up-to-one-hour idle period before deletion is billed.
  • A maximum session length for hosted sandboxes, or a concurrency limit per tier. The only related figure is Code Interpreter's 100 requests per minute per org.
  • A list of models the Agents API supports. Every example in the docs uses gpt-6-astra, the most expensive one; the reference says only "the model used by the agent."
  • Whether the six concurrent subagents a session allows by default share one sandbox or spin up six.

The launch post ends with "during the public beta, we'll iterate quickly based on your feedback as we work toward general availability." The feedback we would offer is short: put a memory_limit on the session object, define eligible, and write the sentence Anthropic wrote about idle time. Until then the cheapest thing you can do with an Agents API session is set environment.type to none when the task does not need a shell, and the second cheapest is to delete it the moment it is done.

Sources