For engineers and architects sizing an AI build
What a Claude agent actually costs (and how to estimate yours)
The per-token price is the same on the Anthropic API and on AWS Bedrock's global endpoints — so the platform you pick is not the cost decision. Pinning a geography costs 10% on either side: Bedrock's regional endpoints and its geo inference profiles carry a 10% premium over global, and Anthropic's own API applies the same 1.1x multiplier for inference_geo: "us". The real driver is how a multi-turn agent works: it re-sends a growing context on every turn, so input tokens accumulate and dominate the bill.
Estimate from the loop, not the rate card. Count the input tokens you re-send across turns, add the output you generate, and apply the per-model rates. Then pull the three levers that actually move it: prompt caching, model routing, and a cap on turns.
The per-model price
Claude's token rates are identical on the Anthropic API and on AWS Bedrock's global endpoints. Rates below are per 1M tokens, input / output, verified 23 Jun 2026 (Opus 5 added 25 Jul 2026). From Sonnet 4.5, Haiku 4.5 and Opus 4.5 onward, Bedrock's regional endpoints — and the geo inference profiles (US, EU, JP, AU) that route across regions within a geography — bill 10% above these figures; earlier models keep their existing pricing. The first-party API is global by default and charges the same 1.1x when you pin inference_geo: "us" on Claude 4.6 and later, so data residency costs 10% wherever you run it.
| Model | Input ($/1M) | Output ($/1M) | Good for |
|---|---|---|---|
| Claude Haiku 4.5 | $1 | $5 | Cheap, high-volume sub-tasks: classification, extraction, routing |
| Claude Sonnet 5 | $3 | $15 | The everyday workhorse: most tool-use and reasoning at a balanced cost |
| Claude Opus 5 | $5 | $25 | The hardest reasoning and planning steps where quality justifies the rate (current default Opus tier) |
| Claude Opus 4.8 | $5 | $25 | Previous-generation Opus; still served at the same rate |
Sonnet 5's $3 / $15 is the standard rate. An introductory $2 / $10 per 1M runs through 31 Aug 2026, so a bill you price today lands below this table until that window closes — budget on the standard rate, and treat the intro rate as the discount it is. Prices change. These reflect public pricing verified 23 Jun 2026 (intro window re-checked 25 Jul 2026) and must be re-checked against Anthropic's pricing page before you rely on them.
Claude API pricing, in one place
For the Anthropic API, pricing is pure token cost — there is no platform fee, seat, or minimum. You pay the per-model input/output rates in the table above, and the same per-token rates apply on AWS Bedrock's global endpoints (10% more on a regional endpoint or a geo inference profile). Two things sit outside the everyday tiers: Fable 5 bills at $10 / $50 per 1M, and Opus "Fast mode" — available on both Opus 5 and Opus 4.8 — is a premium tier at $10 / $50 — don't conflate it with base Opus at $5 / $25.
What the rate card alone doesn't show is that the effective input rate moves with how you call the API. Prompt caching and the Batch API both rescale the input price:
| Pricing mode | Multiplier vs base input | When it applies |
|---|---|---|
| Cache write (5-min TTL) | 1.25x input | Paid once when you store a prefix in the short-lived cache |
| Cache write (1-hour TTL) | 2.0x input | Paid once for a longer-lived cache; higher write premium |
| Cache read (hit) | 0.1x input | Every later turn that reuses the cached prefix |
| Batch API | 0.5x input and output | Async, non-interactive jobs — 50% off both directions |
Claude Code pricing: subscription vs API
Claude Code has two distinct cost models, and which one you're on changes how you reason about cost. You can use it under a flat subscription (Claude Code is bundled into several Claude plans), or you can drive it against the API and pay metered token usage at the standard rate card above. Subscriptions cap cost predictably; API usage is pay-as-you-go.
| Plan | Price | Claude Code included? |
|---|---|---|
| Free | $0 | No |
| Pro | $20/mo ($17/mo billed annually) | Yes |
| Max 5x | from $100/mo | Yes |
| Max 20x | around $200/mo | Yes |
| Team Standard | $25/seat/mo ($20 annually) | No |
| Team Premium | $125/seat/mo ($100 annually) | Yes |
| Enterprise | Sales-quoted | Yes |
Team Standard is the one paid tier that excludes Claude Code; the Max 20x figure is third-party-reported, not confirmable verbatim on the official page. Verify on claude.com/pricing before relying on it.
The architect's read: for an individual developer, a subscription turns an unpredictable token bill into a fixed monthly number — usually the right call. But for programmatic or agent-style usage — Claude Code or any harness calling the API in a loop — you're back on metered tokens, and every lever in this article applies: cache the static prefix, route cheap steps to a smaller model, and cap turns.
Where the subscription stops being cheaper (the break-even)
The question every plan page dodges: at what monthly usage does metered API cost overtake the flat subscription? It's arithmetic, not opinion. Break-even is the plan's monthly price divided by your blended per-token rate:
break-even tokens/month ≈ plan price ÷ blended $ per 1M tokens
Your blended rate depends on your input:output mix. Take Sonnet 5 at its standard rate ($3 / $15 per 1M) at a 3:1 input:output ratio — typical for tool-use, where you send more context than you get back: blended = 0.75 × $3 + 0.25 × $15 = $6.00 per 1M tokens. At that rate:
| Plan | Monthly price | Break-even vs API (Sonnet, uncached, 3:1) |
|---|---|---|
| Pro | $20/mo | ~3.3M tokens/mo ($20 ÷ $6) |
| Max 5x | $100/mo | ~16.7M tokens/mo ($100 ÷ $6) |
| Max 20x | ~$200/mo | ~33M tokens/mo ($200 ÷ $6) |
Those figures use the standard rate. Through 31 Aug 2026 Sonnet 5's introductory $2 / $10 makes the same 3:1 blend 0.75 × $2 + 0.25 × $10 = $4.00 per 1M, which raises every break-even by 50%: ~5M tokens/mo for Pro, ~25M for Max 5x, ~50M for Max 20x. Price your budget on the $6.00 standard the window reverts to; use the $4.00 figure only for what you will actually be billed between now and then.
Read it as a floor, not a line: below your plan's break-even, the subscription is the cheaper path; above it, metered API wins — and the crossover only moves up from here. Prompt caching drops your effective input rate toward $0.30 per 1M (cache reads at 0.1×), and real agent workloads are more input-heavy than 3:1, both of which lower your blended rate and push break-even higher. Finout's independent estimate puts the Max 20x crossover nearer 70M tokens/month under cache-heavy assumptions. Plug your own numbers into the estimator below to find your line.
How to estimate a multi-turn agent
An agent is a loop. On each turn it sends the conversation so far — system prompt, prior messages, tool results — plus the new step, and gets back a model response. The catch is that the context grows: turn 5 re-sends almost everything from turns 1–4. So a 10-turn agent doesn't cost 10x a single call; the input side compounds.
The estimate, in words:
total cost ≈ (sum of input tokens sent across all turns × input rate) + (sum of output tokens generated across all turns × output rate)
Because the same prefix rides along on every turn, the first term usually dwarfs the second. That is why input tokens, not output, are where you look first.
Caching and routing both reduce this materially — see the levers below — but the starting point is always: measure the tokens your loop actually sends, then apply the rates.
Rather than do the arithmetic by hand, size it here. This is the same cost model the coach on this site uses — compounding transcript, cached-prefix reads at 0.1×, the one-time 1.25× write — not a naive tokens × rate:
What each platform adds on top of tokens
Anthropic API / Claude Managed Agents
Raw API calls are just token cost. Claude Managed Agents add roughly $0.08 per active session-hour on top of token costs — you pay for the time the managed runtime is running, in addition to the tokens it consumes.
AWS Bedrock / AgentCore
Token rates match the direct API on Bedrock's global endpoints; a regional endpoint or a geo inference profile adds 10%. AgentCore Runtime bills for active consumption per second — I/O wait is free, if no other background process is running — at roughly $0.0895 per vCPU-hour + $0.00945 per GB-hour. Other AgentCore services (memory, gateway, tools) are priced separately.
Cloudflare Workers AI
Cloudflare runs its own model catalogue with its own metering, spanning $0.017–$1.40 per 1M input tokens depending on the model — the floor is @cf/ibm-granite/granite-4.0-h-micro, the ceiling @cf/zai-org/glm-5.2. Everything is billed in Neurons at $0.011 per 1,000, so a per-model rate is that model's neuron count times the unit price; the granite figure is 1,542 neurons per 1M input tokens. To run 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.
The three levers that actually move the bill
1. Prompt caching — cache the static prefix
The system prompt, tool definitions, and any fixed context are the same on every turn. Cache them. Cache reads bill at ~0.1x the input rate, and a cache write costs ~1.25x the input rate once. For a multi-turn loop that re-sends a large static prefix, this is the single biggest lever: you pay the write premium once and read at a tenth of the rate thereafter.
2. Model routing — Opus → Sonnet → Haiku
Not every step needs the strongest model. Route the hard planning/reasoning steps to Opus, the everyday tool-use to Sonnet, and the cheap, high-volume sub-tasks (classification, extraction) to Haiku. Given the 5x spread between Haiku and Opus, pushing sub-tasks down a tier compounds quickly.
3. Turn and tool-call caps
An agent with no ceiling can loop. Cap the number of turns and tool calls, and set explicit done-conditions, so a stuck agent stops instead of billing indefinitely. This is a correctness control as much as a cost one.
As-built: the per-role router and rate table that run this site
The coach on this site is one of these agents, and its cost accounting is live code, not a spreadsheet. src/lib/llm.ts's modelFor() routes by role via a plain switch: hint → Haiku 4.5, tutor/grader → Sonnet 5, and safeguard — the coach's input-injection judge — to the open-weight gpt-oss-safeguard-20b rather than an Anthropic tier. A fifth role, eval (Claude Opus 5), is declared and reserved for capstone evaluation but has no live call site yet. src/lib/cost.ts carries the exact rates in the table above ($1/$5, $3/$15, $5/$25 per MTok) and computes real per-turn USD from the usage the API returns — cache reads at 0.1x, cache writes at 1.25x, output at the full rate — so "this conversation cost $X" is a number we actually surface, not an estimate.
The turn-cap lever is enforced, not aspirational: the coach loop (runCoachLoop, src/lib/coach.ts) hard-caps at six model turns and eight tool calls. That number came from watching real coach sessions, not a formula — we'd rather ship a conservative cap and loosen it with data than discover a runaway loop in production. On the routing side, we deliberately kept it a static switch rather than a trained router: our roles are known at the call site, so there's nothing a classifier would add except latency.
The worst per-turn bill we ever paid bought zero output tokens. In July 2026 our coach intermittently returned an empty reply while still logging cost. The gateway logs showed the failing turn's final Sonnet 5 call sitting at exactly 1024 output tokens — the max_tokens default — with a streamed body full of reasoning blobs and no content at all: finish_reason: length, no visible text, no error, full charge. The cause was a change on the serving side rather than in our code: our OpenRouter route to anthropic/claude-sonnet-5 had begun being served via Amazon Bedrock, extended thinking was on for those calls, and reasoning tokens count against max_tokens. A hard-thinking turn spent the entire output budget before producing a first visible character. Stating this precisely matters, so: that is what we observed on that route in that window, not a standing claim about how any provider defaults today — AWS documents extended thinking as an explicit opt-in, and current models expose an adaptive setting. Verify your own route rather than inheriting our conclusion.
Three things are worth carrying out of it. First, a reasoning budget shares the output budget: if you are cost-modelling a thinking-enabled agent, max_tokens is no longer a ceiling on the answer, it is a ceiling on thinking-plus-answer, and the failure mode at the boundary is paying in full for nothing. Second, the same model slug can be served by a different backend with different defaults, so a router that pins a slug has not pinned behaviour — provider routing is a cost variable, not just a reliability one. Do not file it as a quirk of the backend you happened to catch it on, either: we widened our own guard to every Anthropic route in July 2026 after a pre-release check found the first-party API documents a high reasoning effort by default too. A mitigation scoped to the provider you first observed is a mitigation that gets deleted the next time routing changes. Third, make the failure loud: our loop (runCoachLoop in src/lib/coach.ts) now yields an in-band "ran out of reply budget" message on any text-less final turn, because the original symptom was a blank bubble that cost money and looked like nothing had happened. On the wire we send a request-level setting intended to suppress thinking on Anthropic slugs (buildChatBody, src/lib/llm.ts) — we list it here as a mitigation we ship, not as a verified fix, because confirming it does what we intend requires reading thinking-token counts back from a live billed call and we have not spent that yet.
- Anthropic — Claude API pricing and prompt-caching mechanics (platform.claude.com/docs pricing). Per-model rates and the ~0.1x read / ~1.25x write cache multipliers; Managed Agents add ~$0.08/active session-hour.
- AWS — Amazon Bedrock and Bedrock AgentCore pricing pages. AgentCore Runtime bills active consumption per second (~$0.0895/vCPU-hour + ~$0.00945/GB-hour), other services priced separately.
- Anthropic — Claude API pricing on the endpoint premium, verified 10 Aug 2026: "Regional and multi-region endpoints include a 10% premium over global endpoints. The Claude API (first-party) is global by default," scoped to "Claude Sonnet 4.5, Haiku 4.5, Opus 4.5, and all future models. Earlier models (Claude Opus 4.1 and prior releases) retain their existing pricing," and "For Claude 4.6 and later models, using
inference_geo: "us"applies a 1.1x pricing multiplier." The "multi-region endpoint" in that sentence is a Google Cloud endpoint type, not a Bedrock one — Claude in Amazon Bedrock 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)." - Cloudflare — Workers AI pricing. Its own per-model catalogue, $0.017–$1.40 / 1M input tokens; route to Claude via the AI Gateway. Verified 10 Aug 2026:
@cf/ibm-granite/granite-4.0-h-microis listed at "$0.017 per M input tokens" (1,542 neurons per M input tokens against "$0.011 per 1,000 Neurons" = $0.01696), and@cf/zai-org/glm-5.2at $1.400. Note@cf/google/gemma-4-26b-a4b-itat $0.100 is a real price but not the floor — several text-generation models are listed below it, granite lowest. - Anthropic — Claude plan pricing. Claude Code subscription tiers (Pro, Max, Team Premium, Enterprise) and which plans include it; verified 26 Jun 2026. The Max 20x ~$200/mo figure is third-party-reported.
- Finout — Claude Code pricing (2026). Independent subscription-vs-API break-even estimate cited above (~70M tokens/month for Max 20x under cache-heavy assumptions).
- Course material: aiArch — cost-modeling, prompt caching, model routing, and turn budgets.
Pricing changes, and these figures were not all checked on the same day — where a source line or a table note above carries its own verification date, that date is the one to trust rather than any single page-wide "as of"; anything without its own date was last verified 23 Jun 2026. Re-check the source pages before relying on them. Corrections: hello@aiarch.dev.
Learn to cost-model and route agents like an architect.
aiArch teaches cost-modeling, prompt caching, and model routing as first-class skills — across Anthropic, AWS, and Cloudflare, with the levers 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 is waitlist-only
Subscribe to the Brief — free. This is the newsletter, not the membership waitlist — request an invite here →