Compact a conversation
Creates a compacted summary of the conversation history for a response, reducing context size while preserving key information. Returns a compacted response object.
Documentation Index
Fetch the complete documentation index at: https://docs.mka1.com/llms.txt
Use this file to discover all available pages before exploring further.
Authorizations
Gateway auth: send Authorization: Bearer <mka1-api-key>. For multi-user server-side integrations, you can also send X-On-Behalf-Of: <external-user-id>.
Headers
Optional external end-user identifier forwarded by the API gateway.
Body
Request schema for compacting a response's conversation history into a condensed summary.
The model to use for generating the compaction summary.
Text, image, or file inputs to the model, used to generate a response.
A system (or developer) message inserted into the model's context. When used along with previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses.
The ID of a previous response whose conversation history should be compacted. If omitted, only the provided input is compacted.
Response
The compacted response object containing user messages and compaction summary.
-9007199254740991 <= x <= 9007199254740991Input message item: A message with role and content. Use this for user, assistant, system, or developer turns in structured inputs.
- Input message item
- Output message item
- Output audio item
- File search call item
- Computer call item
- Computer call output item
- Web search call item
- Function call item
- Function call output item
- Reasoning item
- Image generation call item
- Code interpreter call item
- Local shell call item
- Local shell call output item
- Shell call item
- Shell call output item
- MCP list tools item
- MCP approval request item
- MCP approval response item
- MCP call item
- Custom tool call item
- Custom tool call output item
- Item reference item
- Compaction item