v4

latestOpenAPI 3.0.3PostgreSQL Licenseraw.githubusercontent.com2026-08-01192952.2 KB
Chat

Compact a chat message history

Compacts a conversation's message history by removing or summarizing older messages while preserving important context such as anchors and tool results.

post/api/chat/compact

Request body

keep_anchorsboolean

Whether to preserve anchor messages during compaction.

max_tokensinteger

The maximum token budget for the compacted output.

recent_windowinteger

The number of recent messages to always preserve.

Response

Compacted message history.

token_estimateinteger required

Estimated token count of the compacted output.