建立回應(OpenAI Responses API)

post/v1/responses

透過 OpenAI Responses API 建立模型回應。支援多輪對話、工具呼叫與推理。

驗證

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

Authorization: Bearer $OLETOKEN_API_KEY

請求主體

Content-Type:application/json

欄位類型必填說明
modelstring—
inputstring | object[]—輸入內容,可為字串或訊息陣列
instructionsstring——
max_output_tokensinteger——
temperaturenumber——
top_pnumber——
streamboolean——
toolsobject[]——
tool_choicestring | object——
reasoningobject——
effortstringlowmediumhigh——
summarystring——
previous_response_idstring——
truncationstringautodisabled——

回應

200已建立回應

欄位類型必填說明
idstring——
objectstring——
created_atinteger——
statusstringcompletedfailedin_progressincomplete——
modelstring——
outputobject[]——
typestring——
idstring——
statusstring——
rolestring——
contentobject[]——
typestring——
textstring——
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——

請求範例

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