Cross-platform decision guide · kept current
Where to run your Claude agent: API vs Bedrock vs Cloudflare
It's rarely a price decision — Claude's per-token cost is the same on the Anthropic API and on AWS Bedrock's global endpoints — and 10% higher on either platform once you pin inference to a named geography for data residency. It's a decision about where you want the abstraction boundary to sit: do you want Anthropic to manage the agent runtime, do you want it inside your own AWS account next to your IAM and CloudWatch, or do you want it at the edge close to users?
Rough rule: Anthropic API / Managed Agents for the fastest path and newest features; Bedrock when you're already on AWS and want consolidated IAM/billing/governance; Cloudflare for low-latency, globally distributed, edge-native workloads. Details and current pricing below.
The decision in one table
| Option | Choose it when | Cost shape | Watch out for |
|---|---|---|---|
| Anthropic API / Claude Managed Agents | You want the simplest path, the newest models first, and Anthropic to own the agent harness/session lifecycle | Standard Claude token rates; Managed Agents add ~$0.08 per active session-hour | Less native integration with your existing cloud IAM/observability |
| AWS Bedrock / AgentCore | You already run on AWS (IAM, VPC, CloudWatch, consolidated billing) and want governance in one place | Same Claude token rates as the direct API on global endpoints; regional endpoints and geo inference profiles add 10%. AgentCore Runtime bills for active consumption per second, I/O wait free if no other background process is running (~$0.0895/vCPU-hour + ~$0.00945/GB-hour); other AgentCore services priced separately | New Claude models/features tend to land on the direct API first, with Bedrock catching up within weeks |
| Cloudflare Workers AI | You need global edge inference, low latency for user-facing apps, and data-residency by default | Its own model catalogue, billed in Neurons ($0.011 per 1,000) and published per model as roughly $0.017–$1.40 / 1M input tokens depending on model | A different model catalogue than first-party Claude; use the AI Gateway to route to Claude where needed |
Prices change. Each figure carries its own verification date in Sources & provenance below — re-check against each provider's pricing page before you rely on them.
Claude API vs Bedrock: which should you pick?
Pick the Anthropic API for the fastest path and the newest models first; pick AWS Bedrock when you already run on AWS and want Claude inside your existing IAM, VPC, CloudWatch, and consolidated billing. Claude's per-token price is the same on both when you call Bedrock's global endpoints — Bedrock's regional endpoints add a 10% premium, as does pinning the first-party API to a geography — so the decision is usually governance and operational fit, not cost. New models and features usually land on the direct API first and reach Bedrock within weeks — if being first matters, that favors the API; if single-pane AWS governance matters more, that favors Bedrock.
Two recent additions worth knowing (June 2026)
AWS Lambda MicroVMs. If you run on AWS, this gives each agent session its own Firecracker-isolated micro-VM — snapshot-based fast resume with state preserved across a session — purpose-built to run untrusted or model-generated code. AWS documents it explicitly as a sandbox for Claude Managed Agents: Anthropic still hosts the agent loop and the model, and the MicroVM is where the agent's bash/file tool calls actually execute. It's the cleanest answer to "where do my agent's tools run" when you want hard per-session isolation inside your own AWS account.
Claude in Microsoft Foundry. Claude is now also reachable through Microsoft Foundry on Azure — Azure-native endpoints and billing, with inference still running on Anthropic's own infrastructure. It is in public preview. This sits outside the AWS + Cloudflare scope this guide compares; it's noted here only so the picture is complete.
Claude Platform on AWS. A third way to reach Claude from an AWS account, distinct from Bedrock: Claude Platform on AWS has Anthropic — not AWS — operate the inference stack, while AWS handles authentication (SigV4 or API key), IAM-based access control, and billing through AWS Marketplace. Because Anthropic runs it, it carries the full platform surface (Agent Skills, code execution, beta features) with typically same-day feature access, closing the weeks-long lag Bedrock usually has behind the direct API. The tradeoff: inference may route outside AWS, so it doesn't fit if data residency inside AWS is a hard requirement — Bedrock keeps inference in-account.
Agent runtimes compared: Cloudflare vs AWS AgentCore
The tables above answer "whose token bill, whose IAM." The other half of the decision is where the agent process actually runs and keeps its state between turns — the runtime. Two managed answers dominate once you've left a plain request/response Lambda behind: Cloudflare's Durable Objects + Agents SDK at the edge, and AWS Bedrock AgentCore Runtime inside your account. They make opposite bets about locality and session length.
On Cloudflare, each agent is a Durable Object — a single-threaded, globally-unique instance with its own transactional SQL storage. The Agents SDK builds on that to give every agent persistent state and WebSocket connections, and WebSocket Hibernation lets an idle agent evict from memory between turns while its connections stay open — so you don't pay duration charges for the wait. (In-memory state is discarded on hibernation; persisted state survives, which is the whole point of the SQL store.) AgentCore Runtime is the opposite shape: a managed, serverless, framework- and model-agnostic runtime that isolates each session in its own microVM, supports sessions up to 8 hours, and bills active consumption per second — AWS's condition is that I/O wait and idle time are free if no other background process is running, so a session that's mostly waiting on a tool or the model costs little — read the condition before you assume an idle session is free. That 8-hour ceiling belongs to the default microVM path. Since runtime instances went GA on 6 Aug 2026 you can instead attach an agent to an EC2 capacity provider and hold a session for up to 14 days — AgentCore still handles provisioning and patching, but you are charged a management fee on top of your EC2 costs — 12% of the On-Demand rate, or 7.8% for G-series families including Graviton-based gr6 — so it is the not-serverless half of the runtime.
| Dimension | Cloudflare Workers AI + Durable Objects | AWS Bedrock AgentCore Runtime |
|---|---|---|
| State model | Per-agent Durable Object: single-threaded, transactional SQL storage; WebSocket Hibernation keeps connections while evicting memory between turns. Agents SDK manages the persisted state for you. | Default path is a managed serverless runtime; per-session microVM isolation, sessions up to 8h. Runtime instances (GA Aug 2026) swap that for your own EC2 capacity: sessions up to 14 days, billed EC2 plus a 12% management fee (7.8% for G-series). Session state is ephemeral — durable cross-session memory is a separate service (AgentCore Memory). |
| Billing model | Requests + duration (GB-s); idle/hibernating objects accrue no duration charge. Qualitative shape — verify per-unit rates on the pricing page. | Active consumption per second (~$0.0895/vCPU-hour + ~$0.00945/GB-hour); CPU not billed during I/O wait if no other background process is running; memory billed on peak while the session is held. |
| Latency & locality | Runs at the edge across Cloudflare's global network, close to users; data residency by default. | Runs regionally inside your AWS account, next to your IAM, VPC, and CloudWatch. |
| Ecosystem fit | Cloudflare-native (Workers, R2, KV, Vectorize). Claude is not in the Workers AI catalogue — route to it through the AI Gateway to Anthropic. | AWS-native and composable with AgentCore Memory, Gateway, Identity, and built-in Tools (Code Interpreter, Browser); framework- and model-agnostic. |
| Best when | Low-latency, globally distributed, many small per-user agents that idle between bursts. | AWS-native estates and longer, compute-heavy sessions that want governance and durable memory in one place. |
Token price is rarely the variable
Because Claude's per-token pricing is the same on the Anthropic API and on Bedrock's global endpoints, the platform choice rarely turns on the model bill. The one case where it does is data residency, and it is a wash: Bedrock's regional endpoints, which resolve to the single AWS region you name, carry a 10% premium over global, and so do its geo inference profiles (US, EU, JP, AU) — while Anthropic's own API applies the same 1.1x multiplier when you pin inference_geo: "us" on Claude 4.6 and later. Pinning a geography costs 10% wherever you run, so it is not a reason to prefer one platform. Otherwise the choice turns on operational fit: where your identity, secrets, networking, logging, and billing already live, and how much of the agent runtime you want to operate yourself versus hand to the provider. That framing — the abstraction boundary — is the spine of the decision.
A note on lock-in
The cleanest hedge is to keep the agent logic and tool layer portable and put a routing layer (such as an AI Gateway) between your code and the provider, so switching where inference runs is a config change, not a rewrite. That's also good cost-observability hygiene. Don't over-engineer it before you have a reason to switch — but design the boundary so you can. Which layers you are actually placing when you pick a runtime — orchestration, memory, tools, retrieval, the operational plane — is laid out in agentic AI architecture, including the same three platforms mapped layer by layer.
Frequently asked
Is Claude cheaper on Bedrock or on the Anthropic API?
The same, on the default path. Bedrock's global endpoint carries no premium and its published Claude rates match the first-party API; the first-party API is global by default. The 10% shows up on both sides only when you pin a geography: from Sonnet 4.5, Haiku 4.5 and Opus 4.5 onward, Bedrock's regional endpoints and its geo inference profiles (US, EU, JP, AU) cost 10% more than global, and Anthropic's own API applies the same 1.1x multiplier for inference_geo: "us" on Claude 4.6 and later. Data residency costs 10% wherever you run it. Choose on operational fit (where your IAM/observability/billing live and how new you need the model versions), not on token price.
What do Claude Managed Agents cost on top of tokens?
Roughly $0.08 per active session-hour in addition to normal token rates — you pay for the time the managed agent runtime is running. Verify on Anthropic's current pricing page.
Can I run the same Claude model on Cloudflare?
Cloudflare Workers AI has its own model catalogue. To use Claude specifically at the edge, route through the Cloudflare AI Gateway to Anthropic — you get edge proximity plus first-party Claude, with caching and cost observability in the gateway.
Cloudflare or AWS AgentCore for running an agent?
It's a runtime-shape choice, not a price one. Cloudflare's Durable Objects + Agents SDK put a stateful per-agent instance at the edge with hibernation between turns — good for low-latency, globally distributed, many-small-agent workloads. AWS Bedrock AgentCore Runtime is a managed serverless runtime that isolates each session in its own microVM, runs sessions up to 8 hours, and bills active consumption per second (I/O wait free, on AWS's condition that no other background process is running) — good for AWS-native estates and longer, compute-heavy sessions. If 8 hours isn't enough, its runtime instances option runs the agent on your own EC2 capacity for sessions up to 14 days, at EC2 cost plus a 12% management fee on the On-Demand rate (7.8% for G-series). Both reach Claude at the same token price on Bedrock global endpoints; regional endpoints carry a 10% premium.
Which should I learn first?
Learn the portable layer first — the agentic loop, tools, and evals — because it transfers across all three. Then learn the deployment specifics of whichever platform your target employers use. The integrated path teaches all three deliberately.
- Anthropic — Claude API pricing; Managed Agents add ~$0.08/active session-hour (public beta since Apr 2026).
- AWS — Amazon Bedrock AgentCore pricing (Runtime $0.0895/vCPU-hour + $0.00945/GB-hour, active-consumption billing) and Bedrock model pricing. Anthropic — Claude API pricing: "Bedrock offers two endpoint types: global endpoints (dynamic routing for maximum availability) and regional endpoints (guaranteed data routing through specific geographic regions)," and "Regional and multi-region endpoints include a 10% premium over global endpoints. The Claude API (first-party) is global by default." Anthropic scopes that structure to Claude Sonnet 4.5, Haiku 4.5, Opus 4.5 and all future models; Opus 4.1 and earlier retain their existing pricing. Note that "multi-region endpoint" is a Google Cloud endpoint type, not a Bedrock one — Anthropic's Claude in Amazon Bedrock page gives Bedrock's two: "Global: … No pricing premium" and "Regional: … Regional endpoints carry a 10% pricing premium over global endpoints. To route across multiple regions within a geography, use an inference profile (US, EU, JP, or AU)." On the first-party side the same 10% appears as a parameter, not an endpoint: "For Claude 4.6 and later models, using
inference_geo: "us"applies a 1.1x pricing multiplier.inference_geo: "global"(default) uses standard pricing." - Cloudflare — Workers AI pricing — billed in Neurons at "$0.011 per 1,000 Neurons", with a published per-1M-token equivalent per model. Across the text-generation catalogue that runs from $0.017 / 1M input tokens (
@cf/ibm-granite/granite-4.0-h-micro, $0.112 output) to $1.40 / 1M input (@cf/zai-org/glm-5.2). Abstraction-boundary framing also draws on cross-platform comparisons (DEV.to AWS Builders, CloudZero, Anchor Sprint, 2026). - AWS — Lambda MicroVMs (announced 22 Jun 2026) and the MicroVMs sandbox for Claude Managed Agents integration guide.
- Anthropic — Claude in Microsoft Foundry (Azure deployment target, public preview) and Claude Platform on AWS (Anthropic-operated inference, AWS Marketplace billing/IAM).
- Runtime comparison — Cloudflare Durable Objects, WebSocket Hibernation, and the Agents SDK (per-agent state, hibernation, no duration charge while idle); AWS Bedrock AgentCore Runtime (default path: managed serverless, per-session microVM, sessions up to 8h) and AgentCore pricing (active consumption per second; I/O wait free on the condition quoted below). AWS — AgentCore runtime instances GA (6 Aug 2026): EC2 capacity providers, sessions up to 14 days, charged for compute management in addition to EC2 costs. The AgentCore pricing page publishes the figures: "Runtime instances bill the underlying EC2 instance for the session duration plus a 12% management fee", with "G-series families (including Graviton-based gr6) carry a reduced management fee of 7.8%", and scopes the active-consumption benefit as "I/O wait and idle time is free, if no other background process is running".
The Anthropic, AgentCore Runtime, and Managed Agents figures were verified against the providers' own pricing pages on 10 Aug 2026 (first checked 16 Jun 2026, re-verified exact); the Cloudflare Workers AI per-model token rates were verified against Cloudflare's pricing page, and the global-versus-regional 10% premium against Anthropic's pricing, Amazon Bedrock, and data-residency docs, on 10 Aug 2026; the Lambda MicroVMs and Microsoft Foundry facts were verified against AWS and Anthropic docs on 25 Jun 2026; the Cloudflare Durable Objects / Agents SDK and AWS AgentCore Runtime capabilities were verified against the providers' docs on 26 Jun 2026; the Claude Platform on AWS facts were verified against Anthropic's docs on 15 Jul 2026; the AgentCore runtime-instances facts were verified against the AWS announcement on 10 Aug 2026; and the management-fee percentages and the I/O-wait condition were verified against the AgentCore pricing page on 11 Aug 2026. Pricing is volatile — re-check the provider pages before relying on these. Corrections: hello@aiarch.dev.
Learn to deploy on all three — and justify the choice.
aiArch teaches the Anthropic, AWS, and Cloudflare deployment surfaces as one cross-platform architect competency — including the cost-modeling and routing that actually move the bill.
See how aiArch helps senior engineers become AI-native, or compare Professional Membership pricing.
Free sample — no signup · every claim cited · full curriculum with membership
Subscribe to the Brief — free. This is the newsletter, not the membership — see membership here →