对话与响应
创建响应
使用 OpenAI Responses 格式创建响应,可传入指令、推理配置和工具。
POST
/v1/responses请求参数
| 参数 | 类型 / 位置 | 说明 |
|---|---|---|
model必填 | stringbody | 准确的模型 ID。 |
input必填 | string | arraybody | 文本或结构化输入项。 |
instructions可选 | stringbody | 本次响应的系统级指令。 |
max_output_tokens可选 | integerbody | 最大输出 Token 数。 |
reasoning可选 | objectbody | 支持推理的模型所使用的推理配置。 |
stream可选 | booleanbody | 设为 true 时流式返回响应事件。 |
tools可选 | arraybody | 响应过程中可用的工具。 |
请求示例
cURL
curl --request POST \
--url 'https://api.juhenextvip.com/v1/responses' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-5.6-luna",
"instructions": "Answer clearly and briefly.",
"input": "Explain what an API gateway does."
}'响应示例
JSON
{
"id": "resp_...",
"object": "response",
"status": "completed",
"output": [
{
"type": "message",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "An API gateway is a single entry point..."
}
]
}
]
}