AI Transformation30 Nov 20268 min read

Messages API, Claude Agent SDK or Claude Managed Agents: which should you build on?

How the Claude Messages API, Claude Agent SDK and Claude Managed Agents differ in what you run, what drives cost and how you govern them, with one example of each.

Claude AI agents for UK businesses, by SpotDev

A business that moves from trying Claude to building with it soon reaches a decision about how to build. Anthropic offers three ways to build an agent, and they differ in how much of the machinery you run yourself. Anthropic's own summary is that the Messages API gives you "the most control", the Claude Agent SDK "sits in between", and with Claude Managed Agents "you offload the most". That is a useful starting point. What it leaves out is what each choice means for your team, your costs and your governance once the agent is doing real work.

This post sets that out, with one example of each. Facts were checked against Anthropic's documentation on 30 Nov 2026. Product details change often, so check them again before you commit.

The short version

Messages API Claude Agent SDK Claude Managed Agents
What you run Everything: the agent loop, your tools, your servers A process you operate, with Anthropic's agent loop and built-in tools inside it Your application. Anthropic hosts the agent loop, tool execution and runtime
Main cost drivers Tokens per request and your choice of model; prompt caching and the Batch API can cut that Tokens, plus the hosting you already pay for Tokens plus session runtime while the agent is running
Status (30 Nov 2026) Core Claude API Not marked as beta on its overview page In beta
Zero data retention Can be arranged (Legacy ZDR or Enterprise Frontier Safeguards, for eligible organisations) Not stated on the Agent SDK overview; confirm with Anthropic for your account Not eligible, except self-hosted Managed Agents
Suits A defined step inside a system you already run An agent that works on files and runs commands in your own environment Long-running or scheduled work you do not want to host

The Messages API: you build the agent

With the Messages API you send Claude a request and get a response. If you want an agent, your code decides what happens next: which tool to call, what to pass back and when to stop. Your engineers write that loop and run the tools and infrastructure around it.

What the client runs: all of it. The code lives in your systems, deploys with the rest of your software and is monitored the same way.

Cost drivers: tokens in and out, and which model you choose. Anthropic's pricing page lists prompt caching for repeated context, and a 50 percent discount on input and output tokens for work sent through the Batch API, which suits jobs that do not need an instant answer.

Governance: you get the most control over what the agent can touch, because you wrote every tool it can call. This is also the route where zero data retention is available: Legacy ZDR by arrangement with Anthropic, or Enterprise Frontier Safeguards, which is in beta for eligible organisations and covers Messages API requests in a workspace set up for it. We explain the difference in our post on whether Claude is safe for business.

Example: classifying and routing support tickets inside a helpdesk you already run. Each ticket is one request, the categories are yours, and the result goes back into your existing queue. Anthropic's ticket routing guide covers how to define the categories and measure accuracy before you rely on it.

The Claude Agent SDK: Anthropic's agent loop, in your process

The Agent SDK is a library for Python and TypeScript. It gives your application the same tools, agent loop and context management that power Claude Code. The agent can read and edit files, run commands and search the web, inside a process that you operate.

What the client runs: the process and the environment it runs in. You do not write the agent loop, but you decide where it runs and what it can reach.

Cost drivers: model usage through your Claude API key, plus whatever hosting you run it on. Anthropic's documentation says the SDK authenticates with an API key, and says that third-party products built on it should not offer claude.ai login unless Anthropic has approved it.

Governance: the SDK includes permissions that control which tools run automatically and which need approval, plus hooks that run your own code at set points in the agent's work, so checks and logging can be built in. Use is governed by Anthropic's Commercial Terms of Service, including when the agent powers a product for your own customers.

Example: a month-end reconciliation agent in your own environment. It reads exports from two systems, runs the checks your finance team already uses and drafts an exceptions report for a person to approve. Nothing posts to the ledger without that approval.

Claude Managed Agents: Anthropic runs the agent for you

With Managed Agents you define the agent (model, instructions, tools, connections and skills) and an environment, then start sessions. Anthropic runs the loop, the tools and the runtime, in an Anthropic-managed cloud sandbox or in a sandbox you host yourself. Anthropic describes it as suited to "long-running tasks and asynchronous work".

What the client runs: your application and its configuration, not the agent's infrastructure.

Cost drivers: tokens at the normal model rates, plus session runtime. Anthropic's pricing page, checked 30 Nov 2026, lists runtime at $0.08 USD per session-hour, counted only while a session is running, not while it is idle. The Batch API discount does not apply to Managed Agents sessions.

Governance: Managed Agents is in beta. Sessions are stateful, and transcripts persist until you delete them. Anthropic says Managed Agents is not eligible for zero data retention, except self-hosted Managed Agents. If your data rules require zero data retention, that settles the choice before cost does.

Example: a scheduled weekday briefing that reads a team's Slack channels and GitHub pull requests and posts one short summary. Anthropic publishes this pattern as a "daily brief" example in its open-source Claude quickstarts repository, which is released under the MIT licence. It is Anthropic's example, a useful reference for how a scheduled agent should report a source it could not read, rather than staying quiet.

How we would choose

We start from three questions, in this order.

  1. What must not leave your control? If zero data retention is a requirement, Managed Agents in Anthropic's cloud is out, and the Messages API with the right retention arrangement is the natural fit.
  2. Who will operate it in a year? If your team already runs services, the Messages API or the Agent SDK keeps everything in your stack. If nobody wants to run agent infrastructure, Managed Agents removes that work, at the cost of beta status and session-based billing.
  3. How much freedom does the agent need? A single, well-defined step, such as routing or extraction, rarely needs an agent framework. An agent that has to work through files and commands benefits from the Agent SDK's built-in tools and permissions.

Some projects use more than one path: a Messages API step inside an existing system, and a separate agent for longer work. The right answer depends on the job, the data, the controls and what you already run.

If you want help choosing a path for a specific process, see our Claude implementation services.

FAQs

What is the difference between the Messages API and Claude Managed Agents?

With the Messages API you write and host the agent loop and its tools. With Claude Managed Agents, Anthropic hosts the loop, tool execution and runtime, and you configure the agent and start sessions. Managed Agents was in beta when we checked on 30 Nov 2026.

Is Claude Managed Agents eligible for zero data retention?

Not in Anthropic's cloud. Anthropic's documentation, checked 30 Nov 2026, says Managed Agents is not eligible for zero data retention, except self-hosted Managed Agents.

How is Claude Managed Agents billed?

On tokens at the normal model rates, plus session runtime, which Anthropic listed at $0.08 USD per session-hour while a session is running (checked 30 Nov 2026).

Is the Claude Agent SDK the same as Claude Code?

No. It is a library for Python and TypeScript that gives your own application the tools, agent loop and context management that power Claude Code, running in a process you operate.

Written by

John Kelleher

John is the founder and the Chief Executive at SpotDev.