Run OpenAI Responses API (OpenAI only)
Runs inference using the OpenAI Responses API contract, taking an input rather than a chat messages array.
This endpoint is restricted to OpenAI-vendor models: requests whose model (vendor/name) resolves
to any other vendor are rejected with an unsupported-vendor error, unlike /v5/chat/completions and
/v5/inference which support many vendors. Use it when you specifically need Responses API features
such as previous_response_id chaining, instructions, or store; use /v5/chat/completions for the
standard messages-based chat contract. When stream is set the response streams as server-sent
events; otherwise a single response object is returned.
ParametersExpand Collapse
body ResponseNewParams
Input param.Field[ResponseNewParamsInputUnion]
type ResponseNewParamsInputInputItems []ResponseNewParamsInputInputItemUnion
type ResponseNewParamsInputInputItemEasyInputMessageParam 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 ResponseNewParamsInputInputItemEasyInputMessageParamContentUnion
type ResponseNewParamsInputInputItemEasyInputMessageParamContentInputItems []ResponseNewParamsInputInputItemEasyInputMessageParamContentInputItemUnion
type OpenAIResponseInputImageParamResp struct{…}An image input to the model.
Learn about image inputs.
An image input to the model.
Learn about image inputs.
Role string
type ResponseNewParamsInputInputItemMessage 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 []ResponseNewParamsInputInputItemMessageContentUnion
type OpenAIResponseInputImageParamResp struct{…}An image input to the model.
Learn about image inputs.
An image input to the model.
Learn about image inputs.
Role string
type ResponseNewParamsInputInputItemResponseOutputMessageParam struct{…}An output message from the model.
An output message from the model.
Content []ResponseNewParamsInputInputItemResponseOutputMessageParamContentUnion
type ResponseNewParamsInputInputItemResponseOutputMessageParamContentResponseOutputTextParam struct{…}A text output from the model.
A text output from the model.
Annotations []ResponseNewParamsInputInputItemResponseOutputMessageParamContentResponseOutputTextParamAnnotationUnion
type ResponseNewParamsInputInputItemResponseOutputMessageParamContentResponseOutputTextParamAnnotationAnnotationFileCitation struct{…}A citation to a file.
A citation to a file.
type ResponseNewParamsInputInputItemResponseOutputMessageParamContentResponseOutputTextParamAnnotationAnnotationURLCitation 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.
Status string
type ResponseNewParamsInputInputItemResponseFileSearchToolCallParam 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 string
type ResponseNewParamsInputInputItemResponseComputerToolCallParam 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 ResponseNewParamsInputInputItemResponseComputerToolCallParamActionUnionA click action.
A click action.
type ResponseNewParamsInputInputItemResponseComputerToolCallParamActionActionClick struct{…}A click action.
A click action.
Button string
type ResponseNewParamsInputInputItemResponseComputerToolCallParamActionActionDoubleClick struct{…}A double click action.
A double click action.
type ResponseNewParamsInputInputItemResponseComputerToolCallParamActionActionDrag struct{…}A drag action.
A drag action.
type ResponseNewParamsInputInputItemResponseComputerToolCallParamActionActionKeypress struct{…}A collection of keypresses the model would like to perform.
A collection of keypresses the model would like to perform.
type ResponseNewParamsInputInputItemResponseComputerToolCallParamActionActionMove struct{…}A mouse move action.
A mouse move action.
type ResponseNewParamsInputInputItemResponseComputerToolCallParamActionActionScreenshot struct{…}A screenshot action.
A screenshot action.
type ResponseNewParamsInputInputItemResponseComputerToolCallParamActionActionScroll struct{…}A scroll action.
A scroll action.
PendingSafetyChecks []ResponseNewParamsInputInputItemResponseComputerToolCallParamPendingSafetyCheck
Status string
type ResponseNewParamsInputInputItemComputerCallOutput struct{…}The output of a computer tool call.
The output of a computer tool call.
Output ResponseNewParamsInputInputItemComputerCallOutputOutputA computer screenshot image used with the computer use tool.
A computer screenshot image used with the computer use tool.
AcknowledgedSafetyChecks []ResponseNewParamsInputInputItemComputerCallOutputAcknowledgedSafetyCheckOptional
Status stringOptional
type ResponseNewParamsInputInputItemResponseFunctionWebSearchParam 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 ResponseNewParamsInputInputItemResponseFunctionWebSearchParamActionUnionAction type “search” - Performs a web search query.
Action type “search” - Performs a web search query.
type ResponseNewParamsInputInputItemResponseFunctionWebSearchParamActionActionSearch struct{…}Action type “search” - Performs a web search query.
Action type “search” - Performs a web search query.
Status string
type ResponseNewParamsInputInputItemResponseFunctionToolCallParam 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.
Status stringOptional
type ResponseNewParamsInputInputItemFunctionCallOutput struct{…}The output of a function tool call.
The output of a function tool call.
Output ResponseNewParamsInputInputItemFunctionCallOutputOutputUnion
type ResponseNewParamsInputInputItemFunctionCallOutputOutputOutputContentList []ResponseNewParamsInputInputItemFunctionCallOutputOutputOutputContentListItemUnion
type ResponseNewParamsInputInputItemFunctionCallOutputOutputOutputContentListItemResponseInputTextContentParam struct{…}A text input to the model.
A text input to the model.
type ResponseNewParamsInputInputItemFunctionCallOutputOutputOutputContentListItemResponseInputImageContentParam struct{…}An image input to the model.
Learn about image inputs
An image input to the model.
Learn about image inputs
Detail stringOptional
Status stringOptional
type ResponseNewParamsInputInputItemResponseReasoningItemParam 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.
Status stringOptional
type ResponseNewParamsInputInputItemResponseCompactionItemParamParam struct{…}A compaction item generated by the v1/responses/compact API.
A compaction item generated by the v1/responses/compact API.
type ResponseNewParamsInputInputItemImageGenerationCall struct{…}An image generation request made by the model.
An image generation request made by the model.
Status string
type ResponseNewParamsInputInputItemResponseCodeInterpreterToolCallParam struct{…}A tool call to run code.
A tool call to run code.
Outputs []ResponseNewParamsInputInputItemResponseCodeInterpreterToolCallParamOutputUnion
Status string
type ResponseNewParamsInputInputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
A tool call to run a command on the local shell.
Status string
type ResponseNewParamsInputInputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
The output of a local shell tool call.
Status stringOptional
type ResponseNewParamsInputInputItemShellCall 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.
Action ResponseNewParamsInputInputItemShellCallActionThe 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.
type ResponseNewParamsInputInputItemShellCallOutput struct{…}The streamed output items emitted by a shell tool call.
The streamed output items emitted by a shell tool call.
Output []ResponseNewParamsInputInputItemShellCallOutputOutput
Outcome ResponseNewParamsInputInputItemShellCallOutputOutputOutcomeUnionIndicates that the shell call exceeded its configured time limit.
Indicates that the shell call exceeded its configured time limit.
Status stringOptional
type ResponseNewParamsInputInputItemApplyPatchCall 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 ResponseNewParamsInputInputItemApplyPatchCallOperationUnionInstruction for creating a new file via the apply_patch tool.
Instruction for creating a new file via the apply_patch tool.
type ResponseNewParamsInputInputItemApplyPatchCallOperationApplyPatchCallOperationCreateFile struct{…}Instruction for creating a new file via the apply_patch tool.
Instruction for creating a new file via the apply_patch tool.
type ResponseNewParamsInputInputItemApplyPatchCallOutput struct{…}The streamed output emitted by an apply patch tool call.
The streamed output emitted by an apply patch tool call.
type ResponseNewParamsInputInputItemMcpListTools struct{…}A list of tools available on an MCP server.
A list of tools available on an MCP server.
type ResponseNewParamsInputInputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
A response to an MCP approval request.
type ResponseNewParamsInputInputItemMcpCall struct{…}An invocation of a tool on an MCP server.
An invocation of a tool on an MCP server.
Status stringOptional
type ResponseNewParamsInputInputItemResponseCustomToolCallOutputParam 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 ResponseNewParamsInputInputItemResponseCustomToolCallOutputParamOutputUnion
type ResponseNewParamsInputInputItemResponseCustomToolCallOutputParamOutputOutputContentList []ResponseNewParamsInputInputItemResponseCustomToolCallOutputParamOutputOutputContentListItemUnion
type OpenAIResponseInputImageParamResp struct{…}An image input to the model.
Learn about image inputs.
An image input to the model.
Learn about image inputs.
ReturnsExpand Collapse
type ResponseNewResponseUnion interface{…}Emitted when there is a partial audio response.
Emitted when there is a partial audio response.
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 ResponseNewResponseResponseAudioDeltaEvent struct{…}Emitted when there is a partial audio response.
Emitted when there is a partial audio response.
type ResponseNewResponseResponseAudioDoneEvent struct{…}Emitted when the audio response is complete.
Emitted when the audio response is complete.
type ResponseNewResponseResponseAudioTranscriptDeltaEvent struct{…}Emitted when there is a partial transcript of audio.
Emitted when there is a partial transcript of audio.
type ResponseNewResponseResponseAudioTranscriptDoneEvent struct{…}Emitted when the full audio transcript is completed.
Emitted when the full audio transcript is completed.
type ResponseNewResponseResponseCodeInterpreterCallCodeDeltaEvent struct{…}Emitted when a partial code snippet is streamed by the code interpreter.
Emitted when a partial code snippet is streamed by the code interpreter.
type ResponseNewResponseResponseCodeInterpreterCallCodeDoneEvent struct{…}Emitted when the code snippet is finalized by the code interpreter.
Emitted when the code snippet is finalized by the code interpreter.
type ResponseNewResponseResponseCodeInterpreterCallCompletedEvent struct{…}Emitted when the code interpreter call is completed.
Emitted when the code interpreter call is completed.
type ResponseNewResponseResponseCodeInterpreterCallInProgressEvent struct{…}Emitted when a code interpreter call is in progress.
Emitted when a code interpreter call is in progress.
type ResponseNewResponseResponseCodeInterpreterCallInterpretingEvent struct{…}Emitted when the code interpreter is actively interpreting the code snippet.
Emitted when the code interpreter is actively interpreting the code snippet.
type ResponseNewResponseResponseCompletedEvent struct{…}Emitted when the model response is complete.
Emitted when the model response is complete.
Response OpenAIResponse
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 ResponseNewResponseResponseContentPartAddedEvent struct{…}Emitted when a new content part is added.
Emitted when a new content part is added.
Part ResponseNewResponseResponseContentPartAddedEventPartUnionA text output from the model.
A text output from the model.
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 ResponseNewResponseResponseContentPartDoneEvent struct{…}Emitted when a content part is done.
Emitted when a content part is done.
Part ResponseNewResponseResponseContentPartDoneEventPartUnionA text output from the model.
A text output from the model.
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 ResponseNewResponseResponseCreatedEvent struct{…}An event that is emitted when a response is created.
An event that is emitted when a response is created.
Response OpenAIResponse
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 ResponseNewResponseResponseFileSearchCallCompletedEvent struct{…}Emitted when a file search call is completed (results found).
Emitted when a file search call is completed (results found).
type ResponseNewResponseResponseFileSearchCallInProgressEvent struct{…}Emitted when a file search call is initiated.
Emitted when a file search call is initiated.
type ResponseNewResponseResponseFileSearchCallSearchingEvent struct{…}Emitted when a file search is currently searching.
Emitted when a file search is currently searching.
type ResponseNewResponseResponseFunctionCallArgumentsDeltaEvent struct{…}Emitted when there is a partial function-call arguments delta.
Emitted when there is a partial function-call arguments delta.
type ResponseNewResponseResponseFunctionCallArgumentsDoneEvent struct{…}Emitted when function-call arguments are finalized.
Emitted when function-call arguments are finalized.
type ResponseNewResponseResponseInProgressEvent struct{…}Emitted when the response is in progress.
Emitted when the response is in progress.
Response OpenAIResponse
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 ResponseNewResponseResponseFailedEvent struct{…}An event that is emitted when a response fails.
An event that is emitted when a response fails.
Response OpenAIResponse
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 ResponseNewResponseResponseIncompleteEvent struct{…}An event that is emitted when a response finishes as incomplete.
An event that is emitted when a response finishes as incomplete.
Response OpenAIResponse
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 ResponseNewResponseResponseOutputItemAddedEvent struct{…}Emitted when a new output item is added.
Emitted when a new output item is added.
Item ResponseNewResponseResponseOutputItemAddedEventItemUnionAn output message from the model.
An output message from the model.
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.
type ResponseNewResponseResponseOutputItemDoneEvent struct{…}Emitted when an output item is marked done.
Emitted when an output item is marked done.
Item ResponseNewResponseResponseOutputItemDoneEventItemUnionAn output message from the model.
An output message from the model.
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.
type ResponseNewResponseResponseReasoningSummaryPartAddedEvent struct{…}Emitted when a new reasoning summary part is added.
Emitted when a new reasoning summary part is added.
type ResponseNewResponseResponseReasoningSummaryPartDoneEvent struct{…}Emitted when a reasoning summary part is completed.
Emitted when a reasoning summary part is completed.
type ResponseNewResponseResponseReasoningSummaryTextDeltaEvent struct{…}Emitted when a delta is added to a reasoning summary text.
Emitted when a delta is added to a reasoning summary text.
type ResponseNewResponseResponseReasoningSummaryTextDoneEvent struct{…}Emitted when a reasoning summary text is completed.
Emitted when a reasoning summary text is completed.
type ResponseNewResponseResponseReasoningTextDeltaEvent struct{…}Emitted when a delta is added to a reasoning text.
Emitted when a delta is added to a reasoning text.
type ResponseNewResponseResponseReasoningTextDoneEvent struct{…}Emitted when a reasoning text is completed.
Emitted when a reasoning text is completed.
type ResponseNewResponseResponseRefusalDeltaEvent struct{…}Emitted when there is a partial refusal text.
Emitted when there is a partial refusal text.
type ResponseNewResponseResponseTextDeltaEvent struct{…}Emitted when there is an additional text delta.
Emitted when there is an additional text delta.
type ResponseNewResponseResponseTextDoneEvent struct{…}Emitted when text content is finalized.
Emitted when text content is finalized.
type ResponseNewResponseResponseWebSearchCallCompletedEvent struct{…}Emitted when a web search call is completed.
Emitted when a web search call is completed.
type ResponseNewResponseResponseWebSearchCallInProgressEvent struct{…}Emitted when a web search call is initiated.
Emitted when a web search call is initiated.
type ResponseNewResponseResponseWebSearchCallSearchingEvent struct{…}Emitted when a web search call is executing.
Emitted when a web search call is executing.
type ResponseNewResponseResponseImageGenCallCompletedEvent struct{…}Emitted when an image generation tool call has completed and the final image is available.
Emitted when an image generation tool call has completed and the final image is available.
type ResponseNewResponseResponseImageGenCallGeneratingEvent struct{…}Emitted when an image generation tool call is actively generating an image (intermediate state).
Emitted when an image generation tool call is actively generating an image (intermediate state).
type ResponseNewResponseResponseImageGenCallInProgressEvent struct{…}Emitted when an image generation tool call is in progress.
Emitted when an image generation tool call is in progress.
type ResponseNewResponseResponseImageGenCallPartialImageEvent struct{…}Emitted when a partial image is available during image generation streaming.
Emitted when a partial image is available during image generation streaming.
type ResponseNewResponseResponseMcpCallArgumentsDeltaEvent struct{…}Emitted when there is a delta (partial update) to the arguments of an MCP tool call.
Emitted when there is a delta (partial update) to the arguments of an MCP tool call.
type ResponseNewResponseResponseMcpCallArgumentsDoneEvent struct{…}Emitted when the arguments for an MCP tool call are finalized.
Emitted when the arguments for an MCP tool call are finalized.
type ResponseNewResponseResponseMcpCallCompletedEvent struct{…}Emitted when an MCP tool call has completed successfully.
Emitted when an MCP tool call has completed successfully.
type ResponseNewResponseResponseMcpCallFailedEvent struct{…}Emitted when an MCP tool call has failed.
Emitted when an MCP tool call has failed.
type ResponseNewResponseResponseMcpCallInProgressEvent struct{…}Emitted when an MCP tool call is in progress.
Emitted when an MCP tool call is in progress.
type ResponseNewResponseResponseMcpListToolsCompletedEvent struct{…}Emitted when the list of available MCP tools has been successfully retrieved.
Emitted when the list of available MCP tools has been successfully retrieved.
type ResponseNewResponseResponseMcpListToolsFailedEvent struct{…}Emitted when the attempt to list available MCP tools has failed.
Emitted when the attempt to list available MCP tools has failed.
type ResponseNewResponseResponseMcpListToolsInProgressEvent struct{…}Emitted when the system is in the process of retrieving the list of available MCP tools.
Emitted when the system is in the process of retrieving the list of available MCP tools.
type ResponseNewResponseResponseOutputTextAnnotationAddedEvent struct{…}Emitted when an annotation is added to output text content.
Emitted when an annotation is added to output text content.
type ResponseNewResponseResponseQueuedEvent struct{…}Emitted when a response is queued and waiting to be processed.
Emitted when a response is queued and waiting to be processed.
Response OpenAIResponse
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 ResponseNewResponseResponseCustomToolCallInputDeltaEvent struct{…}Event representing a delta (partial update) to the input of a custom tool call.
Event representing a delta (partial update) to the input of a custom tool call.
Run OpenAI Responses API (OpenAI only)
package main
import (
"context"
"fmt"
"github.com/scaleapi/sgp-dev-go"
"github.com/scaleapi/sgp-dev-go/option"
)
func main() {
client := sgpdev.NewClient(
option.WithAPIKey("My API Key"),
option.WithAccountID("My Account ID"),
)
response, err := client.Responses.New(context.TODO(), sgpdev.ResponseNewParams{
Input: sgpdev.ResponseNewParamsInputUnion{
OfString: sgpdev.String("string"),
},
Model: "model",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response)
}
{
"id": "id",
"created_at": 0,
"model": "gpt-5.2",
"object": "response",
"output": [
{
"id": "id",
"content": [
{
"annotations": [
{
"file_id": "file_id",
"filename": "filename",
"index": 0,
"type": "file_citation"
}
],
"text": "text",
"type": "output_text",
"logprobs": [
{
"token": "token",
"bytes": [
0
],
"logprob": 0,
"top_logprobs": [
{
"token": "token",
"bytes": [
0
],
"logprob": 0
}
]
}
]
}
],
"role": "assistant",
"status": "in_progress",
"type": "message",
"phase": "commentary"
}
],
"parallel_tool_calls": true,
"tool_choice": "none",
"tools": [
{
"name": "name",
"type": "function",
"description": "description",
"parameters": {
"foo": "bar"
},
"strict": true
}
],
"background": true,
"completed_at": 0,
"conversation": {
"id": "id"
},
"error": {
"code": "server_error",
"message": "message"
},
"incomplete_details": {
"reason": "max_output_tokens"
},
"instructions": "string",
"max_output_tokens": 0,
"max_tool_calls": 0,
"metadata": {
"foo": "string"
},
"previous_response_id": "previous_response_id",
"prompt": {
"id": "id",
"variables": {
"foo": "string"
},
"version": "version"
},
"prompt_cache_key": "prompt_cache_key",
"prompt_cache_retention": "in-memory",
"reasoning": {
"effort": "none",
"generate_summary": "auto",
"summary": "auto"
},
"safety_identifier": "safety_identifier",
"service_tier": "auto",
"status": "completed",
"temperature": 0,
"text": {
"format": {
"type": "text"
},
"verbosity": "low"
},
"top_logprobs": 0,
"top_p": 0,
"truncation": "auto",
"usage": {
"input_tokens": 0,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 0,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 0
},
"user": "user"
}Returns Examples
{
"id": "id",
"created_at": 0,
"model": "gpt-5.2",
"object": "response",
"output": [
{
"id": "id",
"content": [
{
"annotations": [
{
"file_id": "file_id",
"filename": "filename",
"index": 0,
"type": "file_citation"
}
],
"text": "text",
"type": "output_text",
"logprobs": [
{
"token": "token",
"bytes": [
0
],
"logprob": 0,
"top_logprobs": [
{
"token": "token",
"bytes": [
0
],
"logprob": 0
}
]
}
]
}
],
"role": "assistant",
"status": "in_progress",
"type": "message",
"phase": "commentary"
}
],
"parallel_tool_calls": true,
"tool_choice": "none",
"tools": [
{
"name": "name",
"type": "function",
"description": "description",
"parameters": {
"foo": "bar"
},
"strict": true
}
],
"background": true,
"completed_at": 0,
"conversation": {
"id": "id"
},
"error": {
"code": "server_error",
"message": "message"
},
"incomplete_details": {
"reason": "max_output_tokens"
},
"instructions": "string",
"max_output_tokens": 0,
"max_tool_calls": 0,
"metadata": {
"foo": "string"
},
"previous_response_id": "previous_response_id",
"prompt": {
"id": "id",
"variables": {
"foo": "string"
},
"version": "version"
},
"prompt_cache_key": "prompt_cache_key",
"prompt_cache_retention": "in-memory",
"reasoning": {
"effort": "none",
"generate_summary": "auto",
"summary": "auto"
},
"safety_identifier": "safety_identifier",
"service_tier": "auto",
"status": "completed",
"temperature": 0,
"text": {
"format": {
"type": "text"
},
"verbosity": "low"
},
"top_logprobs": 0,
"top_p": 0,
"truncation": "auto",
"usage": {
"input_tokens": 0,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 0,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 0
},
"user": "user"
}