OpenAI 响应格式(Responses)
OpenAI 响应格式(Responses)
OpenAI Responses
📝 简介
💡 请求示例
基础文本响应 ✅
{
"id": "resp_67ccd2bed1ec8190b14f964abc0542670bb6a6b452d3795b",
"object": "response",
"created_at": 1741476542,
"status": "completed",
"error": null,
"incomplete_details": null,
"instructions": null,
"max_output_tokens": null,
"model": "gpt-4.1",
"output": [
{
"type": "message",
"id": "msg_67ccd2bf17f0819081ff3bb2cf6508e60bb6a6b452d3795b",
"status": "completed",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "在一个宁静的月夜下,一只名叫璐米娜的独角兽发现了一个倒映着星星的隐藏水池。当她将独角浸入水中时,水池开始闪烁,显现出通往一个有着无尽夜空的魔法世界的路径。充满好奇,璐米娜为所有做梦的人许下愿望,希望他们能找到自己的隐藏魔法,当她回头望去,她的蹄印像星尘一样闪烁。",
"annotations": []
}
]
}
],
"parallel_tool_calls": true,
"previous_response_id": null,
"reasoning": {
"effort": null,
"summary": null
},
"store": true,
"temperature": 1.0,
"text": {
"format": {
"type": "text"
}
},
"tool_choice": "auto",
"tools": [],
"top_p": 1.0,
"truncation": "disabled",
"usage": {
"input_tokens": 36,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 87,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 123
},
"user": null,
"metadata": {}
}
图像分析响应 ✅
{
"id": "resp_67ccd3a9da748190baa7f1570fe91ac604becb25c45c1d41",
"object": "response",
"created_at": 1741476777,
"status": "completed",
"error": null,
"incomplete_details": null,
"instructions": null,
"max_output_tokens": null,
"model": "gpt-4.1",
"output": [
{
"type": "message",
"id": "msg_67ccd3acc8d48190a77525dc6de64b4104becb25c45c1d41",
"status": "completed",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "这张图片展示了一条木制栈道或小径穿过茂密的绿色草地,上方是点缀着几朵云的蓝天。场景呈现出一个宁静的自然区域,可能是公园或自然保护区。背景中有树木和灌木丛。整个景观展现出和谐的自然环境,栈道为游客提供了一条穿过湿地或草原而不影响周围生态系统的路径。",
"annotations": []
}
]
}
],
"parallel_tool_calls": true,
"previous_response_id": null,
"reasoning": {
"effort": null,
"summary": null
},
"store": true,
"temperature": 1.0,
"text": {
"format": {
"type": "text"
}
},
"tool_choice": "auto",
"tools": [],
"top_p": 1.0,
"truncation": "disabled",
"usage": {
"input_tokens": 328,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 52,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 380
},
"user": null,
"metadata": {}
}
网络搜索工具 ✅
{
"id": "resp_67ccf18ef5fc8190b16dbee19bc54e5f087bb177ab789d5c",
"object": "response",
"created_at": 1741484430,
"status": "completed",
"error": null,
"incomplete_details": null,
"instructions": null,
"max_output_tokens": null,
"model": "gpt-4.1",
"output": [
{
"type": "web_search_call",
"id": "ws_67ccf18f64008190a39b619f4c8455ef087bb177ab789d5c",
"status": "completed"
},
{
"type": "message",
"id": "msg_67ccf190ca3881909d433c50b1f6357e087bb177ab789d5c",
"status": "completed",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "截至今天,2025年3月9日,一则值得关注的积极新闻是中国科学家在可再生能源领域取得重大突破,成功研发出一种新型高效太阳能电池,转化率达到了创纪录的35%,这可能会极大推动清洁能源的普及和应用。这项技术预计将使太阳能发电成本降低约40%,为全球减少碳排放提供了新的解决方案。",
"annotations": [
{
"type": "url_citation",
"start_index": 42,
"end_index": 100,
"url": "https://example.com/renewable-energy-breakthrough/?utm_source=chatgpt.com",
"title": "中国科学家在可再生能源领域取得重大突破"
},
{
"type": "url_citation",
"start_index": 101,
"end_index": 150,
"url": "https://example.com/solar-cell-efficiency-record/?utm_source=chatgpt.com",
"title": "新型高效太阳能电池转化率创纪录"
},
{
"type": "url_citation",
"start_index": 151,
"end_index": 200,
"url": "https://example.com/clean-energy-cost-reduction/?utm_source=chatgpt.com",
"title": "太阳能发电成本有望降低40%"
}
]
}
]
}
],
"parallel_tool_calls": true,
"previous_response_id": null,
"reasoning": {
"effort": null,
"summary": null
},
"store": true,
"temperature": 1.0,
"text": {
"format": {
"type": "text"
}
},
"tool_choice": "auto",
"tools": [
{
"type": "web_search_preview",
"domains": [],
"search_context_size": "medium",
"user_location": {
"type": "approximate",
"city": null,
"country": "US",
"region": null,
"timezone": null
}
}
],
"top_p": 1.0,
"truncation": "disabled",
"usage": {
"input_tokens": 328,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 356,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 684
},
"user": null,
"metadata": {}
}
文件搜索工具 ✅
{
"id": "resp_67ccf4c55fc48190b71bd0463ad3306d09504fb6872380d7",
"object": "response",
"created_at": 1741485253,
"status": "completed",
"error": null,
"incomplete_details": null,
"instructions": null,
"max_output_tokens": null,
"model": "gpt-4.1",
"output": [
{
"type": "file_search_call",
"id": "fs_67ccf4c63cd08190887ef6464ba5681609504fb6872380d7",
"status": "completed",
"queries": [
"古代棕龙的特性和属性"
],
"results": null
},
{
"type": "message",
"id": "msg_67ccf4c93e5c81909d595b369351a9d309504fb6872380d7",
"status": "completed",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "根据资料,古代棕龙具有以下特性和属性:\n\n1. 物理特征:古代棕龙体型庞大,体长可达25-30米,翼展约35米。它们的鳞片呈深棕色至铜色,随着年龄增长会变得更加暗沉。头部有特征性的双角和脊刺,下颚强壮,适合撕裂猎物。\n\n2. 能力:它们能喷吐强力的酸液,对目标造成严重腐蚀伤害。古代棕龙还拥有出色的掘地能力,常在沙漠或山地挖掘复杂的巢穴系统。\n\n3. 智力:被认为是龙族中最为狡猾和有耐心的品种,智力极高,精通多种语言,并具有复杂的战术思维。\n\n4. 栖息地:主要栖息在干旱的山地和沙漠地区,喜欢炎热干燥的环境。\n\n5. 宝藏:古代棕龙以其庞大的宝藏闻名,特别喜爱收集铜币、红宝石和火焰魔法物品。\n\n6. 寿命:是所有龙种中寿命最长的之一,可活2000-2500年,随着年龄增长其力量和魔法能力也会增强。\n\n7. 性格:极度领地意识强,性格暴躁易怒,对侵入者毫不留情,但也以其罕见的耐心著称,能为复仇等待几个世纪。",
"annotations": [
{
"type": "file_citation",
"index": 80,
"file_id": "file-4wDz5b167pAf72nx1h9eiN",
"filename": "dragons.pdf"
},
{
"type": "file_citation",
"index": 233,
"file_id": "file-4wDz5b167pAf72nx1h9eiN",
"filename": "dragons.pdf"
},
{
"type": "file_citation",
"index": 345,
"file_id": "file-4wDz5b167pAf72nx1h9eiN",
"filename": "dragons.pdf"
},
{
"type": "file_citation",
"index": 420,
"file_id": "file-4wDz5b167pAf72nx1h9eiN",
"filename": "dragons.pdf"
},
{
"type": "file_citation",
"index": 520,
"file_id": "file-4wDz5b167pAf72nx1h9eiN",
"filename": "dragons.pdf"
},
{
"type": "file_citation",
"index": 580,
"file_id": "file-4wDz5b167pAf72nx1h9eiN",
"filename": "dragons.pdf"
},
{
"type": "file_citation",
"index": 655,
"file_id": "file-4wDz5b167pAf72nx1h9eiN",
"filename": "dragons.pdf"
},
{
"type": "file_citation",
"index": 781,
"file_id": "file-4wDz5b167pAf72nx1h9eiN",
"filename": "dragons.pdf"
}
]
}
]
}
],
"parallel_tool_calls": true,
"previous_response_id": null,
"reasoning": {
"effort": null,
"summary": null
},
"store": true,
"temperature": 1.0,
"text": {
"format": {
"type": "text"
}
},
"tool_choice": "auto",
"tools": [
{
"type": "file_search",
"filters": null,
"max_num_results": 20,
"ranking_options": {
"ranker": "auto",
"score_threshold": 0.0
},
"vector_store_ids": [
"vs_1234567890"
]
}
],
"top_p": 1.0,
"truncation": "disabled",
"usage": {
"input_tokens": 18307,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 348,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 18655
},
"user": null,
"metadata": {}
}
流式响应 ✅
event: response.created
data: {"type":"response.created","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","created_at":1741290958,"status":"in_progress","error":null,"incomplete_details":null,"instructions":"你是一个有帮助的助手。","max_output_tokens":null,"model":"gpt-4.1-2025-04-14","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}}
event: response.in_progress
data: {"type":"response.in_progress","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","created_at":1741290958,"status":"in_progress","error":null,"incomplete_details":null,"instructions":"你是一个有帮助的助手。","max_output_tokens":null,"model":"gpt-4.1-2025-04-14","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}}
event: response.output_item.added
data: {"type":"response.output_item.added","output_index":0,"item":{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"in_progress","role":"assistant","content":[]}}
event: response.content_part.added
data: {"type":"response.content_part.added","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"part":{"type":"output_text","text":"","annotations":[]}}
event: response.output_text.delta
data: {"type":"response.output_text.delta","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"delta":"你好"}
event: response.output_text.delta
data: {"type":"response.output_text.delta","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"delta":"!"}
event: response.output_text.delta
data: {"type":"response.output_text.delta","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"delta":" 我"}
event: response.output_text.delta
data: {"type":"response.output_text.delta","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"delta":"能"}
event: response.output_text.delta
data: {"type":"response.output_text.delta","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"delta":"为"}
event: response.output_text.delta
data: {"type":"response.output_text.delta","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"delta":"您"}
event: response.output_text.delta
data: {"type":"response.output_text.delta","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"delta":"提供"}
event: response.output_text.delta
data: {"type":"response.output_text.delta","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"delta":"什么"}
event: response.output_text.delta
data: {"type":"response.output_text.delta","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"delta":"帮助"}
event: response.output_text.delta
data: {"type":"response.output_text.delta","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"delta":"吗"}
event: response.output_text.delta
data: {"type":"response.output_text.delta","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"delta":"?"}
event: response.output_text.done
data: {"type":"response.output_text.done","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"text":"你好! 我能为您提供什么帮助吗?"}
event: response.content_part.done
data: {"type":"response.content_part.done","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"part":{"type":"output_text","text":"你好! 我能为您提供什么帮助吗?","annotations":[]}}
event: response.output_item.done
data: {"type":"response.output_item.done","output_index":0,"item":{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"completed","role":"assistant","content":[{"type":"output_text","text":"你好! 我能为您提供什么帮助吗?","annotations":[]}]}}
event: response.completed
data: {"type":"response.completed","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","created_at":1741290958,"status":"completed","error":null,"incomplete_details":null,"instructions":"你是一个有帮助的助手。","max_output_tokens":null,"model":"gpt-4.1-2025-04-14","output":[{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"completed","role":"assistant","content":[{"type":"output_text","text":"你好! 我能为您提供什么帮助吗?","annotations":[]}]}],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":37,"output_tokens":11,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":48},"user":null,"metadata":{}}}
函数调用 ✅
{
"id": "resp_67ca09c5efe0819096d0511c92b8c890096610f474011cc0",
"object": "response",
"created_at": 1741294021,
"status": "completed",
"error": null,
"incomplete_details": null,
"instructions": null,
"max_output_tokens": null,
"model": "gpt-4.1-2025-04-14",
"output": [
{
"type": "function_call",
"id": "fc_67ca09c6bedc8190a7abfec07b1a1332096610f474011cc0",
"call_id": "call_unLAR8MvFNptuiZK6K6HCy5k",
"name": "get_current_weather",
"arguments": "{\"location\":\"波士顿, MA\",\"unit\":\"celsius\"}",
"status": "completed"
}
],
"parallel_tool_calls": true,
"previous_response_id": null,
"reasoning": {
"effort": null,
"summary": null
},
"store": true,
"temperature": 1.0,
"text": {
"format": {
"type": "text"
}
},
"tool_choice": "auto",
"tools": [
{
"type": "function",
"description": "获取指定位置的当前天气",
"name": "get_current_weather",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "城市和州,例如 San Francisco, CA"
},
"unit": {
"type": "string",
"enum": [
"celsius",
"fahrenheit"
]
}
},
"required": [
"location",
"unit"
]
},
"strict": true
}
],
"top_p": 1.0,
"truncation": "disabled",
"usage": {
"input_tokens": 291,
"output_tokens": 23,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 314
},
"user": null,
"metadata": {}
}
推理能力 ✅
{
"id": "resp_67ccd7eca01881908ff0b5146584e408072912b2993db808",
"object": "response",
"created_at": 1741477868,
"status": "completed",
"error": null,
"incomplete_details": null,
"instructions": null,
"max_output_tokens": null,
"model": "o1-2024-12-17",
"output": [
{
"type": "message",
"id": "msg_67ccd7f7b5848190a6f3e95d809f6b44072912b2993db808",
"status": "completed",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "这是一个源自英文绕口令"How much wood would a woodchuck chuck if a woodchuck could chuck wood"的问题。在现实中,啄木鸟(woodpecker)和土拨鼠(woodchuck)是不同的动物,而且土拨鼠实际上并不"啄(chuck)"木头。\n\n从科学角度看,啄木鸟每天确实会啄树木以寻找食物、建造巢穴或进行通讯。一只啄木鸟平均每天可能啄树约8000-12000次,视物种和具体目的而定。如果我们将这转换为木材量,假设每次啄击移除约0.1-0.2立方厘米的木材,那么一只啄木鸟理论上每天可能移除约800-2400立方厘米的木材。\n\n然而,啄木鸟主要是为了觅食和筑巢而啄木,而不是单纯地移除木材,所以这个计算只是一个有趣的理论估算。",
"annotations": []
}
]
}
],
"parallel_tool_calls": true,
"previous_response_id": null,
"reasoning": {
"effort": "high",
"summary": null
},
"store": true,
"temperature": 1.0,
"text": {
"format": {
"type": "text"
}
},
"tool_choice": "auto",
"tools": [],
"top_p": 1.0,
"truncation": "disabled",
"usage": {
"input_tokens": 81,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 1035,
"output_tokens_details": {
"reasoning_tokens": 832
},
"total_tokens": 1116
},
"user": null,
"metadata": {}
}
📮 请求
端点
POST /v1/responses
鉴权方法
Authorization: Bearer $NEWAPI_API_KEY
$NEWAPI_API_KEY
是您的 API 密钥。请求体参数
input
必需: 是
可能的类型
类型 | 描述 |
---|---|
字符串 | 文本输入,相当于具有用户角色的文本输入 |
输入项数组 | 包含不同内容类型的一个或多个输入项列表 |
输入消息对象
属性 | 类型 | 必需 | 描述 |
---|---|---|---|
content | 字符串或数组 | 是 | 提供给模型的文本、图像或音频输入,用于生成响应。也可以包含之前的助手响应 |
role | 字符串 | 是 | 输入消息的角色。可选值:user 、assistant 、system 或 developer |
type | 字符串 | 否 | 输入消息的类型,始终为 message |
内容项类型
文本输入
属性 | 类型 | 必需 | 描述 |
---|---|---|---|
text | 字符串 | 是 | 提供给模型的文本输入 |
type | 字符串 | 是 | 输入项的类型,始终为 input_text |
图像输入
属性 | 类型 | 必需 | 描述 |
---|---|---|---|
detail | 字符串 | 是 | 要发送给模型的图像的详细级别。可选值:high 、low 或 auto 。默认为 auto |
type | 字符串 | 是 | 输入项的类型,始终为 input_image |
file_id | 字符串 | 否 | 要发送给模型的文件ID |
image_url | 字符串 | 否 | 要发送给模型的图像URL。可以是完整的URL或数据URL中的base64编码图像 |
文件输入
属性 | 类型 | 必需 | 描述 |
---|---|---|---|
type | 字符串 | 是 | 输入项的类型,始终为 input_file |
file_data | 字符串 | 否 | 要发送给模型的文件内容 |
file_id | 字符串 | 否 | 要发送给模型的文件ID |
filename | 字符串 | 否 | 要发送给模型的文件名 |
输出项类型
输出文本
属性 | 类型 | 必需 | 描述 |
---|---|---|---|
text | 字符串 | 是 | 模型生成的文本输出 |
type | 字符串 | 是 | 输出项的类型,始终为 output_text |
annotations | 数组 | 是 | 文本输出的注释 |
注释类型
属性 | 类型 | 必需 | 描述 |
---|---|---|---|
file_id | 字符串 | 是 | 文件的ID |
index | 整数 | 是 | 文件在文件列表中的索引 |
type | 字符串 | 是 | 文件引用的类型,始终为 file_citation |
属性 | 类型 | 必需 | 描述 |
---|---|---|---|
end_index | 整数 | 是 | URL引用在消息中的最后一个字符的索引 |
start_index | 整数 | 是 | URL引用在消息中的第一个字符的索引 |
title | 字符串 | 是 | 网络资源的标题 |
type | 字符串 | 是 | URL引用的类型,始终为 url_citation |
url | 字符串 | 是 | 网络资源的URL |
属性 | 类型 | 必需 | 描述 |
---|---|---|---|
file_id | 字符串 | 是 | 文件的ID |
index | 整数 | 是 | 文件在文件列表中的索引 |
type | 字符串 | 是 | 文件路径的类型,始终为 file_path |
拒绝响应
属性 | 类型 | 必需 | 描述 |
---|---|---|---|
refusal | 字符串 | 是 | 模型的拒绝解释 |
type | 字符串 | 是 | 拒绝的类型,始终为 refusal |
工具调用类型
文件搜索工具调用
属性 | 类型 | 必需 | 描述 |
---|---|---|---|
id | 字符串 | 是 | 文件搜索工具调用的唯一ID |
queries | 数组 | 是 | 用于搜索文件的查询 |
status | 字符串 | 是 | 文件搜索工具调用的状态。可能值包括:in_progress 、searching 、incomplete 或 failed |
type | 字符串 | 是 | 文件搜索工具调用 的类型,始终为 file_search_call |
results | 数组或null | 否 | 文件搜索工具调用的结果 |
网络搜索工具调用
属性 | 类型 | 必需 | 描述 |
---|---|---|---|
id | 字符串 | 是 | 网络搜索工具调用的唯一ID |
status | 字符串 | 是 | 网络搜索工具调用的状态 |
type | 字符串 | 是 | 网络搜索工具调用的类型,始终为 web_search_call |
函数工具调用
属性 | 类型 | 必需 | 描述 |
---|---|---|---|
arguments | 字符串 | 是 | 传递给函数的参数的JSON字符串 |
call_id | 字符串 | 是 | 模型生成的函数工具调用的唯一ID |
name | 字符串 | 是 | 要运行的函数的名称 |
type | 字符串 | 是 | 函数工具调用的类型,始终为 function_call |
id | 字符串 | 否 | 函数工具调用的唯一ID |
status | 字符串 | 否 | 项目的状态。可能值:in_progress 、completed 或incomplete |
计算机工具调用
属性 | 类型 | 必需 | 描述 |
---|---|---|---|
action | 对象 | 是 | 计算机交互的操作,如点击、拖拽等 |
call_id | 字符串 | 是 | 响应工具调用输出时使用的标识符 |
id | 字符串 | 是 | 计算机调用的唯一ID |
pending_safety_checks | 数组 | 是 | 计算机调用的待处理安全检查 |
status | 字符串 | 是 | 项目的状态。可能值:in_progress 、completed 或incomplete |
type | 字符串 | 是 | 计算机调用的类型,始终为 computer_call |
操作类型 | 描述 |
---|---|
click | 鼠标点击操作 |
double_click | 鼠标双击操作 |
drag | 拖拽操作 |
keypress | 按键操作 |
move | 鼠标移动操作 |
screenshot | 屏幕截图操作 |
scroll | 滚动操作 |
type | 文本输入操作 |
wait | 等待操作 |
计算机工具调用输出
属性 | 类型 | 必需 | 描述 |
---|---|---|---|
call_id | 字符串 | 是 | 产生输出的计算机工具调用的ID |
output | 对象 | 是 | 用于计算机使用工具的计算机屏幕截图图像 |
type | 字符串 | 是 | 计算机工具调用输出的类型,始终为 computer_call_output |
acknowledged_safety_checks | 数组 | 否 | API报告的已被开发者确认的安全检查 |
id | 字符串 | 否 | 计算机工具调用输出的ID |
status | 字符串 | 否 | 输入消息的状态。可能值:in_progress 、completed 或incomplete |
函数工具调用输出
属性 | 类型 | 必需 | 描述 |
---|---|---|---|
call_id | 字符串 | 是 | 模型生成的函数工具调用的唯一ID |
output | 字符串 | 是 | 函数工具调用输出的JSON字符串 |
type | 字符串 | 是 | 函数工具调用输出的类型,始终为 function_call_output |
id | 字符串 | 否 | 函数工具调用输出的唯一ID |
status | 字符串 | 否 | 项目的状态。可能值:in_progress 、completed 或incomplete |
推理相关项
属性 | 类型 | 必需 | 描述 |
---|---|---|---|
id | 字符串 | 是 | 推理内容的唯一标识符 |
summary | 数组 | 是 | 推理文本内容 |
type | 字符串 | 是 | 对象的类型,始终为 reasoning |
encrypted_content | 字符串或null | 否 | 推理项的加密内容 - 当使用 reasoning.encrypted_content 包含参数生成响应时填充 |
status | 字符串 | 否 | 项目的状态。可能值:in_progress 、completed 或incomplete |
属性 | 类型 | 必需 | 描述 |
---|---|---|---|
text | 字符串 | 是 | 模型生成响应时使用的推理的简短摘要 |
type | 字符串 | 是 | 对象的类型,始终为 summary_text |
项目引用
属性 | 类型 | 必需 | 描述 |
---|---|---|---|
id | 字符串 | 是 | 要引用的项目的ID |
type | 字符串 | 否 | 要引用的项目类型,始终为 item_reference |
model
必需: 是
include
必需: 否
值 | 描述 |
---|---|
file_search_call.results | 包含文件搜索工具调用的搜索结果 |
message.input_image.image_url | 包含输入消息中的图像URL |
computer_call_output.output.image_url | 包含电脑调用输出中的图像URL |
reasoning.encrypted_content | 在推理项输出中包含推理标记的加密版本 |
instructions
必需: 否
previous_response_id
一起使用时,前一个响应中的指令不会被带到下一个响应。这使得在新响应中轻松切换系统(开发者)消息变得简单。max_output_tokens
必需: 否
metadata
必需: 否
parallel_tool_calls
必需: 否
默认值: true
previous_response_id
必需: 否