Skip to content
HomeAI Tools and AutomationsWhat Is an Agents API? The Four Parts Explained | ISL

What Is an Agents API? The Four Parts Explained | ISL

What is an agents API? See the four parts, the five jobs it handles for you, and both vendors' real costs and data limits. Read the breakdown now.

TL;DR

An agents API rents you the harness around a model, not a smarter model. The harness is the loop, the sandbox, the memory trimming, the helper agents and the retries. OpenAI and Anthropic both ship one, and both are built from the same four parts: agent, environment, session, events. The harness itself now costs cents per hour. Neither one supports Zero Data Retention today, which rules both out for regulated data.

Open OpenAI's agent documentation in one tab and Anthropic's in another, and the nouns match. Agent. Environment. Session. Events. Same four words, shipped five months apart by two competitors who did not coordinate. That match is the fastest way into the question of what an agents API is: two rivals looked at the same problem and arrived at the same shape.

The model is not the product here. A model answers one message at a time. Everything that turns that into a worker which runs for an hour, opens files and finishes a job is plumbing — and until this year, teams wrote that plumbing themselves. Anthropic's own launch post calls it months of infrastructure work before anything ships. Now it is rented by the hour. What follows is the four parts, the five jobs the harness takes off you, what each vendor charges, and the one line in the fine print that decides whether you can use either of them at all.

OpenAI Agents API vs Claude Managed Agents at a glance

LineOpenAI Agents APIClaude Managed Agents
What it isAccess to OpenAI's managed Codex harness through an APIPre-built configurable agent harness running in Anthropic's managed infrastructure
Public availabilityPublic beta, launched 10 September 2026Launched 8 April 2026, beta header managed-agents-2026-04-01
The four partsAgent, Environment, Session, Events and itemsAgent, Environment, Session, Events
Agent definition includesModel, instructions, tools, MCP serversModel, system prompt, tools, MCP servers, skills
Sandbox choiceOpenAI-hosted container, or a self-hosted sandbox you runAnthropic-managed cloud sandbox, or a self-hosted sandbox on your own infrastructure
Harness feeNo fee for the Agents API itself$0.08 per session-hour, charged on top of tokens
Sandbox cost1 GB container $0.03 per 20-minute session, up to 64 GB at $1.92No separate container-hour bill; session runtime replaces it
Idle timeContainer sessions billed by the minute, 5-minute minimum per sessionRuntime accrues only while status is running; idle does not count
Data residencyUnited States onlyUS-pinned inference bills tokens at 1.1x standard rates
Zero Data RetentionNot supported, and a self-hosted sandbox does not change thatNot eligible, and no HIPAA Business Associate Agreement either
Best forLong-running tasks where OpenAI handles progress and infrastructureLong-running tasks and asynchronous work

Prices, limits and feature lines checked on each company's own documentation in September 2026. Both vendors change these pages often — check the live page on the day you build.

What does an agents API actually do?

An agents API runs the agent for you. It hosts the loop that calls the model, gives that model a sandbox where it can open files and run code, trims the conversation before it overflows, splits work across helper agents, and resumes a job that failed halfway through. The model itself is untouched.

OpenAI's documentation puts it in one sentence: OpenAI manages "sessions, orchestration, context compaction, and recovery" while your application provides the tools and chooses the execution environment. Anthropic describes Claude Managed Agents the same way — a pre-built, configurable agent harness that runs in managed infrastructure, best for long-running tasks and asynchronous work. Two companies, two marketing departments, one product description. That is why the harness line on the bill is so small next to the token line: what used to take a team months is now a rented service, and the model's tokens are the rest of the cost.

What is an agent harness, and how is it different from the model?

A model is a brain in a jar. It reads text and writes text. It cannot open a file, remember yesterday, or try again when a step fails. The harness is everything that gives that brain hands, a desk and a notebook — and keeps the work moving while nobody is watching.

Anthropic's launch post for Managed Agents lists what shipping a production agent used to require: "sandboxed code execution, checkpointing, credential management, scoped permissions, and end-to-end tracing." It calls that "months of infrastructure work before you ship anything users see." An agents API is that list, hosted and metered. Which leads to the single most useful correction on this topic: renting a harness does not make the agent better at the task. Same model, same judgment calls, same blind spots. The harness only stops the job falling over when it runs long. If the output quality is the problem, the fix is upstream — in how the task is written, not in where it runs. ISL covered that side separately in four prompting habits that quietly cost hours.

🎬 Watch the full video breakdown below

The four parts both companies shipped

Here is the part worth committing to memory, because it makes both sets of documentation readable. The OpenAI Agents API is built around four concepts. Claude Managed Agents is built around four concepts. They are the same four.

PartOpenAI's wordingAnthropic's wordingWhat it is, plainly
AgentThe model, instructions, tools, and MCP servers available to the agentThe model, system prompt, tools, MCP servers, and skillsThe setup. Which brain, which rules, which tools it may reach
EnvironmentAn optional sandbox or computer where the agent accesses files, loads skills, and runs commandsConfiguration for where sessions run: an Anthropic-managed cloud sandbox, or a self-hosted sandbox on your own infrastructureA small computer in the cloud. The agent works there, not on your machine
SessionA durable instance of an agent that works on tasks and responds to inputA running agent instance within an environment, performing a specific task and generating outputsOne job in progress. It holds the work so far, and it lasts
EventsThe inputs sent to an agent and the output produced during a sessionMessages exchanged between your application and the agent (user turns, tool results, status updates)The messages in and out. You send a task, it sends back progress

MCP, in that first row, is the standard plug that lets an agent reach your other software — a calendar, a database, an internal service. Both vendors list it in the agent definition rather than treating it as an add-on.

OpenAI's Agents API documentation listing four main concepts: Agent (the model, instructions, tools and MCP servers), Environment (an optional sandbox where the agent accesses files and runs commands), Session (a durable instance of an agent), and Events and items (the inputs sent and output produced).
OpenAI's Agents API documentation, checked September 2026.

Anthropic publishes the same four rows as an actual table, with one addition in the agent row: skills. Everything else lines up close enough to read as a translation.

Anthropic's Claude Managed Agents documentation showing a four-row core concepts table: Agent (model, system prompt, tools, MCP servers and skills), Environment (an Anthropic-managed cloud sandbox or a self-hosted sandbox), Session (a running agent instance performing a task), and Events (messages exchanged between your application and the agent).
Claude Managed Agents documentation, checked September 2026.

When two rivals land on the same shape, that shape is probably the real one. It also hands you a shortcut worth an evening of reading: learn the four parts once and either company's documentation stops looking like a foreign language. The vocabulary transfers, the mental model transfers, and the only thing left to compare is price and fine print.

To map one of your own jobs onto those four parts, ISL built a one-page worksheet: the Agents API Fit Card. It has the four parts as blanks to fill in for a single job, a three-question rung picker, and both vendors' price and data lines side by side, so the comparison is on one page instead of across two sets of documentation.

Four dark cards in a row under the header "Same four parts, two vendors" — Agent, the setup; Environment, the sandbox; Session, the job in progress; Events, the messages — footed with "OpenAI Agents API - Claude Managed Agents".

Five jobs the harness does for you

The four parts are only the boxes. The value sits in what happens between them, and OpenAI's launch post is blunt about it: developers no longer build a custom agent harness, their own context management for long sessions, their own compaction, or their own subagent orchestration. Anthropic's documentation covers the same ground from the other side.

To make that concrete, take one task. You hand an agent sixty meeting transcripts and ask for a decision log — every decision, who made it, and what it replaced. Here is what the harness handles while that runs.

  1. The loop. The model reads a transcript, decides it needs the next one, asks, receives it, writes a line, and repeats. Sixty times. Something has to run that cycle, catch each request, carry it out and hand the answer back. It is the first thing every agent builder writes by hand, and it is now hosted.
  2. Memory trimming. Sixty transcripts will not fit in a model's working memory at once. Before it fills, the harness squeezes older material into a summary and carries on. The documentation calls this compaction. Without it, a long job stalls halfway and there is no graceful way out.
  3. Picking tools. Give an agent forty tools and it burns attention reading forty descriptions every turn. OpenAI's harness loads a tool's instructions only when the agent needs that tool. Anthropic builds prompt caching and compaction in for the same reason. Less re-reading, faster turns, fewer tokens.
  4. Splitting the work. The harness can hand batches of transcripts to helper agents running side by side, then merge the findings. OpenAI calls them subagents, and how many run at once is a setting you pass in, not a fixed limit. Worth knowing before you reach for it: parallel agents fail in their own particular ways, which ISL mapped in 14 ways agent swarms break.
  5. Recovery. Step thirty-one fails. A file will not open, or a connection drops. A hand-built loop can die right there and start from the top. A managed session resumes where it stopped, because the session held the state.

That is the entire product. The loop, the trimming, the tool choice, the helpers, the recovery. None of it is intelligence. All of it is the work that used to eat a team's months.

Start this week. Take one action.​

Open the FREE ISL Resource Vault. It holds every free guide, checklist and template from the lab in one place. Pick one resource. Build one system this week. No overwhelm. No guessing.

What does an agents API cost?

The harness is now the cheap line on the bill. OpenAI charges no fee for the Agents API itself — you pay for the model's tokens, any tools, and the sandbox. Anthropic charges $0.08 per session-hour on top of tokens. Run either one for an hour at the smallest size and the harness line lands in single-digit cents. The tokens are the rest.

OpenAI's own wording on the launch post is that there are no additional fees for using the Agents API — you pay for the tokens and tools your agents use. The documentation adds that OpenAI-hosted sandboxes bill at standard container rates. Those rates are published: $0.03 for a 1 GB container per 20-minute session, $0.12 at 4 GB, $0.48 at 16 GB, and $1.92 at 64 GB. Eligible container sessions are billed by the minute with a five-minute minimum, so a short job is not charged a full block.

OpenAI's pricing page Tools table, with the Containers row reading "Hosted Shell and Code Interpreter — 1 GB $0.03, 4 GB $0.12, 16 GB $0.48, 64 GB $1.92 per 20-minute session per container".
OpenAI's API pricing page, checked September 2026.

Anthropic meters differently. Claude Managed Agents is billed on two dimensions: tokens and session runtime. Session runtime is $0.08 per session-hour, and the detail that matters is how it is counted. Runtime is measured to the millisecond and accrues only while the session's status is running. Time spent idle — waiting on your next message or a tool confirmation — does not count. There is also no separate container-hour bill on top; session runtime replaces it.

Anthropic's pricing page showing the Session runtime table — SKU "Session runtime", rate "$0.08 per session-hour", metering "running status duration" — above the note that runtime accrues only while the session status is running, and that idle, rescheduling and terminated time does not count.
Anthropic's Claude Platform pricing page, checked September 2026.

Side by side, for one hour of work at the smallest sandbox size, before tokens:

Cost lineOpenAI Agents APIClaude Managed Agents
Fee for the API itselfNone stated on the launch postFolded into the $0.08 session-hour rate
Harness and sandbox, one hour$0.09 at 1 GB, billed as three 20-minute sessions at $0.03$0.08 for one session-hour of running time
Idle time while it waits on youBilled by the minute, 5-minute minimum per sessionNot billed; the clock stops when status leaves running
TokensBilled at the selected model's standard API ratesBilled at standard model rates, with prompt caching multipliers applying identically
Published worked exampleNone on the pricing page1-hour Claude Opus 5 session, 50,000 input and 15,000 output tokens: $0.25 input, $0.375 output, $0.08 runtime

That last row is the honest shape of the whole thing. In Anthropic's own worked example the harness is $0.08 of a bill where the tokens are $0.625. One vendor prices the box per twenty minutes, the other prices running time per hour, and the difference between them is rounding compared with what the model reads and writes. The harness is the cheap part now. That is the entire shift — it was the expensive part when a team had to build it.

Is this the same as the old Assistants API?

No, and the difference is the point. The Assistants API was OpenAI's first hosted agent layer, and it stored your conversation threads and files on OpenAI's side. It was shut down on 26 August 2026, with a migration guide pointing developers to the Responses and Conversations APIs. The Agents API launched about two weeks later.

The old one stored the chat. This one runs the work — the sandbox, the loop, the recovery. That is a real difference in what you are renting. But the lesson from the first attempt still stands, and it belongs in the decision: a hosted layer can be retired, and when it is, you rewrite. OpenAI's deprecations page is a public record of how often that happens. That risk is the actual cost of not building the harness yourself, and it is worth weighing against the months you save by not building it.

Three ascending blocks headed "Pick the rung, not the brand" — 1, plain model call, minutes, no files; 2, Agents SDK, your app, your storage; 3, managed harness, hours, files, code — with a band across the third block reading "No Zero Data Retention".

Plain call, Agents SDK, or managed harness?

Three questions decide it, and the third one can end the conversation. OpenAI publishes the three options on one page: the Agents API runs an agent with the Codex harness managed by OpenAI, the Agents SDK lets you control the agent loop inside your own application, and the Responses API works directly with model responses. Same ladder applies whichever vendor you prefer.

Question one: does the job run longer than a few minutes, or need files and code?

If not, you do not need an agents API at all. A plain call to the model does it, and everything below this line is cost and complexity you would be buying for nothing. Most tasks that feel like they need an agent are a single well-written prompt plus a script.

Question two: do you need to control every step of the loop?

If yes, use the toolkit rather than the rented harness. OpenAI's Agents SDK runs inside your own application, which means you keep deployment, storage and the approval flow. Anthropic's equivalent route is the Messages API, which its documentation recommends for custom agent loops and fine-grained control. You write more code and you own more of the outcome.

Question three: can this data sit on the vendor's servers?

If not, stop here — neither managed harness fits today. OpenAI's documentation states that the Agents API supports data residency only in the United States and does not support Zero Data Retention, and that choosing a self-hosted sandbox does not make it ZDR-eligible. Anthropic's documentation says Managed Agents is not currently eligible for Zero Data Retention or for HIPAA Business Associate Agreement coverage.

Zero Data Retention is the setting where the vendor keeps nothing once the job is done. Notice why both vendors land in the same place: the session that makes the harness useful is the exact reason it cannot forget. Durable state is the feature. Durable state is also the disqualifier. That is not a gap either company is likely to close by accident.

A warning callout in OpenAI's Agents API documentation stating that the Agents API retains session state, currently supports data residency only in the United States, does not support Zero Data Retention, and that choosing a self-hosted sandbox does not make the Agents API ZDR-eligible.
OpenAI's Agents API documentation, checked September 2026.

Three mistakes people make with a rented harness

  • Expecting it to improve the answers. It will not. The same model makes the same judgment calls on the same task. The harness stops a long job falling over; it does not raise the quality of any single step. Teams that buy it to fix accuracy end up paying for infrastructure and still holding the original problem.
  • Skipping the question of what the agent may touch. The harness hands the model files, a shell and network access. Which files, which tools, and which actions wait for a human to approve is still your decision, and both vendors put permissions and approval flows in your hands rather than defaulting them safely.
  • Trusting the launch numbers. OpenAI's launch page quotes a customer saying they "reduced failed agent responses by 86%." That is a real quote from a real company on a page OpenAI wrote — not an independent test, and not a measurement of your workload. Run your own task before believing anyone's percentage, this site's included.

The third one generalises. Every AI tool launch ships with a customer percentage, and none of them were measured on your data. ISL applies the same rule to tools it recommends — the Motion and Reclaim comparison is built the same way, on what the pages actually say rather than on the launch copy.

Get One Buildable System Every Week

Want a steady way to keep moving? ISL Weekly is the free Income Stack Lab newsletter. Each issue gives you one AI system you can build, plus the tools that make it work. Short, clear steps. No tech overwhelm.

Frequently asked questions

What is an agents API in simple terms?

It is a rented harness for an AI model. The harness runs the loop that calls the model, gives it a sandbox to open files and run code, trims the conversation when it gets long, and resumes the job if a step fails. You send a task and receive progress and results. The model is the same model you would call directly.

Is an agents API the same thing as an agent framework?

No. A framework is code you install and run yourself, so you own the deployment, the storage and the failure handling. An agents API is that layer hosted by the vendor and billed by the hour or by the container session. OpenAI ships both — the Agents SDK runs in your application, the Agents API runs on theirs.

Does the OpenAI Agents API support Zero Data Retention?

No. OpenAI's documentation states the Agents API supports data residency only in the United States and does not support Zero Data Retention, and that choosing a self-hosted sandbox does not make it ZDR-eligible. Anthropic states that Claude Managed Agents is not currently eligible for Zero Data Retention or HIPAA Business Associate Agreement coverage either.

What does it cost to run an agent session for one hour?

On Anthropic's published rate, session runtime is $0.08 per session-hour and only running time counts. On OpenAI's published container rates, a 1 GB sandbox is $0.03 per 20-minute session, so an hour is $0.09. Tokens are billed separately at each model's normal rates in both cases, and in Anthropic's own worked example the tokens are roughly eight times the runtime charge.

Is the Agents API a replacement for the Assistants API?

It is the successor in spirit but not a drop-in replacement. The Assistants API was shut down on 26 August 2026, and OpenAI's migration guide points to the Responses and Conversations APIs. The Agents API launched separately on 10 September 2026 and does a different job: the old one stored conversation threads and files, this one runs the work in a sandbox.

Do you need an agents API to build an AI agent?

No. If the job finishes in a couple of minutes and needs no files or code, a plain model call does it. If you need control over every step of the loop, an SDK running inside your own application does it and keeps the storage on your side. The managed harness earns its cost on long-running jobs with files, tools and a real chance of failing partway.

Is this worth it?

For a long job with files, tools and a real failure rate, yes — the months of harness work this removes are real, and both vendors price the harness at cents per hour. For anything that finishes in a few minutes, it is complexity you are paying to carry. The limitation that actually decides it is not price: neither vendor offers Zero Data Retention today, and Anthropic rules out a HIPAA agreement on top, which takes regulated data off the table entirely. And a hosted layer is a layer someone else can retire, as the Assistants API shutdown showed thirteen months after the notice. Budget for a rewrite you do not control. If that trade sounds acceptable, the harness is no longer the hard part of building an agent — and that is genuinely new this year.

Keep Building With the Lab

📂 Grab the free tools. The ISL Resource Vault holds every free guide, checklist and template from the lab. Pick one and start today.

🎯 Get one system a week. Subscribe to ISL Weekly: one buildable AI system in your inbox every week. No spam. Unsubscribe any time.

Want more? Here is where to find us:

Subscribe to Income Stack Lab on YouTube for new videos every week on AI tools, automation builds and honest tool tests. Follow along on X, Instagram, TikTok, LinkedIn and Facebook for quick tips and a look inside the lab.

☕ Enjoying the content? Buy me a coffee— fuel the lab, keep the ideas flowing.

Your future self will thank you for starting today.

Happy Stacking!