壓縮對話(OpenAI Responses API)

post/v1/responses/compact

透過 OpenAI Responses API 壓縮冗長的對話。

驗證

把 OLETOKEN 的 API Key 作為 Bearer Token 放進 Authorization 請求標頭。金鑰在控制台的「API 金鑰」頁建立。

Authorization: Bearer $OLETOKEN_API_KEY

請求主體

Content-Type:application/json

欄位類型必填說明
modelstring—
inputstring | object[]—輸入內容,可為字串或訊息陣列
instructionsstring——
previous_response_idstring——

回應

200已壓縮對話

欄位類型必填說明
idstring——
objectstring——
created_atinteger——
outputobject[]——
usageUsage——
prompt_tokensinteger—Prompt Token 數量
completion_tokensinteger—補全 Token 數量
total_tokensinteger—Token 總數
prompt_tokens_detailsobject——
cached_tokensinteger——
text_tokensinteger——
audio_tokensinteger——
image_tokensinteger——
completion_tokens_detailsobject——
text_tokensinteger——
audio_tokensinteger——
reasoning_tokensinteger——
errorobject——

請求範例

curl -X POST 'https://api.oletoken.ai/v1/responses/compact' \
  -H "Authorization: Bearer $OLETOKEN_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "string"
  }'