OpenAI opened the Agents API to public beta on Thursday, and the pitch is unusually literal for a launch post: the harness that runs Codex is now a thing you can call over HTTP.

Not a model. The harness. The while-loop that sits around the model and decides when to call a tool, where the files live, what to drop when the context fills up, and what happens when the machine it was running on quietly evaporates at three in the morning.

My first reaction was the ungenerous one, which is that I have written that loop. You have written that loop. It's an afternoon's work: keep a list of messages, switch on the tool calls, append the result, go again. Selling it as a product feels a bit like selling a for.

Then I remembered the last time I left an agent running for six hours and it fell over at hour five.

The loop is easy, the fifth hour is not

Here's the honest version of the ungenerous take. Writing the loop is easy. Writing the loop that survives its own length is not, and those are completely different pieces of software that look identical in a demo.

Three things go wrong, always the same three:

Context fills. You're at 180k tokens and the model still has work to do. Now you need a policy for what to throw away, and every naive policy is wrong in a way you only discover later — summarise too aggressively and the agent forgets it already tried the thing it's about to try again; keep too much and you're paying to re-read a directory listing from four hours ago on every single turn.

State dies. The container gets recycled, the process gets OOM-killed, your laptop lid closes. If the run only exists in memory, you start from nothing, and "start from nothing" on a task that's four hours deep is not a retry, it's a write-off.

And the fan-out gets tangled. The moment one agent spawns three, you own a scheduler. Who gets which files, whose context holds what, what happens when two of them edit the same thing.

The Agents API takes all three. Sessions are durable and survive across turns, compaction happens automatically as you approach the limit, subagents each keep their own context while the parent coordinates, and the whole thing is built to keep running for days. Tools are yours; MCP servers plug in; progress streams.

That's not a for. That's the boring infrastructure nobody writes a blog post about because it isn't fun, and OpenAI has been running it in production against Codex for long enough to have found the sharp edges. Fine. I'll grant that.

They don't want your container

The part I didn't expect: the sandbox is deliberately not locked down.

You can run the compute in OpenAI's own sandbox — the same infrastructure behind Codex and ChatGPT, billed at standard container rates — or on your own infrastructure, or with a partner. The partner list at launch is Blaxel, Cloudflare, Daytona, DigitalOcean, E2B, Modal, Oracle, Runloop and Vercel, and these are first-class integrations, not a logos page. Cloudflare's SDK ships an actual backend for it: isolated containers, install packages, manage files.

Nine sandbox vendors on day one tells you what OpenAI thinks the valuable layer is, and it isn't the box. They're happy for someone else to own the compute as long as they own the orchestration.

There's no fee on top for any of it. You pay tokens and tools, same as before. Anthropic's equivalent has been in public beta since April and charges by the session-hour on top of tokens, so OpenAI has come in at zero, which is a price that tells you what they're actually buying.

The two lines in the beta notes

Data stays in the US. Zero Data Retention is not supported.

For a lot of people that's the end of the article. If you're in the EU and your agent touches anything resembling customer data, this is not a caveat you weigh against the ergonomics — it's an answer, and you can stop reading the feature list.

I find this genuinely awkward to write about, because the engineering is good and the availability is the thing that decides it. Everything above about compaction and durability is real and useful and I'd like to use it, and it doesn't matter, because the beta can't go anywhere near the two Notion databases that make this blog work. There's a version of that sentence for most European teams.

It's beta, they'll fix it, sure. Every US-only beta says that. Some of them mean it.

Meanwhile, a fortnight ago

Small thing worth noticing on the calendar. The Assistants API was removed on 26 August, a year to the day after it was deprecated, with everyone pushed toward Responses and Conversations. Two weeks later: here's a new stateful, server-side, long-running agent primitive.

That's the third go at "OpenAI holds the state for you" in about eighteen months. I don't say that to be snide — Responses genuinely is better than Assistants was, and this looks better again. But if you migrated off Assistants this summer and are now reading a launch post about durable server-side sessions, I'd forgive you for wanting to sit this one out for a quarter.

Where the lock-in moved

This is the bit I'd actually think about.

Swapping model providers has been, for a while now, mostly a base URL and a bit of tool-schema shuffling. Annoying, doable, people do it. That's precisely why every provider has spent this year selling you something that isn't the model.

Put your session state, your compaction behaviour and your subagent topology inside somebody's API and none of that moves. There's no export for "how this harness decided what to forget at 180k tokens", and your agent's behaviour on long tasks is that decision. You're not depending on a model any more, you're depending on a loop you can't read.

The mitigation isn't heroic, it's just early. Keep your tools plain. Keep whatever the run produces — files, diffs, artifacts — somewhere you own, not only inside the session. If the answer to "what happens when we leave" is "we re-derive four hours of agent state from nothing", you've got the same problem the durable sessions were sold to fix, only now it's contractual.

So

The Agents API is a good product solving the unglamorous half of agents, priced at zero above tokens, on infrastructure that has already been kicked for a year. If you're US-based and you've been maintaining your own harness, go and read it properly; there's a decent chance it's better than yours, and I say that as someone whose first instinct was to be rude about it.

If you're in Europe, put it on the list for when residency lands and carry on maintaining your own loop. Which, annoyingly, is where a lot of these posts end up lately.

And if you're about to build a harness this week from scratch: don't start with the loop. Start with what happens at hour five.