AI-generated content. This article was researched and written by an automated AI editorial system and published without prior human review. Every factual claim is checked against cited primary sources before publication, but no journalist read this page before you did — treat it accordingly, and report anything that looks wrong. How this works ›

Some links on this page are affiliate links. We may earn a commission at no extra cost to you.
Updated: Sep 15, 2026
·
anthropicclaudepricingapiagentsfinopsprocurementplatform-risk

Anthropic shipped on-demand compaction on 14 September — and the usage field your cost dashboard reads is no longer the bill

TL;DR: On 14 September 2026 Anthropic added on-demand compaction to the Messages API behind the compact-2026-09-04 beta header — request a summary as a standalone call, run it in the background, keep recent turns word-for-word, then swap the returned block in for the messages it replaces. Good feature, well shaped. The part with no headline is a note on the billing: usage.input_tokens and usage.output_tokens do not include the compaction iteration. In Anthropic’s own worked example those fields read 23,000 input tokens while the real billed total, spread across a new usage.iterations array, is 203,000 — roughly 8x. AWS’s copy of that page states the rule and then prints an example that contradicts it. The two most-read fields in the API response stopped being the bill, and they fail by returning a smaller number rather than an error.

What actually shipped

Compaction itself is not new. Threshold-triggered server-side compaction has been in beta since January under the compact-2026-01-12 header: set a trigger (default 150,000 input tokens, minimum 50,000), and when the conversation crosses it the API summarises the history into an opaque compaction block, drops everything before that block on subsequent requests, and carries on.

What arrived on 14 September is control over when. From the documentation:

With the compact-2026-09-04 beta header, you can instead request a summary on demand. That request is separate from your conversation turns and returns only the summary, so it can run in the background. When the block arrives, you swap it in for the messages it summarizes.

Three things follow, and all three are genuine improvements. Summarisation stops blocking a user-facing turn. You choose the moment — after a subtask closes, rather than mid-thought at an arbitrary token count. And on models with preserved thinking, the reasoning in the turns you keep verbatim stays valid, which the threshold-triggered version could not always promise.

For anyone running long agent sessions, that is a real upgrade. It is not the part that should change what you do this week.

The note that matters

Buried in “Understanding usage” on both the Anthropic and AWS versions of the compaction page:

The top-level input_tokens and output_tokens in the usage field do not include compaction iteration usage, and reflect the sum of all non-compaction iterations. To calculate the total tokens consumed and billed for a request, sum across all entries in the usage.iterations array.

AWS adds the consequence in plain language:

If you previously relied on usage.input_tokens and usage.output_tokens for cost tracking or auditing, you will need to update your tracking logic.

Consider what those two fields are. They are the first thing every SDK example prints. They are what every cost-attribution middleware reads, what every per-customer chargeback multiplies by a rate card, what every “why did our bill jump” dashboard plots. Three years of tooling treats them as the price of the request.

They are now the price of part of the request.

Here is the shape of the response, from the documentation:

{
  "usage": {
    "input_tokens": 23000,
    "output_tokens": 1000,
    "iterations": [
      { "type": "compaction", "input_tokens": 180000, "output_tokens": 3500 },
      { "type": "message",    "input_tokens": 23000,  "output_tokens": 1000 }
    ]
  }
}

Reported at the top level: 23,000 input. Actually billed: 203,000. On Claude Opus 5 at $5 / $25 per million tokens, that is $1.13 charged against $0.14 reported — about 8x. The ratio is a property of your context shape rather than your model, because both numbers scale with the same rates; roughly, it is your trigger threshold divided by your post-summary context size.

The failure mode is worse than the number

A breaking change that throws a 400 teaches you it happened. This one returns a smaller number that looks entirely reasonable.

And it is intermittent by design. The documentation is explicit that re-applying a previous compaction block costs nothing extra and that “the top-level usage fields remain accurate in that case.” The iterations array appears only when a new compaction is triggered.

So the pattern your monitoring sees is: hundreds of correct requests, then one badly understated one, then hundreds more correct ones. That is not a step change anyone catches on a graph. It is a slow, quiet divergence between your internal accounting and Anthropic’s invoice, concentrated entirely in the requests that cost the most — which is precisely backwards from what you want if you are re-billing this to customers.

For a sense of the stakes at scale, the only fully itemised frontier agent run with public unit counts is OpenAI’s Navier-Stokes swarm, which worked out to roughly $11 per agent-hour in output tokens. An 8x undercount on the compaction-heavy fraction of a fleet that size is not a rounding error on anyone’s budget.

The documentation disagrees with itself

Worth checking rather than assuming, because it is a small thing that tells you how new this is.

Anthropic’s page prints the example above: top-level input_tokens of 23,000, matching the single non-compaction iteration, exactly as the stated rule requires.

AWS’s Bedrock page states the identical rule — top-level values “reflect the sum of all non-compaction iterations” — and then prints an example whose top-level input_tokens is 45,000, against a single message iteration of 23,000. Under the rule stated three paragraphs above it, that number should be 23,000.

One of those is a stale copy. It does not change what you are charged, and the rule itself is stated consistently in both places. It does mean that if you are implementing against the AWS page and reconciling your arithmetic to its example, you will chase a discrepancy that is not in your code. Implement against the rule, not the sample.

The break-even nobody published

The pitch for compaction is that summarising history is cheaper than re-sending it. That is true against an uncached baseline, where it pays for itself in about two turns.

Almost nobody running long agent sessions has an uncached baseline. Prompt caching is the first optimisation any serious deployment makes, and it changes the answer completely — because caching and compaction solve the same problem by opposite means, and the cheaper one caps the value of the other.

Re-reading a 180,000-token history from a warm cache costs $0.09 per turn on Opus 5, and $0.045 on Fable 5.1 after the 1 September cache read cut took that line item to $0.25 per million tokens. Against numbers that small, one compaction event — a full-price read of everything you are about to discard, plus the summary output, plus the cache rebuild the docs warn can follow — takes a while to earn back:

ModelCompaction eventSaved per later turnBreak-even
Opus 5, compaction read cached$0.32$0.079~4 turns
Opus 5, compaction read cold$1.13$0.079~14 turns
Fable 5.1, compaction read cached$0.51$0.039~13 turns
Fable 5.1, compaction read cold$2.26$0.039~58 turns

Assumes the 180,000 → 23,000 token shape from Anthropic’s example, list prices, a 1.25x cache write to re-establish the compacted prefix, and a context that stops growing. Real agent context keeps growing, which shifts every row in compaction’s favour — treat these as the pessimistic bound, and as evidence that the direction is not obvious rather than as a forecast for your workload.

Two things fall out. First, the cold-cache rows are not hypothetical: the default cache TTL is five minutes, and an agent waiting on a slow tool call, a human approval or a nightly job blows through that routinely. Second, and more interestingly — the better your caching, the worse compaction’s economics. Anthropic cut Fable 5.1’s cache reads to a 0.025x multiplier on 1 September, breaking its own uniform 0.1x rule to do it, and shipped on-demand compaction thirteen days later. Those two features are pulling against each other on the same model, and only one of them is going to be the right default for any given workload.

This is the same lesson as Sakana’s orchestration-token accounting: the sticker price on a model tells you very little until you know which tokens the machinery around it generates on your behalf.

Who decides when this fires

One structural point, because it determines whether any of the above is yours to control.

If you call the Messages API directly, the trigger threshold, the summarisation prompt and now the timing are all yours. That is the good case — the arithmetic above becomes a decision you can make.

If you are inside a managed harness, it is not. When OpenAI put the Agents API into public beta on 10 September, the harness came free and owned compaction, recovery and subagent spawning — every one of those decisions denominated in tokens sold by the company that wrote the policy. Anthropic has just made the equivalent decision explicitly configurable on its raw API while Claude Code users get whatever the harness decides. That gap between the API and the product built on it is the same one Google drew a line through this week when it gave its engineers the model but not the harness.

It also lands in a week where Anthropic’s roughly 80% inference margin went public. None of this is evidence of bad faith — the feature is documented, the note is there, the rule is stated twice. But when a vendor’s margin is that healthy and a billing field quietly stops meaning what it meant, the reasonable posture is to verify your own numbers rather than inherit theirs.

What to do with this

  1. Fix your cost tracking before you enable compaction. Sum usage.iterations when present; fall back to the top-level fields when it is absent. This is a ten-line change and it is the entire actionable content of this story.
  2. Audit whether compaction is already on. Threshold-triggered compaction has been available since January. If a team enabled it behind compact-2026-01-12 and your finance reconciliation has drifted since, you now know where to look.
  3. Do not enable compaction as a cost optimisation without running the table above on your own numbers. Against good caching it can lose. Against a context ceiling it always wins, because the alternative is a failed request.
  4. Check platform parity before you design around it. The Claude API supports compaction on eleven models; Bedrock’s page lists two, and not on the Converse API. Confirm for the platform you will deploy on.
  5. Instrument the compaction rate itself, not just tokens. A rising number of compaction events per session is the leading indicator that context is growing faster than the work is — the same signal worth watching on any metered harness, and one the top-level usage fields will never show you.

If you are choosing where to run long agent sessions, the best AI agent tools rundown covers the orchestration layer and best AI harnesses covers the loop itself; best AI coding tools tracks the seat-priced products built on top. For the models and rate cards underneath, the Claude review tracks Anthropic’s tiers and what they cost, and Cursor and GitHub Copilot track the two harnesses most likely to be making these decisions on your behalf. For the other direction the meter has been moving this month, see GPT-Live-1’s switch from token billing to flat per-minute voice.

Frequently asked questions

Does this mean Anthropic raised prices or is charging for something it hides?

No, and the distinction matters. No rate moved on 14 September, nothing is charged that is not documented, and the documentation states the billing rule plainly — the compaction iteration is a real sampling step that consumes real tokens, and Anthropic says so in the open. The problem is not concealment, it is that the disclosure lives in a note on a feature page while the thing it invalidates is the single most widely-consumed pair of fields in the entire API response. Every SDK example, every tutorial, every internal chargeback script and every third-party observability integration built over the last three years reads usage.input_tokens and usage.output_tokens and treats them as the cost of the request. For requests where compaction fires, that assumption is now false and fails open — the number still arrives, still looks plausible, and is simply too small. A breaking change that returns an error teaches you it happened. A breaking change that returns a smaller number does not.

How much am I actually undercounting?

The ratio depends on the shape of your context, not on which model you run, because both the reported and the unreported figures scale with the same token prices. Using the worked example in Anthropic's own documentation — a compaction iteration of 180,000 input and 3,500 output tokens, followed by a message iteration of 23,000 input and 1,000 output — the top-level fields report 23,000 input tokens where 203,000 were billed, and the dollar cost is roughly 8x what the two obvious fields imply. On Claude Opus 5 that is about $1.13 against a reported $0.14. The general rule: the undercount is approximately your compaction trigger threshold divided by your post-summary context size, so a team running the default 150,000-token trigger down to a compact summary will see a larger gap than a team triggering at the 50,000-token minimum. Critically, the gap is intermittent. Re-applying an existing compaction block costs nothing extra and leaves the top-level fields accurate, so most requests look fine and occasional ones are badly wrong — the hardest possible pattern to notice on a dashboard.

What is the one-line fix?

Stop reading the top-level fields and sum the iterations array instead, defaulting to the top-level values when the array is absent. In pseudocode: if usage.iterations exists, total_input equals the sum of input_tokens across every entry and total_output the sum of output_tokens across every entry; otherwise use usage.input_tokens and usage.output_tokens. AWS's documentation is explicit that this is required — 'If you previously relied on usage.input_tokens and usage.output_tokens for cost tracking or auditing, you will need to update your tracking logic to aggregate across usage.iterations when compaction is enabled.' The iterations array is only present when a new compaction is triggered during the request, so the fallback path is what runs most of the time. Do this before you enable compaction, not after, because the requests you cannot retroactively re-price are the ones already in last month's invoice.

Is compaction worth enabling at all, given the cost?

It depends entirely on whether you are optimising or surviving, and those are different situations that deserve different answers. If you are hitting the context window ceiling, the break-even arithmetic is irrelevant — compaction is the mechanism that lets the conversation continue at all, and the alternative is not a cheaper request but a failed one. Enable it. If you are below the ceiling and enabling compaction as a cost optimisation, do the arithmetic first, because against well-configured prompt caching the payback is slower than it looks. Re-reading a 180,000-token history from a warm cache costs $0.09 per turn on Opus 5 and $0.045 on Fable 5.1, while a single compaction event costs between roughly $0.32 and $1.13 on Opus 5 depending on cache state. That puts break-even somewhere between four and fifty-eight more turns depending on model and cache warmth. Long-running agents clear that easily. Sessions that compact and then finish do not — they just paid a premium for a summary nobody reused.

Why does better prompt caching make compaction look worse?

Because compaction and caching solve the same problem by opposite means, and the cheaper one caps the value of the other. Caching makes re-sending history nearly free; compaction makes the history smaller. If re-reading costs almost nothing, shrinking it saves almost nothing, and you still pay full price for the summarisation pass. This is sharpest on Claude Fable 5.1 and Mythos 5.1, where Anthropic cut cache reads to $0.25 per million tokens on 1 September — a 0.025x multiplier where every other Claude model uses 0.1x. That cut is excellent news and it quietly lengthened compaction's payback period on those two models to somewhere between roughly thirteen and fifty-eight turns. There is also a second-order cost the documentation flags directly: triggering compaction can cause a cache miss on the following request, so you pay to rebuild the cache over the new prefix at the 1.25x write multiplier. Compaction is a context-window tool that is sometimes also a cost tool. Treat it as the former and you will not be disappointed.

Can I rely on this working the same way everywhere I run Claude?

Not yet, and the gap is wide enough to break a migration. On the Claude API, compaction is documented as supported on Fable 5.1, Mythos 5.1, Fable 5, Mythos 5, Mythos Preview, Opus 5, Opus 4.8, Opus 4.7, Opus 4.6, Sonnet 5 and Sonnet 4.6. Amazon Bedrock's compaction page lists two models: Sonnet 4.6 and Opus 4.6. Bedrock also notes compaction is unsupported on the Converse API and works only through InvokeModel. So an architecture built on the Claude API around Opus 5 plus compaction does not lift onto Bedrock as written — you would drop two model generations to keep the feature, or drop the feature to keep the model. The on-demand variant is newer still and carries its own beta header, compact-2026-09-04, distinct from the compact-2026-01-12 header the threshold-triggered version uses. Treat both as beta in the way that word actually means: confirm availability on the platform and model you intend to deploy on, not the one you prototyped on.

Sources

Related tool reviews

Questions or corrections? Email Pick Right. Want the full list? See all news.