ย่อบทสนทนา (OpenAI Responses API)
post/v1/responses/compact
ย่อบทสนทนายาวผ่าน OpenAI Responses API
การยืนยันตัวตน
ส่งคีย์ API ของ OLETOKEN เป็น Bearer token สร้างคีย์ได้ที่หน้า API Keys ในคอนโซล
Authorization: Bearer $OLETOKEN_API_KEYเนื้อหาคำขอ
Content-Type:application/json
| ฟิลด์ | ประเภท | จำเป็น | คำอธิบาย |
|---|---|---|---|
| model | string | — | |
| input | string | object[] | — | อินพุต ซึ่งเป็นสตริงหรืออาร์เรย์ของข้อความ |
| instructions | string | — | — |
| previous_response_id | string | — | — |
การตอบกลับ
200ย่อบทสนทนาแล้ว
| ฟิลด์ | ประเภท | จำเป็น | คำอธิบาย |
|---|---|---|---|
| id | string | — | — |
| object | string | — | — |
| created_at | integer | — | — |
| output | object[] | — | — |
| usage | Usage | — | — |
| prompt_tokens | integer | — | จำนวนโทเค็นของพรอมต์ |
| completion_tokens | integer | — | จำนวนโทเค็นคำตอบ |
| 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 | — | — |
ตัวอย่างคำขอ
curl -X POST 'https://api.oletoken.ai/v1/responses/compact' \
-H "Authorization: Bearer $OLETOKEN_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "string"
}'
