/responses/compactCompact a conversation
Compacts conversation input and returns a compacted response object with output items and token usage. Provide the required model and any input or conversation context to compact. Do not combine previous_response_id with conversation.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
Conversation compaction request. The model field is required; the other fields are optional.
One documented failure
slow_downYour request rate increased too quickly. Please reduce the request rate and gradually increase it again.
Traffic increased too quickly
One documented failure
server_is_overloadedThe model is temporarily overloaded. Please retry your request after a brief delay.
The requested model is temporarily overloaded
A 400 is returned when the compaction request is invalid or contains incompatible input parameters, including using previous_response_id with conversation. A 429 is returned when the request exceeds a rate limit; for a slow_down error, reduce your request rate and increase it gradually. A 503 indicates temporary service unavailability; for a server_is_overloaded error, retry after a brief delay. The request body must include model.