Compaction
Compact context
Compresses a conversation into an opaque encrypted compaction item using the OpenAI-compatible context compaction API.
The response output array contains the original user messages plus a final item with type: "response.compaction" and an encrypted_content field. Pass the full output array as input to future Responses API requests to continue the conversation without retransmitting the full history.
Supported providers: OpenAI, Azure OpenAI, xAI. Requests to unsupported providers return a 400 error.
post/v1/responses/compact
Request body
Response
Successful compaction response
Example response
{
"object": "response.compaction"
}