使用 OpenAI Responses API 进行对话。Responses API 是 OpenAI 最新的 API 格式,支持更灵活的输入方式。
Bearer YOUR_API_KEY| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| model | string | 必填 | 模型名称,如 deepseek-v4.1-flash、qwen3.8-max |
| input | string | 必填 | 输入文本或对话内容 |
| max_tokens | integer | 可选 | 最大输出 tokens 数量 |
| 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
}'