type string
Output item type. Possible values:
-
message: Message containing the model's final reply.
-
reasoning: Reasoning output. Returned when reasoning.effort is set to a value other than none or when thinking mode is enabled. Reasoning tokens are counted in output_tokens_details.reasoning_tokens and billed accordingly.
-
function_call: Function call output. Returned when using a custom function tool. You must handle the function call and return a result.
-
web_search_call: Web search call output. Returned when using the web_search tool.
-
code_interpreter_call: Code execution output. Returned when using the code_interpreter tool.
-
web_extractor_call: Web extraction output. Returned when using the web_extractor tool. Must be used together with the web_search tool.
-
web_search_image_call: Text-to-image search call output. Returned when using the web_search_image tool. Contains a list of images found.
-
image_search_call: Image-to-image search call output. Returned when using the image_search tool. Contains a list of similar images found.
-
mcp_call: MCP call output. Returned when using the mcp tool. Contains the result from the MCP service.
-
file_search_call: Knowledge base search call output. Returned when using the file_search tool. Contains retrieval queries and results from the knowledge base.
id string
Unique identifier for the output item. Present for all output types.
role string
Message role. Always assistant. Present only when type is message.
status string
Output item status. Possible values: completed, in_progress. Present when type is not reasoning.
name string
Tool or function name. Present when type is function_call, web_search_image_call, image_search_call, or mcp_call.
For web_search_image_call and image_search_call, the value is fixed as "web_search_image" and "image_search", respectively.
For mcp_call, the value is the specific function name called in the MCP service (for example, amap-maps-maps_geo).
arguments string
Tool call arguments, formatted as a JSON string. Present when type is function_call, web_search_image_call, image_search_call, or mcp_call. Parse it using JSON.parse() before use. Contents vary by tool type:
-
web_search_image_call: {"queries": ["search keyword 1", "search keyword 2"]}. The queries field contains a list of search keywords automatically generated by the model based on user input.
-
image_search_call: {"img_idx": 0, "bbox": [0, 0, 1000, 1000]}. The img_idx field is the index of the input image (starting from 0). The bbox field contains the bounding box coordinates [x1, y1, x2, y2] of the search area, with values ranging from 0 to 1000.
-
function_call: An argument object generated according to the user-defined function parameter schema.
-
mcp_call: An argument object for the function called in the MCP service.
call_id string
Unique identifier for the function call. Present only when type is function_call. Use this ID to associate the request with the response when returning function call results.
content array
Message content array. Present only when type is message.
Array element properties
type string
Content type. Always output_text.
text string
Text content generated by the model.
annotations array
Text annotations. Usually an empty array.
summary array
Reasoning summaries. Present only when type is reasoning. Each element contains a type field (value summary_text) and a text field (the summary text).
action object
Search action information. Present only when type is web_search_call.
Properties
query string
Search query keyword.
type string
Search type. Always search.
sources array
Search sources. Each element contains a type field and a url field.
code string
Code generated and executed by the model. Present only when type is code_interpreter_call.
outputs array
Code execution outputs. Present only when type is code_interpreter_call. Each element contains a type field (value logs) and a logs field (code execution logs).
container_id string
Code interpreter container identifier. Present only when type is code_interpreter_call. Use it to associate multiple code executions within the same session.
goal string
Description of the extraction goal, specifying what information to extract from the webpage. Present only when type is web_extractor_call.
output string
Output result of the tool call, formatted as a string.
-
When type is web_extractor_call, this field contains a summary of the extracted webpage content.
-
When type is web_search_image_call or image_search_call, this field is a JSON string containing an array of image search results. Each result includes a title (image title), url (image URL), and index (ordinal number) field.
-
When type is mcp_call, this field is a JSON string result returned by the MCP service.
urls array
URLs of the webpages extracted. Present only when type is web_extractor_call.
server_label string
MCP service label. Present only when type is mcp_call. Identifies the MCP service used for this call.
queries array
Queries used for knowledge base retrieval. Present only when type is file_search_call. Each element is a search query generated by the model.
results array
Knowledge base retrieval results. Present only when type is file_search_call.
Array element properties
file_id string
File ID of the matched document.
filename string
Filename of the matched document.
score float
Relevance score, ranging from 0 to 1. Higher values indicate greater relevance.
text string
Snippet of the matched document content.