---
title: "Compact Context Now"
method: POST
path: "/api/chats/{chat_id}/context-usage/compact"
tags: ["chats"]
---

# Compact Context Now

`POST /api/chats/{chat_id}/context-usage/compact`

## Request

- Base URL: `https://app.thinqos.com` (the document declares no server; this is the origin it was published from)
- URL: `https://app.thinqos.com/api/chats/{chat_id}/context-usage/compact`
- Auth: none declared

"Summarize now": manually roll the summary that backs this viewer's gauge.

TOS-1086 converged the meter onto the chat's audience-gated summary of
record, normally owned by the responding agent. Manual compaction must target
that same owner so the button reduces the context the next prompt actually
uses, instead of updating a stale per-viewer auxiliary summary. No-ops
(returns current usage) when summaries are disabled or there is nothing new
to fold. 404 if the caller is not an active participant.

## Path parameters

- `chat_id` string, uuid, required

## Headers

- `x-impersonate-identity-id` string, nullable

## Response `200`

Successful Response

- ContextUsageResponse: The logged-in viewer's OWN context-window usage for a chat (TOS-761). Strictly scoped to the caller's identity: every identity maintains its own context window (humans included, via augmented/agent mode), keyed by ``(chat, identity)``, so you never see another participant's. ``usage_percent`` is honest *token fill*: it uses the post-boundary high-water chat model-run prompt tokens when available, otherwise the viewer's active rolling summary + bounded raw window (``used_tokens``), measured against the resolved model input ceiling (``context_window``). ``floor_tokens`` is the chat-independent fixed prompt cost and ``history_tokens`` is the chat's summary plus bounded raw-window contribution. The token figures are a UI gauge, not billing numbers.
  - `context_window` integer, required
  - `used_tokens` integer, required
  - `usage_percent` integer, required
  - `floor_tokens` integer
  - `history_tokens` integer

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/thinqos/apis/thinqos-api.md) · [All operations](https://skmtc.dev/thinqos/apis/thinqos-api/llms.txt) · [OpenAPI document](https://skmtc.dev/thinqos/apis/thinqos-api/revisions/ce2c2ce318b1?raw)
