Responses
POST /v1/responses
兼容 OpenAI Responses API 格式。支持流式(SSE)和非流式两种模式。
请求格式
{
"model": "gpt-5.5",
"input": "Hello!",
"instructions": "You are a helpful assistant.",
"stream": false
}请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | 模型 ID |
input | string/array | 是 | 用户输入 |
instructions | string | 否 | 系统指令 |
stream | boolean | 否 | 是否启用流式响应 |
max_output_tokens | integer | 否 | 最大生成 Token 数 |
temperature | number | 否 | 采样温度 |
tools | array | 否 | 工具定义 |
tool_choice | string | 否 | 工具选择策略 |
响应格式
{
"id": "resp_xxx",
"object": "response",
"created_at": 1712345678,
"model": "gpt-5.5",
"output": [
{
"type": "message",
"role": "assistant",
"content": [
{"type": "output_text", "text": "Hello!"}
]
}
],
"usage": {
"input_tokens": 5,
"output_tokens": 10,
"total_tokens": 15
}
}