第 6 章 / 共 21 章约 1 分钟

6. Responses API#

POST /v1/responses — OpenAI Responses API 兼容实现。接受 input(字符串或消息数组)与可选的 instructions(等价于 system 提示),内部转换为对话补全处理。

cURL
curl http://183.240.79.21:52099/v1/responses \
  -H "Authorization: Bearer sk-你的YiTuoToken-Key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o",
    "instructions": "你是一个简洁的助手。",
    "input": "用一句话解释什么是量子纠缠"
  }'

input 也可以是消息数组:

JSON
{
  "model": "gpt-4o",
  "input": [
    { "role": "user", "content": "你好" }
  ]
}