---
title: "Summarize the chat's older messages now. The full transcript stays on screen; only what the model is sent on later turns shrinks."
method: POST
path: "/ai/conversations/{public_id}/compact"
tags: ["AI Chat"]
---

# Summarize the chat's older messages now. The full transcript stays on screen; only what the model is sent on later turns shrinks.

`POST /ai/conversations/{public_id}/compact`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/ai/conversations/{public_id}/compact`
- Auth: HTTP bearer

## Path parameters

- `public_id` string, required

## Response `200`

Compaction finished, or there was nothing to compact

- CompactConversationResponse: What "Compact now" did.
  - `compacted` boolean, required: Whether older messages were folded into the summary by this request.
  - `folded_messages` integer, required: Messages folded into the summary by this request.
  - `kept_messages` integer, required: Messages the model still sees word for word after the summary.
  - `model` string, nullable: The model that wrote the summary, when one did.
  - `reason` string, nullable: Why nothing was compacted, when `compacted` is false.

## Other responses

- `401`: Unauthorized
- `403`: Insufficient permissions
- `404`: Conversation not found
- `409`: The chat is already being compacted
- `500`: Internal server error
- `502`: The summary model failed

## Changes

> 81 revisions in range; 1 not diffed.

- **2026-10-20** `79089e9f49ee`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/ai/conversations/:public_id/compact/post.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) · [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) · [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/ab6d5d19e930?raw)
