切换主题
Responses格式
OpenAI Responses API,用于创建模型响应。 支持多轮对话、工具调用、推理等功能。
Responses格式
POST /v1/responses
OpenAI Responses API,用于创建模型响应。 支持多轮对话、工具调用、推理等功能。
认证
BearerAuth
请求体
必填:是
application/json
| 字段 | 必填 | 类型 | 说明 |
|---|---|---|---|
| model | 是 | string | - |
| input | 否 | oneOf<string | array<object>> | 输入内容,可以是字符串或消息数组 |
| instructions | 否 | string | - |
| max_output_tokens | 否 | integer | - |
| temperature | 否 | number | - |
| top_p | 否 | number | - |
| stream | 否 | boolean | - |
| tools | 否 | array<object> | - |
| tool_choice | 否 | oneOf<string | object> | - |
| reasoning | 否 | object | - |
| reasoning.effort | 否 | enum: low | medium | high | - |
| reasoning.summary | 否 | string | - |
| previous_response_id | 否 | string | - |
| truncation | 否 | enum: auto | disabled | - |
原始 Schema
json
{
"type": "object",
"required": [
"model"
],
"properties": {
"model": {
"type": "string"
},
"input": {
"description": "输入内容,可以是字符串或消息数组",
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "object",
"properties": {},
"x-apifox-orders": []
}
}
]
},
"instructions": {
"type": "string"
},
"max_output_tokens": {
"type": "integer"
},
"temperature": {
"type": "number"
},
"top_p": {
"type": "number"
},
"stream": {
"type": "boolean"
},
"tools": {
"type": "array",
"items": {
"type": "object",
"properties": {},
"x-apifox-orders": []
}
},
"tool_choice": {
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"properties": {},
"x-apifox-orders": []
}
]
},
"reasoning": {
"type": "object",
"properties": {
"effort": {
"type": "string",
"enum": [
"low",
"medium",
"high"
]
},
"summary": {
"type": "string"
}
},
"x-apifox-orders": [
"effort",
"summary"
]
},
"previous_response_id": {
"type": "string"
},
"truncation": {
"type": "string",
"enum": [
"auto",
"disabled"
]
}
},
"x-apifox-orders": [
"model",
"input",
"instructions",
"max_output_tokens",
"temperature",
"top_p",
"stream",
"tools",
"tool_choice",
"reasoning",
"previous_response_id",
"truncation"
]
}响应
200 成功创建响应
application/json
| 字段 | 必填 | 类型 | 说明 |
|---|---|---|---|
| id | 否 | string | - |
| object | 否 | string | Examples: response |
| created_at | 否 | integer | - |
| status | 否 | enum: completed | failed | in_progress | incomplete | - |
| model | 否 | string | - |
| output | 否 | array<object> | - |
| output[].type | 否 | string | - |
| output[].id | 否 | string | - |
| output[].status | 否 | string | - |
| output[].role | 否 | string | - |
| output[].content | 否 | array<object> | - |
| usage | 否 | object | - |
| usage.prompt_tokens | 否 | integer | 提示词 Token 数 |
| usage.completion_tokens | 否 | integer | 补全 Token 数 |
| usage.total_tokens | 否 | integer | 总 Token 数 |
| usage.prompt_tokens_details | 否 | object | - |
| usage.prompt_tokens_details.cached_tokens | 否 | integer | - |
| usage.prompt_tokens_details.text_tokens | 否 | integer | - |
| usage.prompt_tokens_details.audio_tokens | 否 | integer | - |
| usage.prompt_tokens_details.image_tokens | 否 | integer | - |
| usage.completion_tokens_details | 否 | object | - |
| usage.completion_tokens_details.text_tokens | 否 | integer | - |
| usage.completion_tokens_details.audio_tokens | 否 | integer | - |
| usage.completion_tokens_details.reasoning_tokens | 否 | integer | - |
原始 Schema
json
{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"object": {
"type": "string",
"examples": [
"response"
]
},
"created_at": {
"type": "integer"
},
"status": {
"type": "string",
"enum": [
"completed",
"failed",
"in_progress",
"incomplete"
]
},
"model": {
"type": "string"
},
"output": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
},
"status": {
"type": "string"
},
"role": {
"type": "string"
},
"content": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"text": {
"type": "string"
}
},
"x-apifox-orders": [
"type",
"text"
]
}
}
},
"x-apifox-orders": [
"type",
"id",
"status",
"role",
"content"
]
}
},
"usage": {
"type": "object",
"properties": {
"prompt_tokens": {
"type": "integer",
"description": "提示词 Token 数"
},
"completion_tokens": {
"type": "integer",
"description": "补全 Token 数"
},
"total_tokens": {
"type": "integer",
"description": "总 Token 数"
},
"prompt_tokens_details": {
"type": "object",
"properties": {
"cached_tokens": {
"type": "integer"
},
"text_tokens": {
"type": "integer"
},
"audio_tokens": {
"type": "integer"
},
"image_tokens": {
"type": "integer"
}
},
"x-apifox-orders": [
"cached_tokens",
"text_tokens",
"audio_tokens",
"image_tokens"
]
},
"completion_tokens_details": {
"type": "object",
"properties": {
"text_tokens": {
"type": "integer"
},
"audio_tokens": {
"type": "integer"
},
"reasoning_tokens": {
"type": "integer"
}
},
"x-apifox-orders": [
"text_tokens",
"audio_tokens",
"reasoning_tokens"
]
}
},
"x-apifox-orders": [
"prompt_tokens",
"completion_tokens",
"total_tokens",
"prompt_tokens_details",
"completion_tokens_details"
]
}
},
"x-apifox-orders": [
"id",
"object",
"created_at",
"status",
"model",
"output",
"usage"
]
}