Skip to main content
POST
/
v1
/
responses
curl --request POST \
  --url https://code.heihuzi.ai/v1/responses \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gpt-5.5",
    "input": "写一个 TypeScript debounce 函数"
  }'
/v1/responses 是 Codex / OpenAI API 调用的主推荐入口,适合文本、多模态输入和工具调用。旧版客户端可以使用 /v1/chat/completions,但新接入优先选择 Responses。
curl --request POST \
  --url https://code.heihuzi.ai/v1/responses \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gpt-5.5",
    "input": "写一个 TypeScript debounce 函数"
  }'

Body

model
string
required
模型 ID。推荐使用 gpt-5.5gpt-5.4gpt-5.4-minigpt-5.3-codexgpt-5.3-codex-spark
input
string | array
required
输入内容。可传字符串,也可传 OpenAI Responses 兼容的多模态 input 结构。
stream
boolean
是否启用流式响应。
tools
array
OpenAI Responses 兼容工具列表。需要图像生成时,可以声明 image generation 工具并使用 gpt-image-2
temperature
number
采样温度。具体支持情况取决于当前模型和渠道。

图像工具

Responses 可以通过工具调用触发图像生成。直接生成图片时,仍建议使用 /v1/images/generations;需要在一次对话或任务流里组合文本和图片能力时,再使用 Responses 工具模式。

Response

返回 OpenAI Responses 兼容结构。具体输出字段会随请求模式、流式设置和上游模型变化。

与 Chat Completions 的关系

  • Responses 是 Codex / OpenAI 新接入的首选入口。
  • Chat Completions 只作为旧版 messages 客户端的兼容入口。
  • 两个接口都走 OpenAI-compatible 能力,但请求体和响应结构不同。