跳至正文

Responses API

使用 CHUA ONE 已實作的 Responses 相容請求和事件結構。

POST /v1/responses

curl 'https://chuaone.si/v1/responses' \
  -H "Authorization: Bearer $CHUA_API_KEY" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: YOUR_UNIQUE_REQUEST_ID' \
  -d '{"model":"YOUR_ALLOWED_MODEL","input":"Hello","max_output_tokens":256}'

支援的輸入

model
必填。
input
字串,或訊息/函式調用項。訊息角色支援 developer、system、user、assistant。支援文字和 input_image;檔案及音訊會被拒絕。
instructions
可選文字或文字片段。
max_output_tokens
可選整數 1–131,072,預設 1,024,隨後受模型限制。
tools
支援函式及 namespace 工具。web_search 僅在 external_web_access 為 false 時接受,且不會執行外部搜尋。
store
只能為 false 或省略。

回應與串流

非串流回應使用 object=response,並傳回 output 與 usage。串流依次傳送 response.created、輸出事件,以及 response.completed 或 response.incomplete。不支援的欄位會明確報錯。