Example
http
curl https://api.openai.com/v1/responses/compact \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"model": "gpt-6-astra",
"previous_response_id": "resp_123"
}'Response
json
{
"id": "id",
"created_at": 0,
"object": "response.compaction",
"output": [
{
"id": "id",
"content": [
{
"text": "text",
"type": "input_text",
"prompt_cache_breakpoint": {
"mode": "explicit"
}
}
],
"role": "unknown",
"status": "in_progress",
"type": "message",
"phase": "commentary"
}
],
"usage": {
"input_tokens": 0,
"input_tokens_details": {
"cache_write_tokens": 0,
"cached_tokens": 0
},
"output_tokens": 0,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 0
}
}