Kompresi percakapan (OpenAI Responses API)
post/v1/responses/compact
Kompresi percakapan panjang melalui OpenAI Responses API.
Autentikasi
Kirim kunci API OLETOKEN sebagai token Bearer. Kunci dibuat di halaman Kunci API pada konsol.
Authorization: Bearer $OLETOKEN_API_KEYIsi permintaan
Content-Type:application/json
| Field | Tipe | Wajib | Keterangan |
|---|---|---|---|
| model | string | — | |
| input | string | object[] | — | Input, berupa string atau array pesan |
| instructions | string | — | — |
| previous_response_id | string | — | — |
Respons
200Percakapan dikompresi
| Field | Tipe | Wajib | Keterangan |
|---|---|---|---|
| id | string | — | — |
| object | string | — | — |
| created_at | integer | — | — |
| output | object[] | — | — |
| usage | Usage | — | — |
| prompt_tokens | integer | — | Jumlah token prompt |
| completion_tokens | integer | — | Jumlah token completion |
| total_tokens | integer | — | Jumlah total token |
| 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 | — | — |
Contoh permintaan
curl -X POST 'https://api.oletoken.ai/v1/responses/compact' \
-H "Authorization: Bearer $OLETOKEN_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "string"
}'
