Skip to main content
Responses

Create a model response

POST
/openai/v1/responses

Creates a model response. Provide text or image inputs to generate text or JSON outputs. Have the model call your own custom code or use built-in tools like web search or file search to use your own data as input for the model’s response.

Header Parameters
x-ms-user-isolation-keystringoptional
Opaque per-user isolation key used to scope endpoint-scoped data (responses, conversations, sessions) to a specific end user.
Request BodyContent-Type: application/json
metadataOpenAI.Metadata | null
top_logprobsinteger | null
temperaturenumber | null
top_pnumber | null
userstring
This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. A stable identifier for your end-users. Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](/docs/guides/safety-best-practices#safety-identifiers).
safety_identifierstring
A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](/docs/guides/safety-best-practices#safety-identifiers).
prompt_cache_keystring
Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](/docs/guides/prompt-caching).
service_tierenum
Specifies the processing type used for serving the request. - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - If set to '[flex](/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier. - When not set, the default behavior is 'auto'. When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.
autodefaultflexscalepriority
prompt_cache_retentionenum
in_memory24h
previous_response_idstring | null
modelstring
The model deployment to use for the creation of this response.
reasoningOpenAI.Reasoning | null
One of the following:
OpenAI.Reasoning
**gpt-5 and o-series models only** Configuration options for [reasoning models](https://platform.openai.com/docs/guides/reasoning).
null
backgroundboolean | null
max_tool_callsinteger | null
textOpenAI.ResponseTextParam
Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more: - [Text inputs and outputs](/docs/guides/text) - [Structured Outputs](/docs/guides/structured-outputs)
formatjson_schema | text | json_object
An object specifying the format that the model must output. Configuring `{ "type": "json_schema" }` enables Structured Outputs, which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). The default format is `{ "type": "text" }` with no additional options. *Not recommended for gpt-4o and newer models:** Setting to `{ "type": "json_object" }` enables the older JSON mode, which ensures the message the model generates is valid JSON. Using `json_schema` is preferred for models that support it.
verbosityenum
Constrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses. Currently supported values are `low`, `medium`, and `high`.
lowmediumhigh
tools(bing_grounding | fabric_dataagent_preview | sharepoint_grounding_preview | azure_ai_search | openapi | bing_custom_search_preview | browser_automation_preview | azure_function | capture_structured_outputs | a2a_preview | work_iq_preview | fabric_iq_preview | memory_search_preview | toolbox_search_preview | code_interpreter | function | file_search | computer_use_preview | web_search | mcp | image_generation | local_shell | shell | custom | web_search_preview | apply_patch | computer | namespace | tool_search)[]
An array of tools the model may call while generating a response. You can specify which tool to use by setting the `tool_choice` parameter. We support the following categories of tools: - **Built-in tools**: Tools that are provided by OpenAI that extend the model's capabilities, like [web search](/docs/guides/tools-web-search) or [file search](/docs/guides/tools-file-search). Learn more about [built-in tools](/docs/guides/tools). - **MCP Tools**: Integrations with third-party systems via custom MCP servers or predefined connectors such as Google Drive and SharePoint. Learn more about [MCP Tools](/docs/guides/tools-connectors-mcp). - **Function calls (custom tools)**: Functions that are defined by you, enabling the model to call your own code with strongly typed arguments and outputs. Learn more about [function calling](/docs/guides/function-calling). You can also use custom tools to call your own code.
One of the following:
bing_groundingBingGroundingTool
The input definition information for a bing grounding search tool as used to configure an agent.
fabric_dataagent_previewMicrosoftFabricPreviewTool
The input definition information for a Microsoft Fabric tool as used to configure an agent.
sharepoint_grounding_previewSharepointPreviewTool
The input definition information for a sharepoint tool as used to configure an agent.
azure_ai_searchAzureAISearchTool
The input definition information for an Azure AI search tool as used to configure an agent.
openapiOpenApiTool
The input definition information for an OpenAPI tool as used to configure an agent.
bing_custom_search_previewBingCustomSearchPreviewTool
The input definition information for a Bing custom search tool as used to configure an agent.
browser_automation_previewBrowserAutomationPreviewTool
The input definition information for a Browser Automation Tool, as used to configure an Agent.
azure_functionAzureFunctionTool
The input definition information for an Azure Function Tool, as used to configure an Agent.
capture_structured_outputsCaptureStructuredOutputsTool
A tool for capturing structured outputs
a2a_previewA2APreviewTool
An agent implementing the A2A protocol.
work_iq_previewWorkIQPreviewTool
A WorkIQ server-side tool.
fabric_iq_previewFabricIQPreviewTool
A FabricIQ server-side tool.
memory_search_previewMemorySearchPreviewTool
A tool for integrating memories into the agent.
toolbox_search_previewToolboxSearchPreviewTool
A tool for searching over the agent's toolbox. When present, deferred tools are hidden from `tools/list` and only discoverable via `search_tools` queries at runtime.
code_interpreterOpenAI.CodeInterpreterTool
A tool that runs Python code to help generate a response to a prompt.
functionOpenAI.FunctionTool
Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling).
file_searchOpenAI.FileSearchTool
A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).
computer_use_previewOpenAI.ComputerUsePreviewTool
A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
web_searchOpenAI.WebSearchTool
Search the Internet for sources related to the prompt. Learn more about the [web search tool](/docs/guides/tools-web-search).
mcpOpenAI.MCPTool
Give the model access to additional tools via remote Model Context Protocol (MCP) servers. [Learn more about MCP](/docs/guides/tools-remote-mcp).
image_generationOpenAI.ImageGenTool
A tool that generates images using the GPT image models.
local_shellOpenAI.LocalShellToolParam
A tool that allows the model to execute shell commands in a local environment.
shellOpenAI.FunctionShellToolParam
A tool that allows the model to execute shell commands.
customOpenAI.CustomToolParam
A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools)
web_search_previewOpenAI.WebSearchPreviewTool
This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search).
apply_patchOpenAI.ApplyPatchToolParam
Allows the assistant to create, delete, or update files using unified diffs.
computerOpenAI.ComputerTool
A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
namespaceOpenAI.NamespaceToolParam
Groups function/custom tools under a shared namespace.
tool_searchOpenAI.ToolSearchToolParam
Hosted or BYOT tool search configuration for deferred tools.
tool_choiceOpenAI.ToolChoiceOptions | OpenAI.ToolChoiceParam
noneautorequired
One of the following:
OpenAI.ToolChoiceOptionsenum
Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools.
noneautorequired
OpenAI.ToolChoiceParam
How the model should select which tool (or tools) to use when generating a response. See the `tools` parameter to see how to specify which tools the model can call.
promptOpenAI.Prompt
Reference to a prompt template and its variables. [Learn more](/docs/guides/text?api-mode=responses#reusable-prompts).
idstringrequired
The unique identifier of the prompt template to use.
versionstring | null
variablesOpenAI.ResponsePromptVariables | null
truncationenum
autodisabled
inputstring | (message | item_reference | output_message | file_search_call | computer_call | computer_call_output | web_search_call | function_call | function_call_output | tool_search_call | tool_search_output | reasoning | compaction | image_generation_call | code_interpreter_call | local_shell_call | local_shell_call_output | shell_call | shell_call_output | apply_patch_call | apply_patch_call_output | mcp_list_tools | mcp_approval_request | mcp_approval_response | mcp_call | custom_tool_call_output | custom_tool_call)[]
Text, image, or file inputs to the model, used to generate a response. Learn more: - [Text inputs and outputs](/docs/guides/text) - [Image inputs](/docs/guides/images) - [File inputs](/docs/guides/pdf-files) - [Conversation state](/docs/guides/conversation-state) - [Function calling](/docs/guides/function-calling)
One of the following:
string
(message | item_reference | output_message | file_search_call | computer_call | computer_call_output | web_search_call | function_call | function_call_output | tool_search_call | tool_search_output | reasoning | compaction | image_generation_call | code_interpreter_call | local_shell_call | local_shell_call_output | shell_call | shell_call_output | apply_patch_call | apply_patch_call_output | mcp_list_tools | mcp_approval_request | mcp_approval_response | mcp_call | custom_tool_call_output | custom_tool_call)[]
includeenum[] | null
file_search_call.resultsweb_search_call.resultsweb_search_call.action.sourcesmessage.input_image.image_urlcomputer_call_output.output.image_urlcode_interpreter_call.outputsreasoning.encrypted_contentmessage.output_text.logprobsmemory_search_call.results
One of the following:
enum[]
file_search_call.resultsweb_search_call.resultsweb_search_call.action.sourcesmessage.input_image.image_urlcomputer_call_output.output.image_urlcode_interpreter_call.outputsreasoning.encrypted_contentmessage.output_text.logprobsmemory_search_call.results
null
parallel_tool_callsboolean | null
storeboolean | null
instructionsstring | null
streamboolean | null
stream_optionsOpenAI.ResponseStreamOptions | null
One of the following:
OpenAI.ResponseStreamOptions
Options for streaming responses. Only set this when you set `stream: true`.
null
conversationOpenAI.ConversationParam | null
One of the following:
OpenAI.ConversationParamstring | OpenAI.ConversationParam-2
The conversation that this response belongs to. Items from this conversation are prepended to `input_items` for this response request. Input items and output items from this response are automatically added to this conversation after this response completes.
null
context_managementOpenAI.ContextManagementParam[] | null
Context management configuration for this request.
One of the following:
OpenAI.ContextManagementParam[]
null
max_output_tokensinteger | null
agent_referenceAgentReference
The agent to use for generating the response.
typeenumrequired
agent_reference
namestringrequired
The name of the agent.
versionstring
The version identifier of the agent.
structured_inputsobject
The structured inputs to the response that can participate in prompt template substitution or tool argument bindings.
Responses
metadataOpenAI.Metadata | null
top_logprobsinteger | null
temperaturenumber | null
top_pnumber | null
userstring
This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. A stable identifier for your end-users. Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](/docs/guides/safety-best-practices#safety-identifiers).
safety_identifierstring
A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](/docs/guides/safety-best-practices#safety-identifiers).
prompt_cache_keystring
Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](/docs/guides/prompt-caching).
service_tierenum
Specifies the processing type used for serving the request. - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - If set to '[flex](/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier. - When not set, the default behavior is 'auto'. When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.
autodefaultflexscalepriority
prompt_cache_retentionenum
in_memory24h
previous_response_idstring | null
modelstring
The model deployment to use for the creation of this response.
reasoningOpenAI.Reasoning | null
One of the following:
OpenAI.Reasoning
**gpt-5 and o-series models only** Configuration options for [reasoning models](https://platform.openai.com/docs/guides/reasoning).
null
backgroundboolean | null
max_tool_callsinteger | null
textOpenAI.ResponseTextParam
Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more: - [Text inputs and outputs](/docs/guides/text) - [Structured Outputs](/docs/guides/structured-outputs)
formatjson_schema | text | json_object
An object specifying the format that the model must output. Configuring `{ "type": "json_schema" }` enables Structured Outputs, which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). The default format is `{ "type": "text" }` with no additional options. *Not recommended for gpt-4o and newer models:** Setting to `{ "type": "json_object" }` enables the older JSON mode, which ensures the message the model generates is valid JSON. Using `json_schema` is preferred for models that support it.
verbosityenum
Constrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses. Currently supported values are `low`, `medium`, and `high`.
lowmediumhigh
tools(bing_grounding | fabric_dataagent_preview | sharepoint_grounding_preview | azure_ai_search | openapi | bing_custom_search_preview | browser_automation_preview | azure_function | capture_structured_outputs | a2a_preview | work_iq_preview | fabric_iq_preview | memory_search_preview | toolbox_search_preview | code_interpreter | function | file_search | computer_use_preview | web_search | mcp | image_generation | local_shell | shell | custom | web_search_preview | apply_patch | computer | namespace | tool_search)[]
An array of tools the model may call while generating a response. You can specify which tool to use by setting the `tool_choice` parameter. We support the following categories of tools: - **Built-in tools**: Tools that are provided by OpenAI that extend the model's capabilities, like [web search](/docs/guides/tools-web-search) or [file search](/docs/guides/tools-file-search). Learn more about [built-in tools](/docs/guides/tools). - **MCP Tools**: Integrations with third-party systems via custom MCP servers or predefined connectors such as Google Drive and SharePoint. Learn more about [MCP Tools](/docs/guides/tools-connectors-mcp). - **Function calls (custom tools)**: Functions that are defined by you, enabling the model to call your own code with strongly typed arguments and outputs. Learn more about [function calling](/docs/guides/function-calling). You can also use custom tools to call your own code.
One of the following:
bing_groundingBingGroundingTool
The input definition information for a bing grounding search tool as used to configure an agent.
fabric_dataagent_previewMicrosoftFabricPreviewTool
The input definition information for a Microsoft Fabric tool as used to configure an agent.
sharepoint_grounding_previewSharepointPreviewTool
The input definition information for a sharepoint tool as used to configure an agent.
azure_ai_searchAzureAISearchTool
The input definition information for an Azure AI search tool as used to configure an agent.
openapiOpenApiTool
The input definition information for an OpenAPI tool as used to configure an agent.
bing_custom_search_previewBingCustomSearchPreviewTool
The input definition information for a Bing custom search tool as used to configure an agent.
browser_automation_previewBrowserAutomationPreviewTool
The input definition information for a Browser Automation Tool, as used to configure an Agent.
azure_functionAzureFunctionTool
The input definition information for an Azure Function Tool, as used to configure an Agent.
capture_structured_outputsCaptureStructuredOutputsTool
A tool for capturing structured outputs
a2a_previewA2APreviewTool
An agent implementing the A2A protocol.
work_iq_previewWorkIQPreviewTool
A WorkIQ server-side tool.
fabric_iq_previewFabricIQPreviewTool
A FabricIQ server-side tool.
memory_search_previewMemorySearchPreviewTool
A tool for integrating memories into the agent.
toolbox_search_previewToolboxSearchPreviewTool
A tool for searching over the agent's toolbox. When present, deferred tools are hidden from `tools/list` and only discoverable via `search_tools` queries at runtime.
code_interpreterOpenAI.CodeInterpreterTool
A tool that runs Python code to help generate a response to a prompt.
functionOpenAI.FunctionTool
Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling).
file_searchOpenAI.FileSearchTool
A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).
computer_use_previewOpenAI.ComputerUsePreviewTool
A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
web_searchOpenAI.WebSearchTool
Search the Internet for sources related to the prompt. Learn more about the [web search tool](/docs/guides/tools-web-search).
mcpOpenAI.MCPTool
Give the model access to additional tools via remote Model Context Protocol (MCP) servers. [Learn more about MCP](/docs/guides/tools-remote-mcp).
image_generationOpenAI.ImageGenTool
A tool that generates images using the GPT image models.
local_shellOpenAI.LocalShellToolParam
A tool that allows the model to execute shell commands in a local environment.
shellOpenAI.FunctionShellToolParam
A tool that allows the model to execute shell commands.
customOpenAI.CustomToolParam
A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools)
web_search_previewOpenAI.WebSearchPreviewTool
This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search).
apply_patchOpenAI.ApplyPatchToolParam
Allows the assistant to create, delete, or update files using unified diffs.
computerOpenAI.ComputerTool
A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
namespaceOpenAI.NamespaceToolParam
Groups function/custom tools under a shared namespace.
tool_searchOpenAI.ToolSearchToolParam
Hosted or BYOT tool search configuration for deferred tools.
tool_choiceOpenAI.ToolChoiceOptions | OpenAI.ToolChoiceParam
noneautorequired
One of the following:
OpenAI.ToolChoiceOptionsenum
Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools.
noneautorequired
OpenAI.ToolChoiceParam
How the model should select which tool (or tools) to use when generating a response. See the `tools` parameter to see how to specify which tools the model can call.
promptOpenAI.Prompt
Reference to a prompt template and its variables. [Learn more](/docs/guides/text?api-mode=responses#reusable-prompts).
idstringrequired
The unique identifier of the prompt template to use.
versionstring | null
variablesOpenAI.ResponsePromptVariables | null
truncationenum
autodisabled
idstringrequired
Unique identifier for this Response.
objectenumrequired
The object type of this resource - always set to `response`.
response
statusenum
The status of the response generation. One of `completed`, `failed`, `in_progress`, `cancelled`, `queued`, or `incomplete`.
completedfailedin_progresscancelledqueuedincomplete
created_atintegerrequired
Unix timestamp (in seconds) of when this Response was created.
completed_atstring | null
errorOpenAI.ResponseError | nullrequired
One of the following:
OpenAI.ResponseError
An error object returned when the model fails to generate a Response.
null
incomplete_detailsOpenAI.ResponseIncompleteDetails | nullrequired
One of the following:
OpenAI.ResponseIncompleteDetails
null
output(structured_outputs | workflow_action | oauth_consent_request | bing_grounding_call | bing_grounding_call_output | sharepoint_grounding_preview_call | sharepoint_grounding_preview_call_output | azure_ai_search_call | azure_ai_search_call_output | bing_custom_search_preview_call | bing_custom_search_preview_call_output | openapi_call | openapi_call_output | browser_automation_preview_call | browser_automation_preview_call_output | fabric_dataagent_preview_call | fabric_dataagent_preview_call_output | azure_function_call | azure_function_call_output | a2a_preview_call | a2a_preview_call_output | memory_search_call | memory_command_preview_call | memory_command_preview_call_output | output_message | file_search_call | function_call | function_call_output | web_search_call | computer_call | computer_call_output | reasoning | tool_search_call | tool_search_output | compaction | image_generation_call | code_interpreter_call | local_shell_call | local_shell_call_output | shell_call | shell_call_output | apply_patch_call | apply_patch_call_output | mcp_call | mcp_list_tools | mcp_approval_request | mcp_approval_response | custom_tool_call | custom_tool_call_output)[]required
An array of content items generated by the model. - The length and order of items in the `output` array is dependent on the model's response. - Rather than accessing the first item in the `output` array and assuming it's an `assistant` message with the content generated by the model, you might consider using the `output_text` property where supported in SDKs.
One of the following:
structured_outputsStructuredOutputsOutputItem
workflow_actionWorkflowActionOutputItem
oauth_consent_requestOAuthConsentRequestOutputItem
Request from the service for the user to perform OAuth consent.
bing_grounding_callBingGroundingToolCall
A Bing grounding tool call.
bing_grounding_call_outputBingGroundingToolCallOutput
The output of a Bing grounding tool call.
sharepoint_grounding_preview_callSharepointGroundingToolCall
A SharePoint grounding tool call.
sharepoint_grounding_preview_call_outputSharepointGroundingToolCallOutput
The output of a SharePoint grounding tool call.
azure_ai_search_callAzureAISearchToolCall
An Azure AI Search tool call.
azure_ai_search_call_outputAzureAISearchToolCallOutput
The output of an Azure AI Search tool call.
bing_custom_search_preview_callBingCustomSearchToolCall
A Bing custom search tool call.
bing_custom_search_preview_call_outputBingCustomSearchToolCallOutput
The output of a Bing custom search tool call.
openapi_callOpenApiToolCall
An OpenAPI tool call.
openapi_call_outputOpenApiToolCallOutput
The output of an OpenAPI tool call.
browser_automation_preview_callBrowserAutomationToolCall
A browser automation tool call.
browser_automation_preview_call_outputBrowserAutomationToolCallOutput
The output of a browser automation tool call.
fabric_dataagent_preview_callFabricDataAgentToolCall
A Fabric data agent tool call.
fabric_dataagent_preview_call_outputFabricDataAgentToolCallOutput
The output of a Fabric data agent tool call.
azure_function_callAzureFunctionToolCall
An Azure Function tool call.
azure_function_call_outputAzureFunctionToolCallOutput
The output of an Azure Function tool call.
a2a_preview_callA2AToolCall
An A2A (Agent-to-Agent) tool call.
a2a_preview_call_outputA2AToolCallOutput
The output of an A2A (Agent-to-Agent) tool call.
memory_search_callMemorySearchToolCall
A memory search tool call.
memory_command_preview_callMemoryCommandToolCall
A memory command tool call.
memory_command_preview_call_outputMemoryCommandToolCallOutput
The output of a memory command tool call.
output_messageOpenAI.OutputItemOutputMessage
An output message from the model.
file_search_callOpenAI.OutputItemFileSearchToolCall
The results of a file search tool call. See the [file search guide](/docs/guides/tools-file-search) for more information.
function_callOpenAI.OutputItemFunctionToolCall
A tool call to run a function. See the [function calling guide](/docs/guides/function-calling) for more information.
function_call_outputOpenAI.OutputItemFunctionToolCallOutput
The output of a function tool call.
web_search_callOpenAI.OutputItemWebSearchToolCall
The results of a web search tool call. See the [web search guide](/docs/guides/tools-web-search) for more information.
computer_callOpenAI.OutputItemComputerToolCall
A tool call to a computer use tool. See the [computer use guide](/docs/guides/tools-computer-use) for more information.
computer_call_outputOpenAI.OutputItemComputerToolCallOutput
The output of a computer tool call.
reasoningOpenAI.OutputItemReasoningItem
A description of the chain of thought used by a reasoning model while generating a response. Be sure to include these items in your `input` to the Responses API for subsequent turns of a conversation if you are manually [managing context](/docs/guides/conversation-state).
tool_search_callOpenAI.OutputItemToolSearchCall
tool_search_outputOpenAI.OutputItemToolSearchOutput
compactionOpenAI.OutputItemCompactionBody
A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).
image_generation_callOpenAI.OutputItemImageGenToolCall
An image generation request made by the model.
code_interpreter_callOpenAI.OutputItemCodeInterpreterToolCall
A tool call to run code.
local_shell_callOpenAI.OutputItemLocalShellToolCall
A tool call to run a command on the local shell.
local_shell_call_outputOpenAI.OutputItemLocalShellToolCallOutput
The output of a local shell tool call.
shell_callOpenAI.OutputItemFunctionShellCall
A tool call that executes one or more shell commands in a managed environment.
shell_call_outputOpenAI.OutputItemFunctionShellCallOutput
The output of a shell tool call that was emitted.
apply_patch_callOpenAI.OutputItemApplyPatchToolCall
A tool call that applies file diffs by creating, deleting, or updating files.
apply_patch_call_outputOpenAI.OutputItemApplyPatchToolCallOutput
The output emitted by an apply patch tool call.
mcp_callOpenAI.OutputItemMcpToolCall
An invocation of a tool on an MCP server.
mcp_list_toolsOpenAI.OutputItemMcpListTools
A list of tools available on an MCP server.
mcp_approval_requestOpenAI.OutputItemMcpApprovalRequest
A request for human approval of a tool invocation.
mcp_approval_responseOpenAI.OutputItemMcpApprovalResponseResource
A response to an MCP approval request.
custom_tool_callOpenAI.OutputItemCustomToolCallResource
custom_tool_call_outputOpenAI.OutputItemCustomToolCallOutputResource
instructionsstring | (message | item_reference | output_message | file_search_call | computer_call | computer_call_output | web_search_call | function_call | function_call_output | tool_search_call | tool_search_output | reasoning | compaction | image_generation_call | code_interpreter_call | local_shell_call | local_shell_call_output | shell_call | shell_call_output | apply_patch_call | apply_patch_call_output | mcp_list_tools | mcp_approval_request | mcp_approval_response | mcp_call | custom_tool_call_output | custom_tool_call)[] | nullrequired
One of the following:
string
(message | item_reference | output_message | file_search_call | computer_call | computer_call_output | web_search_call | function_call | function_call_output | tool_search_call | tool_search_output | reasoning | compaction | image_generation_call | code_interpreter_call | local_shell_call | local_shell_call_output | shell_call | shell_call_output | apply_patch_call | apply_patch_call_output | mcp_list_tools | mcp_approval_request | mcp_approval_response | mcp_call | custom_tool_call_output | custom_tool_call)[]
null
output_textstring | null
usageOpenAI.ResponseUsage
Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
input_tokensintegerrequired
The number of input tokens.
input_tokens_detailsOpenAI.ResponseUsageInputTokensDetailsrequired
A detailed breakdown of the input tokens.
output_tokensintegerrequired
The number of output tokens.
output_tokens_detailsOpenAI.ResponseUsageOutputTokensDetailsrequired
A detailed breakdown of the output tokens.
total_tokensintegerrequired
The total number of tokens used.
parallel_tool_callsbooleanrequired
Whether to allow the model to run tool calls in parallel.
conversationOpenAI.ConversationReference | null
One of the following:
OpenAI.ConversationReference
The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
null
max_output_tokensinteger | null
agent_referenceAgentReference | nullrequired
The agent used for this response
One of the following:
AgentReference
null
content_filtersContentFilterResult[]
The content filter evaluation results.
blockedbooleanrequired
Whether the content was blocked by the content filter.
source_typestringrequired
The source type of the content filter evaluation (e.g., 'prompt', 'response', 'pre_tool_call', 'post_tool_call').
content_filter_resultsAzureContentFilterResultsForResponsesrequired
The content filter results for this evaluation.
tool_call_idstring
The ID of the tool call associated with this content filter result, if applicable.