跳转到主要内容
curl https://api.poixe.com/v1/responses \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $POIXE_API_KEY" \
  -d '{
    "model": "gpt-5.2",
    "input": "Hello!",
    "stream": false
  }'
{
  "id": "resp_01065d515056e8610069611480ba7081959130e6295400c885",
  "object": "response",
  "created_at": 1767969920,
  "status": "completed",
  "background": false,
  "billing": {
    "payer": "developer"
  },
  "completed_at": 1767969921,
  "error": null,
  "incomplete_details": null,
  "instructions": null,
  "max_output_tokens": null,
  "max_tool_calls": null,
  "model": "gpt-5.2-2025-12-11",
  "output": [
    {
      "id": "msg_01065d515056e8610069611480f34c81959cf2664fe1bec6ee",
      "type": "message",
      "status": "completed",
      "content": [
        {
          "type": "output_text",
          "annotations": [],
          "logprobs": [],
          "text": "Hello! What would you like to work on today?"
        }
      ],
      "role": "assistant"
    }
  ],
  "parallel_tool_calls": true,
  "previous_response_id": null,
  "prompt_cache_key": null,
  "prompt_cache_retention": null,
  "reasoning": {
    "effort": "none",
    "summary": null
  },
  "safety_identifier": null,
  "service_tier": "default",
  "store": true,
  "temperature": 1.0,
  "text": {
    "format": {
      "type": "text"
    },
    "verbosity": "medium"
  },
  "tool_choice": "auto",
  "tools": [],
  "top_logprobs": 0,
  "top_p": 0.98,
  "truncation": "disabled",
  "usage": {
    "input_tokens": 8,
    "input_tokens_details": {
      "cached_tokens": 0
    },
    "output_tokens": 15,
    "output_tokens_details": {
      "reasoning_tokens": 0
    },
    "total_tokens": 23
  },
  "user": null,
  "metadata": {}
}
POST https://api.poixe.com/v1/responses
这是 OpenAI 新一代的统一响应协议(推荐优先使用),用于替代传统的 Chat Completions 它更适合承载新模型的能力(如更强的工具调用、更一致的多模态输入/输出、更好的结构化输出等)。

认证与授权

所有 API 请求都必须在 HTTP Header 中包含您的 API 密钥。
Authorization
string
必填
Bearer Token。格式为 Bearer YOUR_API_KEY
Content-Type
string
必填
必须设置为 application/json

请求参数

以下是构建 Responses 请求时最常用的核心参数(覆盖 80% 场景)。
model
string
必填
请求的模型名称。例如:gpt-4.1gpt-4.1-mini 等。
input
string | array
必填
输入内容。最常见是字符串文本;也支持结构化输入(例如包含多段内容、图片等的数组)。
instructions
string
可选:系统级指令(类似 Chat Completions 的 system 消息),用于约束风格/规则。
stream
boolean
默认值:"false"
是否流式输出。开启后,服务器将通过 SSE (Server-Sent Events) 实时推送增量内容。
temperature
number
默认值:"1"
采样温度(0~2)。较低更稳定,较高更发散。
top_p
number
默认值:"1"
核采样(nucleus sampling)。通常与 temperature 二选一调整即可。
max_output_tokens
integer
最大输出 Token 数限制(用于控制长度与成本)。
tools
object[]
工具列表(函数调用 / 内置工具)。
tool_choice
string | object
工具调用策略:none / auto / required,或强制指定某个工具。
response_format
object
输出格式控制(用于结构化输出/严格 JSON)。
metadata
map
可选:自定义元数据(用于标记与检索)。

响应结构

接口返回一个 Response 对象,包含生成结果、状态与 Token 消耗信息。
id
string
本次请求的唯一标识符。
object
string
对象类型,通常为 response
created_at
integer
创建时间(Unix 秒级时间戳)。
model
string
实际处理请求的模型名称。
status
string
请求状态。常见:completed(已完成)/ in_progress(处理中)/ failed(失败)。
output
object[]
输出内容列表。通常包含模型消息与(可选的)工具调用结果。
usage
object
Token 用量统计(如有返回)。