Aller au contenu principal
Tuyauterie cuivre enchevêtrée convergeant vers un bloc céramique noir monolithique

Building agents that don’t break: OpenAI’s new stack explained

Back to blog
Artificial Intelligence
Nicolas
8 min read
Tuyauterie cuivre enchevêtrée convergeant vers un bloc céramique noir monolithique

By 2026, no digital company questions whether to integrate an AI agent somewhere: customer service, quote generation, ticket sorting, contract analysis.

The real question has become: how to build them without breaking the bank, without them crashing at the first hiccup, and without leaking client data in the process.

On April 15, 2026, OpenAI rolled out a major overhaul of its OpenAI Agents SDK designed to simplify exactly this part of the job.

Behind the jargon, the idea is simple: handle what teams were coding by hand, the loop that makes the model interact with its tools, the isolation of the code it generates, and the clean recovery after a crash.

The measured gain is clear: 65% less code to write on this layer according to public feedback.

The trade-offs, absent from the official documentation, are more discreet: an API bill that increases by 15 to 25%, a silent technical lock-in, and a blind spot on GDPR.

In short

  • Overhead tokens 15 to 25%: 200 to 600 additional tokens per call, or 4 to 12 USD per month for 100 daily invocations at GPT-5 rates
  • Breakeven with Cloudflare at 1000 calls/day: below that, OpenAI wins; above, Cloudflare’s 10,000 free Neurons tip the balance
  • Partial lock-in to map: the portable manifest stops at the seven validated providers, the harness remains OpenAI-specific
  • GDPR gap on sessions: EU data residency covers API calls, not sessions that persist history and checkpoints

What the April 15 overhaul changes

Building an agent isn’t just sending a prompt to GPT-5 and waiting for a response.

An agent works in a loop: the model decides, it calls a tool (read a database, execute code, send an email), it reads the result, it decides the next step, until its task is complete.

This loop needs orchestration: who calls what, in what order, what to do if a step fails, where to store the state while the agent works for several hours or days.

This is called the orchestration plumbing.

It represents 70 to 80% of an agent’s production code.

The overhaul specifically targets this plumbing.

Three components previously hand-coded now move behind the SDK’s API: the harness (the layer that makes the model interact with its tools), the sandbox (the isolated environment where generated code runs), the manifest (the file that describes the agent’s workspace, like a Dockerfile describes an image).

OpenAI provides two MIT-licensed packages: openai-agents v0.4.2 in Python, @openai/agents-openai v0.8.3 in TypeScript.

What changes: the code teams write is reduced to the agent’s business behavior, the rest shifts behind the abstraction.

What doesn’t change: neither the model’s reasoning, nor the quality of the tools, nor the design discipline that keeps the agent coherent over a long workflow.

Sandbox execution solves the safety problem, doesn’t solve the accuracy problem, reminds a contributor on Hacker News thread 47782022.

How much it really costs your teams

Two opposing economic effects occur simultaneously with this overhaul: less code to write, but more tokens consumed with each call.

The first effect is called code diff, the second overhead tokens.

On the code side, public feedback from April 15, 2026, quantifies a real refactor: 340 lines of custom orchestration with LangGraph reduced to 120 lines with the new SDK, a 65% reduction in plumbing.

The gain is especially noticeable on agents with multiple sub-agents: the handoff pattern replaces a routing logic previously written by hand.

On the API bill side, the harness adds structural tokens to each call (Pydantic definitions of tools, expanded system instructions, tracing metadata).

Count 200 additional tokens with a single tool, 400 to 600 tokens with three typical tools.

For 100 daily invocations of an agent with three tools, this adds 4 to 12 USD per month at GPT-5 rates.

For 5000 daily calls with five tools, the overhead rises to 250 to 400 USD per month.

Teams that have built a very stateful orchestration engine on LangGraph will find the gain less significant: they have already absorbed this cost, and the SDK abstraction hides hooks they used explicitly.

OpenAI or Cloudflare: when to choose which

OpenAI is not alone in this market.

On the same day, Cloudflare announced Project Think, its own agent platform, with a radically different business model: OpenAI charges by the volume of text processed, Cloudflare charges by execution time on its edge infrastructure.

Brass balance with golden cubes facing translucent glass prisms
OpenAI tokens vs. Cloudflare Neurons, the economic tipping point.

For a small agent, the difference isn’t obvious: 100 calls per day cost about 6 cents on GPT-5.4, slightly less with Cloudflare.

For an agent handling thousands of conversations, the gap widens: Cloudflare offers 10,000 free Neurons daily, a franchise that covers small volumes.

The breakeven is around 1000 calls/day: below that, OpenAI remains simpler; above, Cloudflare becomes more economical.

Beyond price, three practical criteria differentiate the two offers.

Latency: OpenAI wins on raw inference; Cloudflare wins when the agent serves users distributed worldwide (edge latency).

Durability: Cloudflare has Durable Objects (strong runtime persistence); OpenAI achieves equivalent via snapshot and rehydration, but the abstraction remains OpenAI-specific.

MCP support (the Model Context Protocol, a standard for tool and model interoperability): native on OpenAI’s side, possible on Cloudflare’s side with additional glue code.

Choose OpenAI when: critical frontier reasoning, volume under 1000 calls/day, team already comfortable with OpenAI Python.

Choose Cloudflare when: high volume, edge need, state durability, tight cost constraint.

To broaden the picture, Anthropic’s Managed Agents offer a more integrated model missing from the two stacks compared here.

The real choice criterion is the workflow’s load profile, not a winner-takes-all match: frontier reasoning at OpenAI, high-volume durable workflows at Cloudflare.

The GDPR gap on Agents SDK sessions

In April 2026, OpenAI published its EU data residency commitment with zero retention on API calls: inputs and outputs of each request are not stored on OpenAI servers.

The official text remains silent on a specific point: the sessions created by the Agents SDK, which persist conversational history, intermediate tool calls, and sandbox snapshots.

For an agent handling health, banking, or defense data, this persistence must be audited in light of the DPA (Data Processing Addendum, the data processing contract) before production.

If sovereignty constraint is paramount, three packaging-ready European alternatives exist: Mistral Le Chat Enterprise (MCP Connectors, hosted in France), OVHcloud AI Endpoints (open-source models hosted in France and Germany), Scaleway AI (generative APIs, French platform).

None duplicate OpenAI’s harness: the agent running there keeps an external orchestrator, with a bit more code for the team to write.

What the OpenAI Agents SDK shift means in 2026

Three signals prompt the decision: agent volume, lock-in tolerance, sector GDPR constraints.

A team managing a high-value business agent under 500 calls/day clearly benefits from the SDK’s engineering gain.

A team with high volume or exposed to a sovereignty constraint should consider writing a pattern adapter (a custom abstraction layer in 200-300 lines of Python that maps Agent, Tool, Session, and Checkpoint to multiple backends) before migrating.

This quarter of effort pays off within 12 months as soon as sovereignty or pricing dependency becomes an issue.

Central metal adapter connecting four cables with different connectors
The pattern adapter, an intermediate layer that keeps the switch open to multiple providers.

FAQ

Should you migrate your existing LangGraph agent to the OpenAI Agents SDK?

Yes under 500 calls/day with tolerance for 15-25% overhead tokens, no for a complex stateful agent that has already absorbed the plumbing cost.

How much does the harness overhead cost in additional tokens?

200 to 600 tokens per call depending on the number of tools, or 4 to 12 USD/month for 100 daily invocations at GPT-5 input rates.

Does the sandbox protect against prompt injections?

It isolates credentials against exfiltration but doesn’t correct hallucinations or destructive actions mistakenly decided by the model.

What is the economic breakeven between OpenAI and Cloudflare?

Around 1000 calls/day: below that OpenAI remains simpler, above Cloudflare’s franchise (10,000 free Neurons) tips the advantage.

Is the OpenAI Agents SDK GDPR compliant for French-speaking client data?

The EU data residency of April 2026 covers API calls with zero retention, not explicitly the Agents SDK sessions, a DPA audit with OpenAI sales remains essential before sensitive production.

Is TypeScript supported on the harness and sandbox?

Python first (openai-agents v0.4.2), TypeScript via @openai/agents-openai follows without a firm date.

Can you combine OpenAI Agents SDK and Cloudflare Project Think?

Yes via a custom pattern adapter: the Agents SDK orchestrates frontier logic, Cloudflare hosts persistence and high-volume sub-agents.

Do the seven sandbox providers execute the same manifest identically?

The format is portable, each provider introduces its quirks on timeouts and file limits that a targeted test validates.

Which packages to install to start?

Python: pip install openai-agents==0.4.2 (3.9+); TypeScript: npm install @openai/agents-openai@0.8.3 as soon as sandbox support is released.

Can you avoid OpenAI lock-in while benefiting from the harness?

The Agents SDK supports 100+ LLMs on the inference side, but the harness and session remain OpenAI-specific; a pattern adapter that abstracts Agent, Tool, Session, and Checkpoint remains the most robust path over 18 months.

Related Articles

Ready to scale your business?

Anthem Creation supports you in your AI transformation

Disponibilité : 1 nouveau projet pour Avril/Mai
Book a discovery call
Une question ?
✉️

Encore quelques questions ?

Laissez-moi votre email pour qu'on puisse continuer cette conversation. Promis, je garde ça précieusement (et je ne vous bombarderai pas de newsletters).

  • 💬 Accès illimité au chatbot
  • 🚀 Des réponses plus poussées
  • 🔐 Vos données restent entre nous
Cette réponse vous a-t-elle aidé ? Merci !