Appearance
Responses格式
Responses格式
POST/v1/responsesOpenAI Responses API,用于创建模型响应。 支持多轮对话、工具调用、推理等功能。
请求头 (Headers)
| 参数名 | 类型 | 必选 | 描述 | 示例 |
|---|---|---|---|---|
Authorization | string | 否 | 鉴权令牌 | Bearer ******************** |
请求体 (Request Body)
Content-Type: application/json
| 字段 | 类型 | 必选 | 描述 |
|---|---|---|---|
| model | string | 是 | |
| input | any | 否 | 输入内容,可以是字符串或消息数组 |
| instructions | string | 否 | |
| max_output_tokens | integer | 否 | |
| temperature | number | 否 | |
| top_p | number | 否 | |
| stream | boolean | 否 | |
| tools | array of object | 否 | |
| tool_choice | any | 否 | |
| reasoning | object | 否 | |
| reasoning.effort | string | 否 | |
| reasoning.summary | string | 否 | |
| previous_response_id | string | 否 | |
| truncation | string | 否 |
请求体示例
json
{
"model": "string",
"input": null,
"instructions": "string",
"max_output_tokens": 0,
"temperature": 0,
"top_p": 0,
"stream": true,
"tools": [
{}
],
"tool_choice": null,
"reasoning": {
"effort": "string",
"summary": "string"
},
"previous_response_id": "string",
"truncation": "string"
}返回响应 (Responses)
200 - 成功创建响应
| 字段 | 类型 | 描述 |
|---|---|---|
| id | string | |
| object | string | |
| created_at | integer | |
| status | string | |
| model | string | |
| output | array of object | |
| output[].type | string | |
| output[].id | string | |
| output[].status | string | |
| output[].role | string | |
| output[].content | array of object | |
| output[].content[].type | string | |
| output[].content[].text | string | |
| usage | any |
响应示例
json
{
"id": "string",
"object": "response",
"created_at": 0,
"status": "string",
"model": "string",
"output": [
{
"type": "string",
"id": "string",
"status": "string",
"role": "string",
"content": [
{
"type": "string",
"text": "string"
}
]
}
],
"usage": {
"prompt_tokens": 0,
"completion_tokens": 0,
"total_tokens": 0,
"prompt_tokens_details": {
"cached_tokens": 0,
"text_tokens": 0,
"audio_tokens": 0,
"image_tokens": 0
},
"completion_tokens_details": {
"text_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0
}
}
}