Responses API¶
本节列出该能力下当前已实现的接口。
创建响应 (OpenAI Responses API)¶
POST /v1/responses
OpenAI Responses API,用于创建模型响应。 支持多轮对话、工具调用、推理等功能。
鉴权¶
- Bearer Token (
Authorization: Bearer <token>)
请求体¶
- Content-Type:
application/json - Schema:
ResponsesRequest
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| model | string | yes | - |
| input | - | no | 输入内容,可以是字符串或消息数组 |
| instructions | string | no | - |
| max_output_tokens | integer | no | - |
| temperature | number | no | - |
| top_p | number | no | - |
| stream | boolean | no | - |
| tools | array[object] | no | - |
| tool_choice | - | no | - |
| reasoning | object | no | - |
| previous_response_id | string | no | - |
| truncation | string | no | - |
返回¶
| 状态码 | 说明 | Schema |
|---|---|---|
| 200 | 成功创建响应 | ResponsesResponse |
压缩对话 (OpenAI Responses API)¶
POST /v1/responses/compact
OpenAI Responses API,用于对长对话进行 compaction。
鉴权¶
- Bearer Token (
Authorization: Bearer <token>)
请求体¶
- Content-Type:
application/json - Schema:
ResponsesCompactionRequest
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| model | string | yes | - |
| input | - | no | 输入内容,可以是字符串或消息数组 |
| instructions | string | no | - |
| previous_response_id | string | no | - |
返回¶
| 状态码 | 说明 | Schema |
|---|---|---|
| 200 | 成功压缩对话 | ResponsesCompactionResponse |