compaction-on-demand changedbuild-with-claude/compaction-on-demand
Recorded here
Lines+25added
Lines−3removed
From line
13
where the diff opens
First seen
21 Sep 2026
this site's first read of the page
Recorded edits18to this page, all time
## Availability ### API support #### [Messages API](https://platform.claude.com/docs/en/build-with-claude/working-with-messages) ### Required beta headers
The whole hunk
from line 13, old and new numbered
/
from line 13
1313 - claude-mythos-preview
1414 - claude-opus-5-5
1515 - claude-opus-5
16 - claude-sonnet-5-5
17 - claude-sonnet-5
18 - claude-haiku-5-5
1619 - claude-opus-4-8
1720 - claude-opus-4-7
1821 - claude-opus-4-6
19 - claude-sonnet-5-5
20 - claude-sonnet-5
2122 - claude-sonnet-4-6
22 - claude-haiku-5-5
2323 supportedPlatforms:
2424 Claude API: beta
2525 Claude Platform on AWS: beta
from line 828
828828* **Task budgets.** Don’t send the `remaining` value of a [task budget](https://platform.claude.com/docs/en/build-with-claude/task-budgets) (`output_config.task_budget.remaining`) with `compaction` or on requests that carry the block. Doing so returns a 400 error.
829829* **Token counting.** The [token counting](https://platform.claude.com/docs/en/build-with-claude/token-counting) endpoint ignores the `compaction` parameter.
830830* **Content the summary can’t carry.** Images, documents, `container_upload` blocks, and fetched URLs inside the summarized messages are gone once the block replaces them. Restate or re-upload anything a later turn still needs.
831
832## Availability
833
834On-demand compaction is in beta on select models.
835
836### API support
837
838#### [Messages API](https://platform.claude.com/docs/en/build-with-claude/working-with-messages)
839
840* Availability: Available
841
842| Status | Cloud platforms | Models |
843| ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
844| Beta | Claude API, [Claude Platform on AWS](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws), [Claude Models on Google Cloud (Google managed)](https://platform.claude.com/docs/en/build-with-claude/claude-models-on-google-cloud/google-managed), [Microsoft Foundry](https://platform.claude.com/docs/en/build-with-claude/claude-in-microsoft-foundry) | [Claude Fable 5.1](https://platform.claude.com/docs/en/models/fable-5-1/overview), [Claude Mythos 5.1](https://platform.claude.com/docs/en/models/mythos-5-1/overview), [Claude Fable 5](https://platform.claude.com/docs/en/models/fable-5/overview), [Claude Mythos 5](https://platform.claude.com/docs/en/models/mythos-5/overview), Claude Mythos Preview, [Claude Opus 5.5](https://platform.claude.com/docs/en/models/opus-5-5/overview), [Claude Opus 5](https://platform.claude.com/docs/en/models/opus-5/overview), [Claude Sonnet 5.5](https://platform.claude.com/docs/en/models/sonnet-5-5/overview), [Claude Sonnet 5](https://platform.claude.com/docs/en/models/sonnet-5/overview), [Claude Haiku 5.5](https://platform.claude.com/docs/en/models/haiku-5-5/overview), [Claude Opus 4.8](https://platform.claude.com/docs/en/models/opus-4-8/overview), [Claude Opus 4.7](https://platform.claude.com/docs/en/models/opus-4-7/overview), [Claude Opus 4.6](https://platform.claude.com/docs/en/models/opus-4-6/overview), [Claude Sonnet 4.6](https://platform.claude.com/docs/en/models/sonnet-4-6/overview) |
845
846### Required beta headers
847
848[Beta headers overview](https://platform.claude.com/docs/en/api/beta-headers)
849
850Beta headers allow you to access experimental features and new model capabilities before they become part of the standard API.
851
852* `compact-2026-09-04`
831853
No line in this hunk matches that.