Trim Context
Deterministically trim a conversation payload (no LLM calls).
searchAuthorizations
Your Algolia application ID.
Your Algolia API key with the necessary permissions to make the request. Permissions are controlled through access control lists (ACL) and access restrictions. The required ACL to make a request is listed in each endpoint's reference.
Body
Deterministic trim request (no LLM calls).
- userMessageV4
- assistantMessageV4
Strip tool-invocation/result parts from the messages that are kept. Applied before the token budget, so the budget counts only surviving content.
Keep only the last N messages, dropping older ones. Applied before the token budget.
x >= 0Drop oldest messages until the estimated token total fits this budget (heuristic).
x >= 0Response
Successful Response.
Result of a context operation, ready to feed to /completions.
- userMessageV4
- assistantMessageV4
Before/after accounting for a context operation.
tokens*Estimate fields are heuristic, not an authoritative provider count.
messages_dropped is the net reduction in message count (messages_before - messages_after); for compaction the summarized tail is replaced by a single summary
message, so this reflects the net change rather than a raw delete count.
Compaction-specific telemetry, returned only by /context/compact.
compacted makes the short-conversation passthrough detectable: without it a caller
cannot tell a no-op from a summary that happened to be short.