Compact a whole agent history to a token budget (compact-1)
Compaction of a whole history: compact-1 returns the history to continue from within budget_tokens. Not compression of one payload: use /v1/trim for that. The answer is the history and token counts only. A history that already fits comes back as sent. Metered per call and per token against the organization's monthly compact allowance.
post/v1/compact
Request
- Base URLhttps://gateway.caveman.so
- URLhttps://gateway.caveman.so/v1/compact
- AuthAPI key in header x-cave-api-key
Headers
x-cave-retention'metadata' | 'zdr'
metadata or zdr narrows the project's retention for this call: the model runs in memory, nothing is stored and no recovery handle is returned. A call never widens the project's retention.
Request body
Response
The compacted history
Changes
No recorded changes to this operation across all 1 revision of this API.