Nén hội thoại (OpenAI Responses API)
post/v1/responses/compact
Nén một hội thoại dài thông qua OpenAI Responses API.
Xác thực
Gửi khóa API OLETOKEN dưới dạng token Bearer. Khóa được tạo tại trang API Keys trong bảng điều khiển.
Authorization: Bearer $OLETOKEN_API_KEYNội dung yêu cầu
Content-Type:application/json
| Trường | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
| model | string | — | |
| input | string | object[] | — | Đầu vào, có thể là một chuỗi hoặc một mảng tin nhắn |
| instructions | string | — | — |
| previous_response_id | string | — | — |
Phản hồi
200Đã nén hội thoại
| Trường | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
| id | string | — | — |
| object | string | — | — |
| created_at | integer | — | — |
| output | object[] | — | — |
| usage | Usage | — | — |
| prompt_tokens | integer | — | Số token prompt |
| completion_tokens | integer | — | Số token completion |
| total_tokens | integer | — | Tổng số 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 | — | — |
Ví dụ yêu cầu
curl -X POST 'https://api.oletoken.ai/v1/responses/compact' \
-H "Authorization: Bearer $OLETOKEN_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "string"
}'
