压缩对话 (OpenAI Responses API)
post/v1/responses/compact
OpenAI Responses API,用于对长对话进行 compaction。
鉴权
把 OLETOKEN 的 API Key 作为 Bearer Token 放进 Authorization 请求头。密钥在控制台的「API 密钥」页创建。
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 | — | 提示词 Token 数 |
| completion_tokens | integer | — | 补全 Token 数 |
| total_tokens | integer | — | 总 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 | — | — |
请求示例
curl -X POST 'https://api.oletoken.ai/v1/responses/compact' \
-H "Authorization: Bearer $OLETOKEN_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "string"
}'
