Skip to content

Compact conversation

POST
/v1/responses/compact
curl --request POST \
--url https://api.mirapi.ai/v1/responses/compact \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "model": "example", "input": [ {} ], "instructions": "example", "previous_response_id": "example" }'

The OpenAI Responses API endpoint that compacts a long conversation.

Media typeapplication/json
object
model
required
string
input
One of:
string
instructions
string
previous_response_id
string
Examplegenerated
{
"model": "example",
"input": [
{}
],
"instructions": "example",
"previous_response_id": "example"
}

Conversation compacted

Media typeapplication/json
object
id
string
object
string
created_at
integer
output
Array<object>
object
usage
object
prompt_tokens

Prompt tokens

integer
completion_tokens

Completion tokens

integer
total_tokens

Total tokens

integer
prompt_tokens_details
object
cached_tokens
integer
text_tokens
integer
audio_tokens
integer
image_tokens
integer
completion_tokens_details
object
text_tokens
integer
audio_tokens
integer
reasoning_tokens
integer
error
object
Example
{
"object": "response.compaction"
}