Responses
/v1/responses 是 OpenAI Responses API 兼容入口,适合 Codex CLI 和 Responses 协议客户端。
接口说明
| 项目 | 值 |
|---|---|
| Method | POST |
| Path | /v1/responses、/v1/responses/* |
| Content-Type | application/json |
| 认证 | Authorization: Bearer YOUR_API_KEY |
请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | 请求模型。 |
input | string 或 array | 是 | Responses API 输入。 |
stream | boolean | 否 | 是否流式响应。 |
instructions | string | 否 | 系统级指令。 |
reasoning | object | 否 | 推理强度等配置,按模型能力生效。 |
tools | array | 否 | 工具定义,按上游和兼容链路支持情况生效。 |
请求示例
bash
curl https://llmapi.site/v1/responses \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"model": "gpt-5.1",
"input": "Write a concise release note.",
"stream": false
}'响应示例
json
{
"id": "resp_123",
"object": "response",
"status": "completed",
"model": "gpt-5.1",
"output": []
}WebSocket 兼容入口
GET /v1/responses 是 OpenAI Responses WebSocket 兼容入口,供特定客户端使用。
兼容路径
不带 /v1 的 /responses 和 Codex 专用 /backend-api/codex/responses 也已注册,详见 兼容别名。