主题
创建模型响应 gpt-5启用思考
POST
https://az.gptplus5.com/v1/responses
https://platform.openai.com/docs/api-reference/responses/create
部分OpenAI模型仅支持Response格式,例如o3-pro,codex-mini-latest
请求参数
Authorization
在 Header 添加参数Authorization,其值为在 Bearer 之后拼接 Token
示例:Authorization: Bearer ********************
Header 参数
| 参数名 | 类型 | 必需 | 说明 | 示例 |
|---|---|---|---|---|
Content-Type | string | 必需 | application/json | |
Accept | string | 必需 | application/json | |
Authorization | string | 可选 | Bearer {{YOUR_API_KEY}} |
Body 参数 (application/json)
| 参数名 | 类型 | 必需 | 说明 |
|---|---|---|---|
model | string | 可选 | 要使用的模型的 ID。有关哪些模型可与聊天 API 一起使用的详细信息,请参阅模型端点兼容性表。 |
input | array[object] | 可选 | 模型的文本、图像,用于生成响应。 |
└ role | string | 必需 | |
└ content | array[object] | 必需 | |
tools | array[string] | 可选 | 模型可以调用的一组工具列表。目前,只支持作为工具的函数。使用此功能来提供模型可以为之生成 JSON 输入的函数列表。 |
text | object | 可选 | 用于模型文本响应的配置选项。可以是纯文本或结构化 JSON 数据。 |
└ format | object | 可选 | 指定模型必须输出的格式。 |
└ verbosity | string | 可选 | 限制模型响应的详细程度。较低的值为更简洁的响应,而较高的值会有更详细的响应。目前支持的值为low、medium和high。默认为medium |
reasoning | object | 可选 | |
└ effort | string | 可选 | 当前支持的值有minimal、low、medium和high。减少推理工作量可以加快响应速度,并减少响应中用于推理的标记。默认为medium |
└ summary | string | 可选 | 模型执行的推理的摘要。这对于调试和理解模型的推理过程很有用。auto、concise或之一detailed。 |
stream | boolean | 可选 | 默认为 false 如果设置,则像在 ChatGPT 中一样会发送部分消息增量。标记将以仅数据的服务器发送事件的形式发送,这些事件在可用时,并在 data: [DONE] 消息终止流。Python 代码示例。 |
store | boolean | 可选 | 是否存储生成的模型响应以供以后通过 API 检索。默认为true |
请求示例
json
{
"model": "gpt-5-2025-08-07",
"input": [
{
"role": "user",
"content": [
{
"type": "input_text",
"text": "1+2+3+4+5....9985"
}
]
}
],
"tools": [],
"text": {
"format": {
"type": "text"
},
"verbosity": "medium"
},
"reasoning": {
"effort": "medium",
"summary": "auto"
},
"stream": true,
"store": true
}cURL 示例
bash
curl --location --request POST 'https://az.gptplus5.com/v1/responses' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "gpt-5-2025-08-07",
"input": [
{
"role": "user",
"content": [
{
"type": "input_text",
"text": "1+2+3+4+5....9985"
}
]
}
],
"tools": [],
"text": {
"format": {
"type": "text"
},
"verbosity": "medium"
},
"reasoning": {
"effort": "medium",
"summary": "auto"
},
"stream": true,
"store": true
}'返回响应
🟢200OK
响应 Body
| 参数名 | 类型 | 必需 | 说明 |
|---|---|---|---|
id | string | 必需 | |
object | string | 必需 | |
created | integer | 必需 | |
choices | array[object] | 必需 | |
└ index | integer | 可选 | |
└ message | object | 可选 | |
└ finish_reason | string | 可选 | |
usage | object | 必需 | |
└ prompt_tokens | integer | 必需 | |
└ completion_tokens | integer | 必需 | |
└ total_tokens | integer | 必需 |
响应示例
json
{
"id": "chatcmpl-123",
"object": "chat.completion",
"created": 1677652288,
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "\n\nHello there, how may I assist you today?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 9,
"completion_tokens": 12,
"total_tokens": 21
}
}