使用 OpenAI 響應 API 進行對話。響應 API 是最新 OpenAI API 格式,具有更靈活的輸入。
Bearer YOUR_API_KEY| 參數 | 類型 | 必要 | 說明 |
|---|---|---|---|
| model | string | 必要 | 模型名稱,例如 deepseek-v4.1-flash、qwen3.8-max |
| input | string | 必要 | 輸入文字或對話內容 |
| max_tokens | integer | 選填 | 最大輸出 token 數量 |
| temperature | float | 選填 | 取樣溫度,控制隨機性(0-2) |
| stream | boolean | 選填 | 啟用流式響應,設定為 true 以獲取 SSE |
| 參數 | 類型 | 說明 |
|---|---|---|
| id | string | 唯一響應識別符號 |
| model | string | 實際使用的模型 |
| output | string | 生成的文字輸出 |
| usage | object | token 使用統計資訊,包括 prompt_tokens、completion_tokens、total_tokens |
curl https://your-domain.com/api/ai/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "deepseek-v4.1-flash",
"input": "Hello, who are you?",
"max_tokens": 1000
}'