August 5, 20268 min read

Anthropic API cost tracking: workspaces, token types, and cache math

Claude bills five token types, and the cache math can flip which model is cheapest. Workspace attribution, the cost API, and where a tool earns its keep.

Anthropic API cost tracking looks like OpenAI's until you hit the cache. Then it stops looking like anything you've budgeted for before: Claude bills two kinds of cache write at two different premiums, bills cache reads at a tenth of the input rate, and — because of a tokenizer change in its newer models — counts more tokens for the same text than you'd expect. Get the cache math wrong and your model comparison inverts. This is the companion to our OpenAI cost post, for the provider where the token accounting is genuinely harder.

The good news: the shape of the work is the same. Split your org, pull the numbers, log the rest yourself. The one section that has no OpenAI equivalent is the cache, so that is the one we spend real numbers on.

Where Anthropic API cost tracking starts: the Console

The Anthropic Console has Cost and Usage reporting, and it is decent. You get daily spend by model and by workspace, with tokens broken into uncached input, cached input, cache creation, and output, plus a CSV export. For a single-workspace team, that is a real answer to "what are my Claude API costs this month."

Here is where it stops, and it stops in the same place OpenAI's does: the Console knows a key made a request against a model, not that your summarizer feature called it, or which customer triggered it, or that it was a retry. One Anthropic-specific wrinkle to plan around: the cost report is dollars but daily-granularity only, while the finer usage report is in tokens, not dollars — so anything below a day, or any per-token-type dollar figure, you compute yourself.

Workspaces: the attribution you get for free

Anthropic's answer to OpenAI projects is Workspaces. Split your organization into workspaces — up to 100 — each with its own API keys, its own usage and cost reporting, its own spend limit, and its own rate limits. Map them to the unit you will be asked to report on: one per product surface, one per environment, one per team.

Two rules, the same two as any provider:

  • Prod and non-prod never share a workspace — and give each its own spend limit. A workspace limit can only be set below the org limit, never above, so a staging load test that runs hot trips its own cap instead of eating into production's headroom.
  • Name workspaces for the answer, not the org chart. And do not run production out of the Default Workspace: it can't be deleted and can't take a spend limit, which is exactly the wrong pair of properties for the thing paying your biggest bill.

The ceiling is the same as OpenAI's too: a workspace is only as granular as its keys. One service serving six features through one key shows up as one blob. Going finer means logging it yourself — the last section — and Anthropic's response gives you an unusually good hook for it.

The cache math that changes which model is cheapest

OpenAI prices two things you meter: input and output. Anthropic prices four, because caching is explicit and comes in two durations. A cached prefix is written once at a premium, then read back cheap — and the write premium depends on how long you keep it warm.

Claude Sonnet 5 introductory rates, USD per 1M tokens · verify at anthropic.com/pricing (as of Aug 2026).
Token typeUSD / 1Mvs base input
Base input$2.001.0×
5-minute cache write$2.501.25×
1-hour cache write$4.002.0×
Cache read (hit)$0.200.1×
Output$10.00

Read the last two rows together. A cache read costs a tenth of base input — a 90% discount — but you pay 25% extra (5-minute) or 100% extra (1-hour) to write the prefix in the first place. Anthropic's own rule of thumb: the 5-minute cache pays for itself after a single read, the 1-hour cache after two. So a stable system prompt reused across a burst of calls is nearly free after the first request; a prompt cached and used once is pure overhead.

The numbers, on a real shape. Say a support assistant sends a 10,000-token system-plus-context prefix on every call, adds 200 tokens of fresh user input, and returns 400 output tokens — 1,000 times inside a five-minute window. Billed naively, that prefix is 10,000 × 1,000 = 10M input tokens at $2.00, or $20.40 counting the fresh input, plus $4.00 output: about $24.40. Cache the prefix and you write it once ($0.025), read it 999 times at the hit rate ($2.00 total), pay base rate only on the 200 fresh tokens each call ($0.40), and the same $4.00 output — about $6.43. The prefix alone dropped from roughly $20 to roughly $2, and the run got 74% cheaper.

Now the part that surprises people. Because a cache read bills at 0.1× that model's own input rate, the comparison you should run between two models is not their sticker input prices — it is their cached-read prices, plus a one-time write premium. Claude Opus 5 reads a cached prefix at $0.50 per 1M against Sonnet 5's $0.20; at a 95% cache-hit rate that gap, not the $5-vs-$2 headline, is what dominates your input bill. A pricier model with a heavily reused prefix can land closer to a cheaper one than the pricing page implies. Model your own hit rate before you pick on price.

One more input to the comparison: tokenization. Claude's newer-generation models — 4.7 and later, which includes Sonnet 5 and Opus 5 — use a tokenizer that produces roughly 30% more tokens for the same English text than the previous generation, and that inflation lands on the cached and uncached sides alike. It is not offset by any per-token price change, so it quietly raises the real cost of a Claude task versus what the per-million rate suggests. Compare cost per task on your own prompts, not price per million — the same lesson as our OpenAI-versus-Anthropic pricing breakdown, linked below.

Pull it yourself: the cost and usage APIs

The Console is a screen; a real cost pipeline reads the API. Anthropic exposes an Admin API — authenticated with a separate Admin key (sk-ant-admin01-…), not a normal one — with two endpoints worth wiring to a scheduled job:

  • The cost report (/v1/organizations/cost_report) returns dollars, daily, grouped by workspace. This is your ledger-grade number, the one that reconciles to the invoice.
  • The usage report (/v1/organizations/usage_report/messages) returns token counts in buckets down to the minute, grouped by model, workspace, API key, and service tier, with the token split into uncached input, cached input, cache creation, and output.

Below the workspace, the pattern is the one we wrote out in full for OpenAI and it transfers directly: wrap the client once, demand a feature and customer tag on every call, log the response's usage object per request. Anthropic hands you cache_creation_input_tokens and cache_read_input_tokens as separate fields, so you can compute a cache-hit rate per feature — which is the single most useful number for cutting a Claude bill, because it tells you which prompts are paying full freight when they could be nearly free.

Compute cost at aggregation time against a rates table, never in the logging wrapper — the two cache-write multipliers and the read discount make hardcoded rates especially brittle. Reconcile weekly against the cost report; a 2–5% gap is normal. One documented gotcha to keep the gap boring: the cost report excludes Priority Tier spend, which you have to pick up from the usage report's service-tier dimension.

When a tool earns its keep

The switch flips on the same three events it does for any provider. Finance wants Claude spend inside the cloud cost report, not in a second tab. A second provider is already in the building — you are very likely on OpenAI too. Or an anomaly slips the reconciliation the week nobody was watching.

That is what CloudQuell does for Anthropic. Connect an Admin key and Claude spend lands by model, by workspace, and by token type — with cache-hit-rate and cost-per-request analysis — in the same ledger as your OpenAI, AWS, and Snowflake cost, on the identical attribution model as the OpenAI connector, with per-service anomaly baselines watching it. Flat monthly price, free under $10K/month of spend. The connector docs, linked below, are short.

What we don't do: per-request traces. Cost-per-request here means the aggregate — this feature averages $0.004 a call on Sonnet 5 — not the individual prompt that cost $3. If prompt-level debugging is the question, that is an observability tool's job, and the tools post below says which.

What token types does Anthropic bill for?

Five, as of August 2026: base (uncached) input, output, and three cache lines — a 5-minute cache write at 1.25× the input rate, a 1-hour cache write at 2×, and cache reads at 0.1× (a 90% discount). Batch traffic is billed at 50% off both input and output. Verify current rates on Anthropic's pricing page before you commit a budget.

Does Anthropic support per-project cost tracking?

Yes, through Workspaces — each has its own keys, usage, cost reporting, and spend limit, and the cost and usage APIs let you group by workspace. Anything finer than a workspace — per feature, per customer — you record yourself at the call site, because the API stops at the workspace and key.

How much does prompt caching actually save?

Cache reads cost 90% less than base input, so a stable prefix reused across many calls can drop to roughly a tenth of its uncached cost after you pay a one-time write premium — 25% more for the 5-minute cache, 100% more for the 1-hour. It pays off after one read (5-minute) or two (1-hour). The lever is your cache-hit rate, which is why tracking it per feature matters more than the sticker price.

Tracking Anthropic spend cleanly is worth doing on its own, but it is half a picture. The Claude bill shares a budget with the AWS infrastructure the same features run on, and reconciling the two in separate tools means nobody owns the number that matters — what a product costs end to end. That is the case for treating cloud and AI cost management as one job: OpenAI, Anthropic, and Snowflake spend allocated by the same cost centers and watched by the same anomaly baselines as your EC2 and S3 bill, in one ledger rather than two dashboards. The comparison below lays out which tools actually do it and what they charge.

OpenAI and Anthropic spend on one ledger — per model, per workspace, per token type, with cache-hit rate. Free under $10K/month.

Track your AI spend
← Back to all posts