The OpenAI Agents API entered public beta on 10 September 2026. You pick the model, the tools, and the environment. OpenAI hosts the harness that drives Codex. The API itself adds no platform fee. A bill usually has three lines: model tokens, built-in tools, and container time only if you actually use the hosted sandbox. If the job needs xcodebuild, a simulator, or signing, a Linux sandbox cannot do it. That step needs a Mac that stays awake.
Today is DevDay (29 September 2026, San Francisco). The rates below are what the pricing page, the GPT-6 Astra model page, and the Agents API announcement showed while this was written. If the keynote changes a price, the console and the pricing page win. For the feature map, see the DevDay preview and GPT-6 Astra features and pricing.
Split the bill into three lines
“The agent is expensive” usually adds four different things: a flagship model, search, an idle container, and a machine rented only because the job needs macOS. Split them, and the daily loop is expensive because of the model tier, not because you called the Agents API.
| Line | When it appears | Rate visible while drafting |
|---|---|---|
| Model tokens | Every inference | Short context, per 1M tokens, input / output: Luna $0.10 / $0.50, Sol $2 / $10, Astra $10 / $50 |
| Built-in tools | Only if you call them | Web search about $10 / 1,000 calls, plus retrieved content billed as input tokens |
| Container | environment.type is openai_hosted |
1 / 4 / 16 / 64 GB about $0.03 / $0.12 / $0.48 / $1.92 per 20 minutes, per container. Eligible sessions bill per minute, 5-minute minimum |
| Your server | You need a resident process, or macOS | The Agents API does not include this line. Homepage monthly starts are about $101.7 (M4 16GB / 256GB) and $200.3 (24GB / 512GB) |
The public create-session example only sets openai_hosted. It does not pick a memory tier. The pricing page still lists four container tiers. Until an invoice arrives, price both 1 GB and 4 GB. Do not budget only the cheapest row.
Build the smallest agent
The session endpoint is POST /v1/agents/sessions, with OpenAI-Beta: agents=v1. The key needs api.agents.read, api.agents.write, and api.responses.write for inference. Keep the key in the process that sends the request. Do not put OPENAI_API_KEY in the sandbox environment. Reserved names such as PATH and CODEX_* are rejected.
curl --no-buffer --fail-with-body https://api.openai.com/v1/agents/sessions \
-H "OpenAI-Beta: agents=v1" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent": {
"model": "gpt-6-sol",
"instructions": "Write clean code, run it, and report the actual output."
},
"environment": { "type": "openai_hosted" },
"input": "Create tree.py, print a readable tree of the current directory, run it, show the output.",
"stream": true
}'
Start on gpt-6-sol. Do not put gpt-6-astra on every session. The acceptance test is one sentence: it writes a file, runs it, and reads back the real output. Move the hard cases you have already measured up to Astra. Once sub-agents are on, tokens add up per agent context. They are not the price of a single user message.
The beta docs say the Agents API does not support Zero Data Retention. Switching to self_hosted does not turn ZDR on. If code or keys cannot leave your network, read the data controls before you create a session.
Three places to run it
Deploying here does not mean wrapping another platform. It answers two questions: who calls the API, and which machine runs the tools.
openai_hosted: scripts and checks
The hosted sandbox is a Linux workspace with Python, Node.js, and a shell. The working directory is /workspace. Use it to generate scripts, process data, and check repositories that do not need Apple’s toolchain. Network access can be tightened per task. Docs often start with access disabled, then open it after the script runs.
A process that stays up
A prototype can send that curl from the laptop in front of you. Close the lid and a long session stops. In production, put the call in a process that does not sleep: a queue, a webhook, or a timer. That process can be small. It does not compile iOS. Custom images, GPUs, or a private network belong on self_hosted or a partner environment from the docs. Do not force them into the hosted sandbox. Request fields follow the developer docs.
When it has to be a Mac
The hosted sandbox is Linux. xcodebuild, the iOS simulator, signing, and TestFlight need macOS. Leave orchestration on the Agents API and the Apple toolchain on a Cloud Mac. Scripts and front-end checks can use the sandbox. Archive and signing stay on the Mac.
On the day this was written, the homepage price pills said: M4 · 16GB / 256GB from $101.7 per month, M4 · 24GB / 512GB from $200.3 per month. Day, week, month, and quarter are all available. Use a day or a week for a short acceptance run, then switch a resident build to monthly. Checkout follows the plan page. This article does not treat a starting price as a contract price.
What the API costs
The table is short context, US dollars per million tokens. Above 272K input, the whole request uses long-context rates: about 2× for input and cache, about 1.5× for output. The premium is not applied only to the overflow. Batch / Flex is about half of standard. Fast is about 2×. Cached input is cheaper. Cache writes are about 1.25× uncached input.
| Item | Input | Cached input | Cache write | Output |
|---|---|---|---|---|
| gpt-6-luna · short context | $0.10 | $0.01 | $0.125 | $0.50 |
| gpt-6-sol · short context | $2 | $0.20 | $2.50 | $10 |
| gpt-6-astra · short context | $10 | $1 | $12.50 | $50 |
| gpt-6-astra · long context (>272K) | $20 | $2 | $25 | $75 |
| Web search | About $10 / 1,000 calls, plus input tokens for retrieved content | |||
| Container 1 / 4 / 16 / 64 GB | $0.03 / $0.12 / $0.48 / $1.92 per 20 minutes (5-minute minimum when billed per minute) | |||
If a route is still on GPT-5.6 Sol, the promo that matched the docs on 20 September was $4 input and $20 output, written through 21 November. That is a different model row. Do not add it to gpt-6-sol’s $2 / $10. Check the pricing page again before you ship.
What the server adds
- You only call it while you are at the computer. Server cost is $0. Close the lid and it stops. It cannot take an overnight job.
- You need a webhook all day, and every tool is in the sandbox or a plain API. The orchestrator is light. If you already have a machine that stays on, do not rent a Mac just to call the Agents API.
- You need macOS. Add a Cloud Mac. The 16GB homepage start is about $101.7 / month. It does not replace tokens. It replaces the step that cannot run without a Mac.
The two payments buy different things. The Mac can be awake and Astra output tokens are still $50 per million. Drop the default model to Sol or Luna before you switch the Mac from daily to monthly.
A monthly worksheet you can edit
This is a worksheet, not a quote. Assume 22 working days and 40 sessions a day: 880 sessions. Each one is short context, no cache: 20,000 input tokens, 4,000 output tokens, and one web search. Totals: 17.6M input and 3.52M output.
| Item | Luna | Sol | Astra | 10% Astra + 90% Sol |
|---|---|---|---|---|
| Model tokens | $3.52 | $70.40 | $352 | $98.56 |
| Web search (content tokens excluded) | $8.80 | |||
| Sandbox 5 min · 1 GB / 4 GB | $6.60 / $26.40 | |||
| Sandbox 20 min · 1 GB / 4 GB | $26.40 / $105.60 | |||
Three comparisons, still excluding retrieved-content tokens:
- Luna + search + 1 GB at the 5-minute floor: about $19 (3.52 + 8.80 + 6.60).
- Mixed models + search + a full 20 minutes at 1 GB: about $134 (98.56 + 8.80 + 26.40).
- That row plus the 16GB Cloud Mac start: about $235 (134 + 101.7). Remove the Mac and the API side is still about $134.
To use your own volume, change three numbers: session count, input tokens per session, output tokens per session. Keep the unit-price row aligned with the pricing page. If 880 sessions become 88, model, search, and container all divide by about 10. Mac rent does not.
FAQ
Does the Agents API have a platform fee?
The beta announcement says no. You pay tokens for the model you select, built-in tools you actually call, and container time only when you use openai_hosted.
Which model should the daily loop use?
Default to gpt-6-sol or gpt-6-luna. On the same 880 sessions, all-Astra model spend is $352. Ninety percent Sol and ten percent Astra is $98.56. Promote a hard case only after a fixed eval compares it.
Can the hosted sandbox run Xcode?
No. It is Linux. Signing, the simulator, and xcodebuild stay on macOS. A Cloud Mac covers that step. It does not replace the API bill.
Where does the API key live?
In the process that calls the API, not in the sandbox environment. Beta does not support Zero Data Retention, and self_hosted is not an exception.
How do I estimate a month?
Start from the 880 sessions above and replace the count and the tokens. Price containers at both 1 GB and 4 GB, and look at both the 5-minute floor and a full 20 minutes. If DevDay changes a rate, the pricing page wins.
Prove the session, then read the three lines
The order is: smallest session, three bill lines, and only then whether you need a Mac. Leave the default model on Sol or Luna. Save Astra for hard cases you have measured. Linux sandbox for scripts, macOS for archives. Do not ask one machine to replace the other, and do not merge the two bills into a single “agent monthly fee.”
Long jobs need a machine that stays awake
The laptop is for proving the curl. Overnight agent loops, and xcodebuild, belong on a Cloud Mac that does not sleep. The laptop only reads the diff and the invoice.