This article is published in English.
OpenAI's Agents API: A Managed Alternative to Custom Agent Frameworks
This article explains how OpenAI's new Agents API handles context management, tool orchestration, and execution environments so teams can skip building custom agent infrastructure.
OpenAI has rolled out the public beta of a new Agents API, and the short version is this: the same harness that runs Codex is now available as a managed cloud service for anyone to use. Instead of assembling your own orchestration layer, you simply describe the task, choose a model, wire up your tools, and pick where the agent should run. A single API call then spins up a production-ready agent, with all the messy plumbing — context handling, tool scheduling, subtask coordination — taken care of and hosted by OpenAI itself.
You can bring whatever tools and connectors you already rely on, attach them to the sandbox environment of your choice, and let the agent take it from there.
A Single Call Replaces Your Whole Framework
const client = new OpenAI();
const session = await client.beta.agents.sessions.create({
agent: {
model: "gpt-6-astra",
tools: [{ type: "mcp", server_label: "observability" }],
multi_agent: { enabled: true, max_concurrent_subagents: 3 },
},
environment: { type: "openai_hosted" },
input: "Investigate the spike in 5xx errors for service-api over the last 30 minutes. Delegate the deployment, error, and dependency analysis to sub-agents. Save your findings and mitigation recommendations to /workspace/outputs."
});
Building a solid agent from the ground up has traditionally meant a lot of unglamorous engineering: managing how much fits in the context window, tuning token usage around tool calls, and hand-rolling logic to keep subtasks in sync. The Agents API is designed to absorb that entire layer of work:
- Automatic context compression: as a session approaches its context limit, the system trims and summarizes older turns on its own, so you don't need custom logic to keep long-running tasks alive.
- Lazy-loaded tool definitions through tool search, which keeps model caching intact and reduces overall token spend.
- Programmatic tool invocation with support for parallel calls and chaining, so that only the pieces of a large dataset that actually matter get passed back into the main agent's context.
- Built-in multi-agent orchestration: a lead agent splits a complex job into pieces, hands them to sub-agents that run in parallel, and each sub-agent keeps its own isolated context.
The service currently runs on OpenAI's newest model, GPT-6-Astra.
Choose Your Own Execution Environment
Not every agent workload has the same infrastructure needs, so the Agents API offers three distinct ways to run your agents:
- An OpenAI-hosted sandbox, built on the same backend that already runs Codex and ChatGPT
- Self-managed infrastructure, where the agent runs directly inside your own VPC
- Sandboxes managed by partner providers, including Blaxel, Cloudflare, Daytona, DigitalOcean, E2B, Modal, Oracle, Runloop, and Vercel
Which route makes sense depends on what you're optimizing for. For quick prototyping, the hosted sandbox gets you moving with the least friction. For production workloads with compliance requirements or data-residency constraints, running inside your own VPC gives you the control you need. Every option carries its own tradeoffs in compute, memory, GPU access, cold-start times, and pricing, so you can match the environment to the job.
Signals From Early Adopters
A small set of teams that tried the beta have already reported encouraging numbers:
- Ciridae saw its evaluation scores climb from 0.71 to 0.85 while cutting latency by a factor of four
- SafetyKit reduced case-review costs by 60 percent, alongside notable improvements in token efficiency
- Hypha cut agent failure rates by 86 percent after decoupling the harness from the sandbox layer
Ciridae's CTO mentioned that the team had spent months building out its own sub-agent observability and orchestration internally, and switching to the managed API delivered immediate, measurable gains without extra tuning. The common thread across these results is straightforward: once you're no longer responsible for maintaining custom agent infrastructure, you can redirect that effort toward the logic that actually differentiates your product.
Transparent By Design, Not A Black Box
The service is built on top of the open-source Codex harness, and the underlying code remains publicly available on GitHub. OpenAI runs and maintains the infrastructure, but nothing about the core execution logic is hidden — you can inspect it whenever you want. That means adopting the managed service doesn't require trusting a closed system; the transparency of the open-source foundation carries over into the hosted product.
Thinking About Actual Costs
There's a joke circulating that this launch just put a hundred-plus startups out of business, and it's not entirely a joke. Whenever a platform provider absorbs a piece of core infrastructure into a managed offering, companies whose whole product was that middle layer suddenly need to find a new angle.
Developers have already flagged a real concern around pricing: a single retry on a complicated task can fire off a dozen tool calls, and each one adds its full trace back into the context. It's possible to burn through a meaningfully larger bill before you even land on a working result. For now, OpenAI isn't charging anything extra for the Agents API itself during the public beta — you only pay for the tokens you consume and the tool executions you trigger. That means you save on the engineering cost of building and running your own framework, but you may end up paying more in raw runtime usage. Finding the right balance between how aggressively your agent automates tool calls and how much that costs will be something each team has to work out for itself.
The Practical Takeaway
Testing a new agent concept has never been cheaper or faster. Teams without an existing internal agent stack can now build directly on top of Codex and skip the foundational engineering entirely. If your organization already has a homegrown agent framework, it's worth asking a pointed question: is building and maintaining that harness actually part of what makes your product special? If it isn't, moving to a managed service like this one could free up a substantial amount of engineering time.
The Agents API remains in public beta and is currently free to use during this phase, so there's little reason not to spin up a test agent with one API call and see what it can actually do.
This launch fits a broader pattern in how large language models keep compressing the layers developers used to have to build themselves. First came Models-as-a-Service, then Harness-as-a-Service, and now something closer to Bot-as-a-Service. Each step pushes developers further up the stack, away from infrastructure plumbing and toward building the applications and experiences that actually set their products apart — and that trend shows no sign of slowing down.