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_KEYRequest body
Content-Type:application/json
| Field | Type | Required | Description |
|---|---|---|---|
| model | string | — | |
| input | string | object[] | — | The input, either a string or an array of messages |
| instructions | string | — | — |
| previous_response_id | string | — | — |
Responses
200Conversation compacted
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | — | — |
| object | string | — | — |
| created_at | integer | — | — |
| output | object[] | — | — |
| usage | Usage | — | — |
| prompt_tokens | integer | — | Number of prompt tokens |
| completion_tokens | integer | — | Number of completion tokens |
| total_tokens | integer | — | Total number of tokens |
| 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 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"
}'
