对话与响应

创建响应

使用 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..."
        }
      ]
    }
  ]
}