Responses

Compact response

Compacts a conversation by summarizing older items to free up context window space. Returns a compaction item containing the generated summary.

post/v1/responses/compact

Request body

instructionsstring

Custom instructions for the compaction summarization.

modelstring

The model to use for compaction in provider/model format (e.g. openai/gpt-4o). Required.

previous_response_idstring

The ID of a previous response to continue from.

prompt_cache_keystring

Key for prompt caching across requests.

Response

Compaction completed successfully.

created_atinteger required

Unix timestamp (seconds) when the response was created.

idstring required

The ID of the compaction response.

object'response.compaction' required

Always "response.compaction".

Changes

Changed in 1 of the 350 revisions of this API.1

Of the 350 revisions, 136 have no diff computed.