Responses 接口
Responses 接口
POST /v1/responses 是 OpenAI Responses 格式的接口。ChatGPT 桌面端和 Codex 在 config.toml 里把 wire_api 设为 responses 时,就会走这条路径。自己写应用时,仍可优先使用更常见的 /v1/chat/completions。
最小请求
curl https://www.vvkapi.com/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-xxxxxxxxxxxxxxxx" \
-d '{
"model": "gpt-6.1-sol",
"input": "你好,请用一句话介绍你自己"
}'
常用字段包括 model、input(字符串或消息数组)、instructions、stream 等。成功时返回的 object 为 response,文本一般在 output 里。
和对话接口的关系
- 两者都使用同一套基址、密钥和模型名称。
- 不要把 Chat Completions 的
messages原样套到 Responses 的input而不做字段调整,按各接口自己的格式来。 - 不是所有模型、所有可选字段都经过逐一演示。先用上面的最小请求调通,再按客户端或 SDK 的默认行为增加参数。
若你使用官方 ChatGPT / Codex 客户端,一般只需正确填写基址和密钥,不必自己拼 Responses 请求。手动配置见 应用对接。