Compact response
API reference for POST /v1/responses/compact. Summarize older conversation items into one compaction item.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Input to compact: a string or an array of input items (messages, files, etc.).
Custom instructions for the compaction summarization.
The model to use for compaction in provider/model format (e.g. openai/gpt-4o). Required.
The ID of a stored response whose conversation is compacted; input is appended after it.
Key for prompt caching across requests.
Response
Compaction completed successfully.
Unix timestamp (seconds) when the response was created.
The ID of the compaction response.
Always "response.compaction".
response.compaction The next context window: a compaction item summarizing older items, followed by the most recent items verbatim. Pass it as the input of the next request, without previous_response_id.
Token usage information for the compaction request.