Skip to content

Responses API ​

端点: POST https://oneapi.zaiwenai.com/v1/responses

与 OpenAI Responses API 接口兼容。Codex 等客户端使用此接口格式。

请求参数 ​

参数类型必填说明
modelstring是模型名称
inputstring | array是输入内容
streamboolean否是否启用流式响应,默认 false

其他参数请参考 OpenAI Responses API 文档。

Curl 示例 ​

bash
curl https://oneapi.zaiwenai.com/v1/responses \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $YOUR_API_KEY" \
  -d '{
    "model": "gpt-5.4-mini",
    "input": "What is the capital of France?"
  }'

流式响应 ​

bash
curl https://oneapi.zaiwenai.com/v1/responses \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $YOUR_API_KEY" \
  -d '{
    "model": "gpt-5.4-mini",
    "input": "Tell me a short story",
    "stream": true
  }'

计费说明 ​

与 Chat Completions 接口相同,按 Token 用量计费。