Compact a conversation (OpenAI Responses API)

post/v1/responses/compact

Compact a long conversation through the OpenAI Responses API.

Authentication

Send your OLETOKEN API key as a Bearer token. Keys are created on the API Keys page of the console.

Authorization: Bearer $OLETOKEN_API_KEY

Request body

Content-Type:application/json

FieldTypeRequiredDescription
modelstring—
inputstring | object[]—The input, either a string or an array of messages
instructionsstring——
previous_response_idstring——

Responses

200Conversation compacted

FieldTypeRequiredDescription
idstring——
objectstring——
created_atinteger——
outputobject[]——
usageUsage——
prompt_tokensinteger—Number of prompt tokens
completion_tokensinteger—Number of completion tokens
total_tokensinteger—Total number of tokens
prompt_tokens_detailsobject——
cached_tokensinteger——
text_tokensinteger——
audio_tokensinteger——
image_tokensinteger——
completion_tokens_detailsobject——
text_tokensinteger——
audio_tokensinteger——
reasoning_tokensinteger——
errorobject——

Example request

curl -X POST 'https://api.oletoken.ai/v1/responses/compact' \
  -H "Authorization: Bearer $OLETOKEN_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "string"
  }'