cURL
curl --request POST \ --url https://api.tkhub.ai/v1/v1/responses/compact \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "model": "<string>", "input": "<string>", "instructions": "<string>", "previous_response_id": "<string>" } '
{ "id": "<string>", "object": "response.compaction", "created_at": 123, "output": [ {} ], "usage": { "prompt_tokens": 123, "completion_tokens": 123, "total_tokens": 123, "prompt_tokens_details": { "cached_tokens": 123, "text_tokens": 123, "audio_tokens": 123, "image_tokens": 123 }, "completion_tokens_details": { "text_tokens": 123, "audio_tokens": 123, "reasoning_tokens": 123 } }, "error": {} }
OpenAI Responses API,用于对长对话进行 compaction。
使用 Bearer Token 认证。 格式: Authorization: Bearer sk-xxxxxx
Authorization: Bearer sk-xxxxxx
输入内容,可以是字符串或消息数组
成功压缩对话
"response.compaction"
Show child attributes
Was this page helpful?