Responses
Run OpenAI Responses API (OpenAI only)
ModelsExpand Collapse
type ApplyPatchCall struct{…}A tool call representing a request to create, delete, or update files using diff patches.
A tool call representing a request to create, delete, or update files using diff patches.
Operation ApplyPatchCallOperationUnionInstruction for creating a new file via the apply_patch tool.
Instruction for creating a new file via the apply_patch tool.
type ComputerTool struct{…}A tool that controls a virtual computer.
Learn more about the computer tool.
A tool that controls a virtual computer.
Learn more about the computer tool.
type CustomTool struct{…}A custom tool that processes input using a specified format.
Learn more about custom tools
A custom tool that processes input using a specified format.
Learn more about custom tools
type EasyInputMessage struct{…}A message input to the model with a role indicating instruction following
hierarchy. Instructions given with the developer or system role take
precedence over instructions given with the user role. Messages with the
assistant role are presumed to have been generated by the model in previous
interactions.
A message input to the model with a role indicating instruction following
hierarchy. Instructions given with the developer or system role take
precedence over instructions given with the user role. Messages with the
assistant role are presumed to have been generated by the model in previous
interactions.
Content EasyInputMessageContentUnion
type EasyInputMessageContentInputItems []EasyInputMessageContentInputItemUnion
type OpenAIResponseInputImage struct{…}An image input to the model.
Learn about image inputs.
An image input to the model.
Learn about image inputs.
type FileSearchTool struct{…}A tool that searches for relevant content from uploaded files.
Learn more about the file search tool.
A tool that searches for relevant content from uploaded files.
Learn more about the file search tool.
Filters FileSearchToolFiltersUnionOptionalA filter used to compare a specified attribute key to a given value using a defined comparison operation.
A filter used to compare a specified attribute key to a given value using a defined comparison operation.
type FileSearchToolFiltersComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
A filter used to compare a specified attribute key to a given value using a defined comparison operation.
type FileSearchToolFiltersCompoundFilter struct{…}Combine multiple filters using and or or.
Combine multiple filters using and or or.
Filters []FileSearchToolFiltersCompoundFilterFilter
type FileSearchToolFiltersCompoundFilterFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
A filter used to compare a specified attribute key to a given value using a defined comparison operation.
Type string
RankingOptions FileSearchToolRankingOptionsOptionalRanking options for search.
Ranking options for search.
type FunctionShellTool struct{…}A tool that allows the model to execute shell commands.
A tool that allows the model to execute shell commands.
Environment FunctionShellToolEnvironmentUnionOptional
type FunctionShellToolEnvironmentContainerAuto struct{…}
MemoryLimit stringOptional
type FunctionTool struct{…}Defines a function in your own code the model can choose to call.
Learn more about function calling.
Defines a function in your own code the model can choose to call.
Learn more about function calling.
type OpenAIResponse struct{…}
Model OpenAIResponseModel
type OpenAIResponseModel string
Output []OpenAIResponseOutputUnion
type OpenAIResponseOutputMessage struct{…}An output message from the model.
An output message from the model.
Content []OpenAIResponseOutputMessageContentUnion
type OpenAIResponseOutputText struct{…}A text output from the model.
A text output from the model.
Annotations []OpenAIResponseOutputTextAnnotationUnion
type OpenAIResponseOutputTextAnnotationAnnotationURLCitation struct{…}A citation for a web resource used to generate a model response.
A citation for a web resource used to generate a model response.
type OpenAIResponseFileSearchToolCall struct{…}The results of a file search tool call.
See the
file search guide for more information.
The results of a file search tool call.
See the file search guide for more information.
Status OpenAIResponseFileSearchToolCallStatus
type OpenAIResponseFunctionToolCall struct{…}A tool call to run a function.
See the
function calling guide for more information.
A tool call to run a function.
See the function calling guide for more information.
type OpenAIResponseFunctionWebSearch struct{…}The results of a web search tool call.
See the
web search guide for more information.
The results of a web search tool call.
See the web search guide for more information.
Action OpenAIResponseFunctionWebSearchActionUnionAction type “search” - Performs a web search query.
Action type “search” - Performs a web search query.
Status OpenAIResponseFunctionWebSearchStatus
type OpenAIResponseComputerToolCall struct{…}A tool call to a computer use tool.
See the
computer use guide for more information.
A tool call to a computer use tool.
See the computer use guide for more information.
Action OpenAIResponseComputerToolCallActionUnionA click action.
A click action.
type OpenAIResponseComputerToolCallActionActionClick struct{…}A click action.
A click action.
Button string
type OpenAIResponseComputerToolCallActionActionKeypress struct{…}A collection of keypresses the model would like to perform.
A collection of keypresses the model would like to perform.
type OpenAIResponseReasoningItem struct{…}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.
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.
type ResponseCompactionItem struct{…}A compaction item generated by the v1/responses/compact API.
A compaction item generated by the v1/responses/compact API.
type OpenAITypesResponsesResponseOutputItemImageGenerationCall struct{…}An image generation request made by the model.
An image generation request made by the model.
Status OpenAITypesResponsesResponseOutputItemImageGenerationCallStatus
type OpenAIResponseCodeInterpreterToolCall struct{…}A tool call to run code.
A tool call to run code.
Status OpenAIResponseCodeInterpreterToolCallStatus
type OpenAITypesResponsesResponseOutputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
A tool call to run a command on the local shell.
Action OpenAITypesResponsesResponseOutputItemLocalShellCallActionExecute a shell command on the server.
Execute a shell command on the server.
Status OpenAITypesResponsesResponseOutputItemLocalShellCallStatus
type ResponseFunctionShellToolCall struct{…}A tool call that executes one or more shell commands in a managed environment.
A tool call that executes one or more shell commands in a managed environment.
Action ResponseFunctionShellToolCallActionThe shell commands and limits that describe how to run the tool call.
The shell commands and limits that describe how to run the tool call.
Status ResponseFunctionShellToolCallStatus
type ResponseFunctionShellToolCallOutput struct{…}The output of a shell tool call that was emitted.
The output of a shell tool call that was emitted.
Output []ResponseFunctionShellToolCallOutputOutput
type ResponseApplyPatchToolCall struct{…}A tool call that applies file diffs by creating, deleting, or updating files.
A tool call that applies file diffs by creating, deleting, or updating files.
Operation ResponseApplyPatchToolCallOperationUnionInstruction describing how to create a file via the apply_patch tool.
Instruction describing how to create a file via the apply_patch tool.
type ResponseApplyPatchToolCallOutput struct{…}The output emitted by an apply patch tool call.
The output emitted by an apply patch tool call.
type OpenAITypesResponsesResponseOutputItemMcpCall struct{…}An invocation of a tool on an MCP server.
An invocation of a tool on an MCP server.
Status OpenAITypesResponsesResponseOutputItemMcpCallStatusOptional
type OpenAITypesResponsesResponseOutputItemMcpListTools struct{…}A list of tools available on an MCP server.
A list of tools available on an MCP server.
ToolChoice OpenAIResponseToolChoiceUnionConstrains the tools available to the model to a pre-defined set.
Constrains the tools available to the model to a pre-defined set.
type ToolChoiceTypes struct{…}Indicates that the model should use a built-in tool to generate a response.
Learn more about built-in tools.
Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
type ToolChoiceMcp struct{…}Use this option to force the model to call a specific tool on a remote MCP server.
Use this option to force the model to call a specific tool on a remote MCP server.
Tools []OpenAIResponseToolUnion
type FunctionTool struct{…}Defines a function in your own code the model can choose to call.
Learn more about function calling.
Defines a function in your own code the model can choose to call.
Learn more about function calling.
type FileSearchTool struct{…}A tool that searches for relevant content from uploaded files.
Learn more about the file search tool.
A tool that searches for relevant content from uploaded files.
Learn more about the file search tool.
Filters FileSearchToolFiltersUnionOptionalA filter used to compare a specified attribute key to a given value using a defined comparison operation.
A filter used to compare a specified attribute key to a given value using a defined comparison operation.
type FileSearchToolFiltersComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
A filter used to compare a specified attribute key to a given value using a defined comparison operation.
type FileSearchToolFiltersCompoundFilter struct{…}Combine multiple filters using and or or.
Combine multiple filters using and or or.
Filters []FileSearchToolFiltersCompoundFilterFilter
type FileSearchToolFiltersCompoundFilterFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
A filter used to compare a specified attribute key to a given value using a defined comparison operation.
Type string
RankingOptions FileSearchToolRankingOptionsOptionalRanking options for search.
Ranking options for search.
type ComputerTool struct{…}A tool that controls a virtual computer.
Learn more about the computer tool.
A tool that controls a virtual computer.
Learn more about the computer tool.
type WebSearchTool struct{…}Search the Internet for sources related to the prompt.
Learn more about the
web search tool.
Search the Internet for sources related to the prompt.
Learn more about the web search tool.
type OpenAIResponseToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol
(MCP) servers. Learn more about MCP.
Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
AllowedTools OpenAIResponseToolMcpAllowedToolsUnionOptionalA filter object to specify which tools are allowed.
A filter object to specify which tools are allowed.
ConnectorID stringOptional
RequireApproval OpenAIResponseToolMcpRequireApprovalUnionOptionalSpecify which of the MCP server’s tools require approval.
Can be
always, never, or a filter object associated with tools
that require approval.
Specify which of the MCP server’s tools require approval.
Can be
always, never, or a filter object associated with tools
that require approval.
type OpenAIResponseToolMcpRequireApprovalMcpRequireApprovalMcpToolApprovalFilter struct{…}Specify which of the MCP server’s tools require approval.
Can be
always, never, or a filter object associated with tools
that require approval.
Specify which of the MCP server’s tools require approval.
Can be
always, never, or a filter object associated with tools
that require approval.
type OpenAIResponseToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
A tool that runs Python code to help generate a response to a prompt.
Container OpenAIResponseToolCodeInterpreterContainerUnionConfiguration for a code interpreter container.
Optionally specify the IDs of the files to run the code on.
Configuration for a code interpreter container.
Optionally specify the IDs of the files to run the code on.
type OpenAIResponseToolCodeInterpreterContainerCodeInterpreterContainerCodeInterpreterToolAuto struct{…}Configuration for a code interpreter container.
Optionally specify the IDs of the files to run the code on.
Configuration for a code interpreter container.
Optionally specify the IDs of the files to run the code on.
MemoryLimit stringOptional
type OpenAIResponseToolImageGeneration struct{…}A tool that generates images using the GPT image models.
A tool that generates images using the GPT image models.
Action stringOptional
Background stringOptional
InputImageMask OpenAIResponseToolImageGenerationInputImageMaskOptionalOptional mask for inpainting.
Contains image_url
(string, optional) and file_id (string, optional).
Optional mask for inpainting.
Contains image_url
(string, optional) and file_id (string, optional).
Model stringOptional
OutputFormat stringOptional
Quality stringOptional
Size stringOptional
type OpenAIResponseToolLocalShell struct{…}A tool that allows the model to execute shell commands in a local environment.
A tool that allows the model to execute shell commands in a local environment.
type FunctionShellTool struct{…}A tool that allows the model to execute shell commands.
A tool that allows the model to execute shell commands.
Environment FunctionShellToolEnvironmentUnionOptional
type FunctionShellToolEnvironmentContainerAuto struct{…}
MemoryLimit stringOptional
type CustomTool struct{…}A custom tool that processes input using a specified format.
Learn more about custom tools
A custom tool that processes input using a specified format.
Learn more about custom tools
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response.
Learn more about the web search tool.
This tool searches the web for relevant results to use in a response.
Learn more about the web search tool.
The conversation that this response belonged to.
Input items and output items from this response were automatically added to this conversation.
The conversation that this response belonged to.
Input items and output items from this response were automatically added to this conversation.
An error object returned when the model fails to generate a Response.
An error object returned when the model fails to generate a Response.
Code OpenAIResponseErrorCode
Instructions OpenAIResponseInstructionsUnionOptional
type OpenAIResponseInstructionsInputItems []OpenAIResponseInstructionsInputItemUnion
type EasyInputMessage struct{…}A message input to the model with a role indicating instruction following
hierarchy. Instructions given with the developer or system role take
precedence over instructions given with the user role. Messages with the
assistant role are presumed to have been generated by the model in previous
interactions.
A message input to the model with a role indicating instruction following
hierarchy. Instructions given with the developer or system role take
precedence over instructions given with the user role. Messages with the
assistant role are presumed to have been generated by the model in previous
interactions.
Content EasyInputMessageContentUnion
type EasyInputMessageContentInputItems []EasyInputMessageContentInputItemUnion
type OpenAIResponseInputImage struct{…}An image input to the model.
Learn about image inputs.
An image input to the model.
Learn about image inputs.
type OpenAITypesResponsesResponseInputItemMessage struct{…}A message input to the model with a role indicating instruction following
hierarchy. Instructions given with the developer or system role take
precedence over instructions given with the user role.
A message input to the model with a role indicating instruction following
hierarchy. Instructions given with the developer or system role take
precedence over instructions given with the user role.
Content []OpenAITypesResponsesResponseInputItemMessageContentUnion
type OpenAIResponseInputImage struct{…}An image input to the model.
Learn about image inputs.
An image input to the model.
Learn about image inputs.
Role OpenAITypesResponsesResponseInputItemMessageRole
Status OpenAITypesResponsesResponseInputItemMessageStatusOptional
type OpenAIResponseOutputMessage struct{…}An output message from the model.
An output message from the model.
Content []OpenAIResponseOutputMessageContentUnion
type OpenAIResponseOutputText struct{…}A text output from the model.
A text output from the model.
Annotations []OpenAIResponseOutputTextAnnotationUnion
type OpenAIResponseOutputTextAnnotationAnnotationURLCitation struct{…}A citation for a web resource used to generate a model response.
A citation for a web resource used to generate a model response.
type OpenAIResponseFileSearchToolCall struct{…}The results of a file search tool call.
See the
file search guide for more information.
The results of a file search tool call.
See the file search guide for more information.
Status OpenAIResponseFileSearchToolCallStatus
type OpenAIResponseComputerToolCall struct{…}A tool call to a computer use tool.
See the
computer use guide for more information.
A tool call to a computer use tool.
See the computer use guide for more information.
Action OpenAIResponseComputerToolCallActionUnionA click action.
A click action.
type OpenAIResponseComputerToolCallActionActionClick struct{…}A click action.
A click action.
Button string
type OpenAIResponseComputerToolCallActionActionKeypress struct{…}A collection of keypresses the model would like to perform.
A collection of keypresses the model would like to perform.
type OpenAITypesResponsesResponseInputItemComputerCallOutput struct{…}The output of a computer tool call.
The output of a computer tool call.
AcknowledgedSafetyChecks []OpenAITypesResponsesResponseInputItemComputerCallOutputAcknowledgedSafetyCheckOptional
Status OpenAITypesResponsesResponseInputItemComputerCallOutputStatusOptional
type OpenAIResponseFunctionWebSearch struct{…}The results of a web search tool call.
See the
web search guide for more information.
The results of a web search tool call.
See the web search guide for more information.
Action OpenAIResponseFunctionWebSearchActionUnionAction type “search” - Performs a web search query.
Action type “search” - Performs a web search query.
Status OpenAIResponseFunctionWebSearchStatus
type OpenAIResponseFunctionToolCall struct{…}A tool call to run a function.
See the
function calling guide for more information.
A tool call to run a function.
See the function calling guide for more information.
type OpenAITypesResponsesResponseInputItemFunctionCallOutput struct{…}The output of a function tool call.
The output of a function tool call.
Output OpenAITypesResponsesResponseInputItemFunctionCallOutputOutputUnion
type OpenAITypesResponsesResponseInputItemFunctionCallOutputOutputOutputContentList []OpenAITypesResponsesResponseInputItemFunctionCallOutputOutputOutputContentListItemUnion
type OpenAITypesResponsesResponseInputItemFunctionCallOutputOutputOutputContentListItemResponseInputTextContent struct{…}A text input to the model.
A text input to the model.
type OpenAITypesResponsesResponseInputItemFunctionCallOutputOutputOutputContentListItemResponseInputImageContent struct{…}An image input to the model.
Learn about image inputs
An image input to the model.
Learn about image inputs
Detail stringOptional
Status OpenAITypesResponsesResponseInputItemFunctionCallOutputStatusOptional
type OpenAIResponseReasoningItem struct{…}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.
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.
type ResponseCompactionItemParamResp struct{…}A compaction item generated by the v1/responses/compact API.
A compaction item generated by the v1/responses/compact API.
type OpenAITypesResponsesResponseInputItemImageGenerationCall struct{…}An image generation request made by the model.
An image generation request made by the model.
Status OpenAITypesResponsesResponseInputItemImageGenerationCallStatus
type OpenAIResponseCodeInterpreterToolCall struct{…}A tool call to run code.
A tool call to run code.
Status OpenAIResponseCodeInterpreterToolCallStatus
type OpenAITypesResponsesResponseInputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
A tool call to run a command on the local shell.
Action OpenAITypesResponsesResponseInputItemLocalShellCallActionExecute a shell command on the server.
Execute a shell command on the server.
Status OpenAITypesResponsesResponseInputItemLocalShellCallStatus
type OpenAITypesResponsesResponseInputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
The output of a local shell tool call.
Status OpenAITypesResponsesResponseInputItemLocalShellCallOutputStatusOptional
type ShellCall struct{…}A tool representing a request to execute one or more shell commands.
A tool representing a request to execute one or more shell commands.
type ShellCallOutput struct{…}The streamed output items emitted by a shell tool call.
The streamed output items emitted by a shell tool call.
type ApplyPatchCall struct{…}A tool call representing a request to create, delete, or update files using diff patches.
A tool call representing a request to create, delete, or update files using diff patches.
Operation ApplyPatchCallOperationUnionInstruction for creating a new file via the apply_patch tool.
Instruction for creating a new file via the apply_patch tool.
type OpenAITypesResponsesResponseInputItemMcpListTools struct{…}A list of tools available on an MCP server.
A list of tools available on an MCP server.
type OpenAITypesResponsesResponseInputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
A response to an MCP approval request.
type OpenAITypesResponsesResponseInputItemMcpCall struct{…}An invocation of a tool on an MCP server.
An invocation of a tool on an MCP server.
Status OpenAITypesResponsesResponseInputItemMcpCallStatusOptional
type OpenAIResponseCustomToolCallOutput struct{…}The output of a custom tool call from your code, being sent back to the model.
The output of a custom tool call from your code, being sent back to the model.
Output OpenAIResponseCustomToolCallOutputOutputUnion
type OpenAIResponseCustomToolCallOutputOutputOutputContentList []OpenAIResponseCustomToolCallOutputOutputOutputContentListItemUnion
type OpenAIResponseInputImage struct{…}An image input to the model.
Learn about image inputs.
An image input to the model.
Learn about image inputs.
Reference to a prompt template and its variables.
Learn more.
Reference to a prompt template and its variables. Learn more.
Variables map[string, OpenAIResponsePromptVariableUnion]Optional
type OpenAIResponseInputImage struct{…}An image input to the model.
Learn about image inputs.
An image input to the model.
Learn about image inputs.
gpt-5 and o-series models only
Configuration options for
reasoning models.
gpt-5 and o-series models only
Configuration options for reasoning models.
Configuration options for a text response from the model.
Can be plain
text or structured JSON data. Learn more:
Configuration options for a text response from the model.
Can be plain text or structured JSON data. Learn more:
Format OpenAIResponseTextConfigFormatUnionOptionalDefault response format. Used to generate text responses.
Default response format. Used to generate text responses.
type OpenAIResponseTextConfigFormatResponseFormatText struct{…}Default response format. Used to generate text responses.
Default response format. Used to generate text responses.
type OpenAIResponseTextConfigFormatResponseFormatTextJsonSchemaConfig struct{…}JSON Schema response format.
Used to generate structured JSON responses.
Learn more about Structured Outputs.
JSON Schema response format.
Used to generate structured JSON responses. Learn more about Structured Outputs.
type OpenAIResponseTextConfigFormatResponseFormatJsonObject struct{…}JSON object response format.
An older method of generating JSON responses.
Using json_schema is recommended for models that support it. Note that the
model will not generate JSON without a system or user message instructing it
to do so.
JSON object response format.
An older method of generating JSON responses.
Using json_schema is recommended for models that support it. Note that the
model will not generate JSON without a system or user message instructing it
to do so.
type OpenAIResponseCodeInterpreterToolCall struct{…}A tool call to run code.
A tool call to run code.
Status OpenAIResponseCodeInterpreterToolCallStatus
type OpenAIResponseComputerToolCall struct{…}A tool call to a computer use tool.
See the
computer use guide for more information.
A tool call to a computer use tool.
See the computer use guide for more information.
Action OpenAIResponseComputerToolCallActionUnionA click action.
A click action.
type OpenAIResponseComputerToolCallActionActionClick struct{…}A click action.
A click action.
Button string
type OpenAIResponseComputerToolCallActionActionKeypress struct{…}A collection of keypresses the model would like to perform.
A collection of keypresses the model would like to perform.
type OpenAIResponseCustomToolCallOutput struct{…}The output of a custom tool call from your code, being sent back to the model.
The output of a custom tool call from your code, being sent back to the model.
Output OpenAIResponseCustomToolCallOutputOutputUnion
type OpenAIResponseCustomToolCallOutputOutputOutputContentList []OpenAIResponseCustomToolCallOutputOutputOutputContentListItemUnion
type OpenAIResponseInputImage struct{…}An image input to the model.
Learn about image inputs.
An image input to the model.
Learn about image inputs.
type OpenAIResponseError struct{…}An error object returned when the model fails to generate a Response.
An error object returned when the model fails to generate a Response.
Code OpenAIResponseErrorCode
type OpenAIResponseFileSearchToolCall struct{…}The results of a file search tool call.
See the
file search guide for more information.
The results of a file search tool call.
See the file search guide for more information.
Status OpenAIResponseFileSearchToolCallStatus
type OpenAIResponseFunctionToolCall struct{…}A tool call to run a function.
See the
function calling guide for more information.
A tool call to run a function.
See the function calling guide for more information.
type OpenAIResponseFunctionWebSearch struct{…}The results of a web search tool call.
See the
web search guide for more information.
The results of a web search tool call.
See the web search guide for more information.
Action OpenAIResponseFunctionWebSearchActionUnionAction type “search” - Performs a web search query.
Action type “search” - Performs a web search query.
Status OpenAIResponseFunctionWebSearchStatus
type OpenAIResponseInputImage struct{…}An image input to the model.
Learn about image inputs.
An image input to the model.
Learn about image inputs.
type OpenAIResponseInputImageParamResp struct{…}An image input to the model.
Learn about image inputs.
An image input to the model.
Learn about image inputs.
type OpenAIResponseOutputMessage struct{…}An output message from the model.
An output message from the model.
Content []OpenAIResponseOutputMessageContentUnion
type OpenAIResponseOutputText struct{…}A text output from the model.
A text output from the model.
Annotations []OpenAIResponseOutputTextAnnotationUnion
type OpenAIResponseOutputTextAnnotationAnnotationURLCitation struct{…}A citation for a web resource used to generate a model response.
A citation for a web resource used to generate a model response.
type OpenAIResponseOutputText struct{…}A text output from the model.
A text output from the model.
Annotations []OpenAIResponseOutputTextAnnotationUnion
type OpenAIResponseOutputTextAnnotationAnnotationURLCitation struct{…}A citation for a web resource used to generate a model response.
A citation for a web resource used to generate a model response.
type OpenAIResponsePrompt struct{…}Reference to a prompt template and its variables.
Learn more.
Reference to a prompt template and its variables. Learn more.
Variables map[string, OpenAIResponsePromptVariableUnion]Optional
type OpenAIResponseInputImage struct{…}An image input to the model.
Learn about image inputs.
An image input to the model.
Learn about image inputs.
type OpenAIResponseReasoningItem struct{…}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.
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.
type OpenAIResponseTextConfig struct{…}Configuration options for a text response from the model.
Can be plain
text or structured JSON data. Learn more:
Configuration options for a text response from the model.
Can be plain text or structured JSON data. Learn more:
Format OpenAIResponseTextConfigFormatUnionOptionalDefault response format. Used to generate text responses.
Default response format. Used to generate text responses.
type OpenAIResponseTextConfigFormatResponseFormatText struct{…}Default response format. Used to generate text responses.
Default response format. Used to generate text responses.
type OpenAIResponseTextConfigFormatResponseFormatTextJsonSchemaConfig struct{…}JSON Schema response format.
Used to generate structured JSON responses.
Learn more about Structured Outputs.
JSON Schema response format.
Used to generate structured JSON responses. Learn more about Structured Outputs.
type OpenAIResponseTextConfigFormatResponseFormatJsonObject struct{…}JSON object response format.
An older method of generating JSON responses.
Using json_schema is recommended for models that support it. Note that the
model will not generate JSON without a system or user message instructing it
to do so.
JSON object response format.
An older method of generating JSON responses.
Using json_schema is recommended for models that support it. Note that the
model will not generate JSON without a system or user message instructing it
to do so.
type OpenAITypesResponsesResponseInputItemComputerCallOutput struct{…}The output of a computer tool call.
The output of a computer tool call.
AcknowledgedSafetyChecks []OpenAITypesResponsesResponseInputItemComputerCallOutputAcknowledgedSafetyCheckOptional
Status OpenAITypesResponsesResponseInputItemComputerCallOutputStatusOptional
type OpenAITypesResponsesResponseInputItemFunctionCallOutput struct{…}The output of a function tool call.
The output of a function tool call.
Output OpenAITypesResponsesResponseInputItemFunctionCallOutputOutputUnion
type OpenAITypesResponsesResponseInputItemFunctionCallOutputOutputOutputContentList []OpenAITypesResponsesResponseInputItemFunctionCallOutputOutputOutputContentListItemUnion
type OpenAITypesResponsesResponseInputItemFunctionCallOutputOutputOutputContentListItemResponseInputTextContent struct{…}A text input to the model.
A text input to the model.
type OpenAITypesResponsesResponseInputItemFunctionCallOutputOutputOutputContentListItemResponseInputImageContent struct{…}An image input to the model.
Learn about image inputs
An image input to the model.
Learn about image inputs
Detail stringOptional
Status OpenAITypesResponsesResponseInputItemFunctionCallOutputStatusOptional
type OpenAITypesResponsesResponseInputItemImageGenerationCall struct{…}An image generation request made by the model.
An image generation request made by the model.
Status OpenAITypesResponsesResponseInputItemImageGenerationCallStatus
type OpenAITypesResponsesResponseInputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
A tool call to run a command on the local shell.
Action OpenAITypesResponsesResponseInputItemLocalShellCallActionExecute a shell command on the server.
Execute a shell command on the server.
Status OpenAITypesResponsesResponseInputItemLocalShellCallStatus
type OpenAITypesResponsesResponseInputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
The output of a local shell tool call.
Status OpenAITypesResponsesResponseInputItemLocalShellCallOutputStatusOptional
type OpenAITypesResponsesResponseInputItemMcpCall struct{…}An invocation of a tool on an MCP server.
An invocation of a tool on an MCP server.
Status OpenAITypesResponsesResponseInputItemMcpCallStatusOptional
type OpenAITypesResponsesResponseInputItemMessage struct{…}A message input to the model with a role indicating instruction following
hierarchy. Instructions given with the developer or system role take
precedence over instructions given with the user role.
A message input to the model with a role indicating instruction following
hierarchy. Instructions given with the developer or system role take
precedence over instructions given with the user role.
Content []OpenAITypesResponsesResponseInputItemMessageContentUnion
type OpenAIResponseInputImage struct{…}An image input to the model.
Learn about image inputs.
An image input to the model.
Learn about image inputs.
Role OpenAITypesResponsesResponseInputItemMessageRole
Status OpenAITypesResponsesResponseInputItemMessageStatusOptional
type OpenAITypesResponsesResponseOutputItemImageGenerationCall struct{…}An image generation request made by the model.
An image generation request made by the model.
Status OpenAITypesResponsesResponseOutputItemImageGenerationCallStatus
type OpenAITypesResponsesResponseOutputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
A tool call to run a command on the local shell.
Action OpenAITypesResponsesResponseOutputItemLocalShellCallActionExecute a shell command on the server.
Execute a shell command on the server.
Status OpenAITypesResponsesResponseOutputItemLocalShellCallStatus
type OpenAITypesResponsesResponseOutputItemMcpCall struct{…}An invocation of a tool on an MCP server.
An invocation of a tool on an MCP server.
Status OpenAITypesResponsesResponseOutputItemMcpCallStatusOptional
type Reasoning struct{…}gpt-5 and o-series models only
Configuration options for
reasoning models.
gpt-5 and o-series models only
Configuration options for reasoning models.
type ResponseApplyPatchToolCall struct{…}A tool call that applies file diffs by creating, deleting, or updating files.
A tool call that applies file diffs by creating, deleting, or updating files.
Operation ResponseApplyPatchToolCallOperationUnionInstruction describing how to create a file via the apply_patch tool.
Instruction describing how to create a file via the apply_patch tool.
type ResponseCompactionItem struct{…}A compaction item generated by the v1/responses/compact API.
A compaction item generated by the v1/responses/compact API.
type ResponseCompactionItemParamResp struct{…}A compaction item generated by the v1/responses/compact API.
A compaction item generated by the v1/responses/compact API.
type ResponseFunctionShellToolCall struct{…}A tool call that executes one or more shell commands in a managed environment.
A tool call that executes one or more shell commands in a managed environment.
Action ResponseFunctionShellToolCallActionThe shell commands and limits that describe how to run the tool call.
The shell commands and limits that describe how to run the tool call.
Status ResponseFunctionShellToolCallStatus
type ResponseFunctionShellToolCallOutput struct{…}The output of a shell tool call that was emitted.
The output of a shell tool call that was emitted.
Output []ResponseFunctionShellToolCallOutputOutput
type ToolChoiceTypes struct{…}Indicates that the model should use a built-in tool to generate a response.
Learn more about built-in tools.
Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response.
Learn more about the web search tool.
This tool searches the web for relevant results to use in a response.
Learn more about the web search tool.
type WebSearchTool struct{…}Search the Internet for sources related to the prompt.
Learn more about the
web search tool.
Search the Internet for sources related to the prompt.
Learn more about the web search tool.