Responses
Generate a model response
Retrieve a model response
Delete a model response
ModelsExpand Collapse
class Response: …
Items the model generated, in order.
Items the model generated, in order.
Item type, such as message, reasoning, function_call, mcp_call, file_search_call, web_search_call, code_execution_call, tool_search_call or tool_search_output. Fields beyond the ones listed depend on the type. On a self-improving stack, the model can search with tool_retriever for hosted MCP tools that were not loaded up front; each search is a tool_search_call followed by a tool_search_output.
Status of the item, such as completed or in_progress. A code_execution_call is completed, failed or timed_out.
Name of the tool called, on function_call, mcp_call and mcp_approval_request items.
arguments: Optional[Union[str, Dict[str, object], null]]JSON-encoded arguments for the tool, on function_call, mcp_call and mcp_approval_request items. On a tool_search_call item, the search as an object, e.g. {"query": "search Slack messages"}.
JSON-encoded arguments for the tool, on function_call, mcp_call and mcp_approval_request items. On a tool_search_call item, the search as an object, e.g. {"query": "search Slack messages"}.
Identifier to answer a function_call with: send it back as the call_id of a function_call_output input item. On tool_search_call and tool_search_output items, it pairs a search with its result.
Label of the MCP server, on mcp_call, mcp_approval_request and mcp_list_tools items.
execution: Optional[Literal["server", "client"]]Where a tool search ran, on tool_search_call and tool_search_output items. Searches Adaption runs are server.
Where a tool search ran, on tool_search_call and tool_search_output items. Searches Adaption runs are server.
The approval request this mcp_call answers, if it needed approval.
Tools the server offers, on an mcp_list_tools item. On a tool_search_output item, the tools the search loaded, as function definitions.
Summary parts of a reasoning item, each with type and text.
Opaque reasoning state to replay in a later request, on a reasoning item.
The search on a web_search_call item: type, query, queries and sources (the result URLs).
Matched chunks on a file_search_call item, or search results on a web_search_call item (citation_id, title, url, and when available summary, highlights, published_date, author). Send the item back unchanged to replay it without a new search.
Sandbox session of a code_execution_call item. Send it as the session_id of a code_execution tool to keep its files.
language: Optional[Literal["python", "javascript", "typescript", "bash"]]Language of the code, on a code_execution_call item.
Language of the code, on a code_execution_call item.
The text of every output_text part in output, joined. Reasoning and tool calls are excluded.
class ResponseOutputItem: …
Item type, such as message, reasoning, function_call, mcp_call, file_search_call, web_search_call, code_execution_call, tool_search_call or tool_search_output. Fields beyond the ones listed depend on the type. On a self-improving stack, the model can search with tool_retriever for hosted MCP tools that were not loaded up front; each search is a tool_search_call followed by a tool_search_output.
Status of the item, such as completed or in_progress. A code_execution_call is completed, failed or timed_out.
Name of the tool called, on function_call, mcp_call and mcp_approval_request items.
arguments: Optional[Union[str, Dict[str, object], null]]JSON-encoded arguments for the tool, on function_call, mcp_call and mcp_approval_request items. On a tool_search_call item, the search as an object, e.g. {"query": "search Slack messages"}.
JSON-encoded arguments for the tool, on function_call, mcp_call and mcp_approval_request items. On a tool_search_call item, the search as an object, e.g. {"query": "search Slack messages"}.
Identifier to answer a function_call with: send it back as the call_id of a function_call_output input item. On tool_search_call and tool_search_output items, it pairs a search with its result.
Label of the MCP server, on mcp_call, mcp_approval_request and mcp_list_tools items.
execution: Optional[Literal["server", "client"]]Where a tool search ran, on tool_search_call and tool_search_output items. Searches Adaption runs are server.
Where a tool search ran, on tool_search_call and tool_search_output items. Searches Adaption runs are server.
The approval request this mcp_call answers, if it needed approval.
Tools the server offers, on an mcp_list_tools item. On a tool_search_output item, the tools the search loaded, as function definitions.
Summary parts of a reasoning item, each with type and text.
Opaque reasoning state to replay in a later request, on a reasoning item.
The search on a web_search_call item: type, query, queries and sources (the result URLs).
Matched chunks on a file_search_call item, or search results on a web_search_call item (citation_id, title, url, and when available summary, highlights, published_date, author). Send the item back unchanged to replay it without a new search.
Sandbox session of a code_execution_call item. Send it as the session_id of a code_execution tool to keep its files.
language: Optional[Literal["python", "javascript", "typescript", "bash"]]Language of the code, on a code_execution_call item.
Language of the code, on a code_execution_call item.
class ResponseStreamEvent: …
Event type, such as response.created, response.output_text.delta or response.completed. Fields beyond the ones listed depend on the type.
response: Optional[Response]The response so far, on response.* lifecycle events.
The response so far, on response.* lifecycle events.
Items the model generated, in order.
Items the model generated, in order.
Item type, such as message, reasoning, function_call, mcp_call, file_search_call, web_search_call, code_execution_call, tool_search_call or tool_search_output. Fields beyond the ones listed depend on the type. On a self-improving stack, the model can search with tool_retriever for hosted MCP tools that were not loaded up front; each search is a tool_search_call followed by a tool_search_output.
Status of the item, such as completed or in_progress. A code_execution_call is completed, failed or timed_out.
Name of the tool called, on function_call, mcp_call and mcp_approval_request items.
arguments: Optional[Union[str, Dict[str, object], null]]JSON-encoded arguments for the tool, on function_call, mcp_call and mcp_approval_request items. On a tool_search_call item, the search as an object, e.g. {"query": "search Slack messages"}.
JSON-encoded arguments for the tool, on function_call, mcp_call and mcp_approval_request items. On a tool_search_call item, the search as an object, e.g. {"query": "search Slack messages"}.
Identifier to answer a function_call with: send it back as the call_id of a function_call_output input item. On tool_search_call and tool_search_output items, it pairs a search with its result.
Label of the MCP server, on mcp_call, mcp_approval_request and mcp_list_tools items.
execution: Optional[Literal["server", "client"]]Where a tool search ran, on tool_search_call and tool_search_output items. Searches Adaption runs are server.
Where a tool search ran, on tool_search_call and tool_search_output items. Searches Adaption runs are server.
The approval request this mcp_call answers, if it needed approval.
Tools the server offers, on an mcp_list_tools item. On a tool_search_output item, the tools the search loaded, as function definitions.
Summary parts of a reasoning item, each with type and text.
Opaque reasoning state to replay in a later request, on a reasoning item.
The search on a web_search_call item: type, query, queries and sources (the result URLs).
Matched chunks on a file_search_call item, or search results on a web_search_call item (citation_id, title, url, and when available summary, highlights, published_date, author). Send the item back unchanged to replay it without a new search.
Sandbox session of a code_execution_call item. Send it as the session_id of a code_execution tool to keep its files.
language: Optional[Literal["python", "javascript", "typescript", "bash"]]Language of the code, on a code_execution_call item.
Language of the code, on a code_execution_call item.
The text of every output_text part in output, joined. Reasoning and tool calls are excluded.
item: Optional[ResponseOutputItem]The output item, on response.output_item.* events.
The output item, on response.output_item.* events.
Item type, such as message, reasoning, function_call, mcp_call, file_search_call, web_search_call, code_execution_call, tool_search_call or tool_search_output. Fields beyond the ones listed depend on the type. On a self-improving stack, the model can search with tool_retriever for hosted MCP tools that were not loaded up front; each search is a tool_search_call followed by a tool_search_output.
Status of the item, such as completed or in_progress. A code_execution_call is completed, failed or timed_out.
Name of the tool called, on function_call, mcp_call and mcp_approval_request items.
arguments: Optional[Union[str, Dict[str, object], null]]JSON-encoded arguments for the tool, on function_call, mcp_call and mcp_approval_request items. On a tool_search_call item, the search as an object, e.g. {"query": "search Slack messages"}.
JSON-encoded arguments for the tool, on function_call, mcp_call and mcp_approval_request items. On a tool_search_call item, the search as an object, e.g. {"query": "search Slack messages"}.
Identifier to answer a function_call with: send it back as the call_id of a function_call_output input item. On tool_search_call and tool_search_output items, it pairs a search with its result.
Label of the MCP server, on mcp_call, mcp_approval_request and mcp_list_tools items.
execution: Optional[Literal["server", "client"]]Where a tool search ran, on tool_search_call and tool_search_output items. Searches Adaption runs are server.
Where a tool search ran, on tool_search_call and tool_search_output items. Searches Adaption runs are server.
The approval request this mcp_call answers, if it needed approval.
Tools the server offers, on an mcp_list_tools item. On a tool_search_output item, the tools the search loaded, as function definitions.
Summary parts of a reasoning item, each with type and text.
Opaque reasoning state to replay in a later request, on a reasoning item.
The search on a web_search_call item: type, query, queries and sources (the result URLs).
Matched chunks on a file_search_call item, or search results on a web_search_call item (citation_id, title, url, and when available summary, highlights, published_date, author). Send the item back unchanged to replay it without a new search.
Sandbox session of a code_execution_call item. Send it as the session_id of a code_execution tool to keep its files.
language: Optional[Literal["python", "javascript", "typescript", "bash"]]Language of the code, on a code_execution_call item.
Language of the code, on a code_execution_call item.