跳转到主要内容
POST
/
v1
/
responses
/
compact
压缩对话 (OpenAI Responses API)
curl --request POST \
  --url https://api.ldx.dev/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": {}
}

Documentation Index

Fetch the complete documentation index at: https://docs.liandanxia.io/llms.txt

Use this file to discover all available pages before exploring further.

授权

Authorization
string
header
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

请求体

application/json
model
string
必填
input

输入内容,可以是字符串或消息数组

instructions
string
previous_response_id
string

响应

200 - application/json

成功压缩对话

id
string
object
string
示例:

"response.compaction"

created_at
integer
output
object[]
usage
object
error
object