Responses
Create a model response
client.Responses.New(ctx, body) (*Response, error)
post /responses
Creates a model response. Provide text or image inputs to generate text or JSON outputs. Have the model call your own custom code or use built-in tools like web search or file search to use your own data as input for the model's response.
Parameters
-
body ResponseNewParams-
Background param.Field[bool]Whether to run the model response in the background. Learn more.
-
ContextManagement param.Field[[]ResponseNewParamsContextManagement]Context management configuration for this request.
-
Type stringThe context management entry type. Currently only 'compaction' is supported.
-
CompactThreshold int64Token threshold at which compaction should be triggered for this entry.
-
-
Conversation param.Field[ResponseNewParamsConversationUnion]The conversation that this response belongs to. Items from this conversation are prepended to
input_itemsfor this response request. Input items and output items from this response are automatically added to this conversation after this response completes.-
string -
type ResponseConversationParamResp struct{…}The conversation that this response belongs to.
-
ID stringThe unique ID of the conversation.
-
-
-
Include param.Field[[]ResponseIncludable]Specify additional output data to include in the model response. Currently supported values are:
-
web_search_call.action.sources: Include the sources of the web search tool call. -
code_interpreter_call.outputs: Includes the outputs of python code execution in code interpreter tool call items. -
computer_call_output.output.image_url: Include image urls from the computer call output. -
file_search_call.results: Include the search results of the file search tool call. -
message.input_image.image_url: Include image urls from the input message. -
message.output_text.logprobs: Include logprobs with assistant messages. -
reasoning.encrypted_content: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when thestoreparameter is set tofalse, or when an organization is enrolled in the zero data retention program). -
const ResponseIncludableFileSearchCallResults ResponseIncludable = "file_search_call.results" -
const ResponseIncludableWebSearchCallResults ResponseIncludable = "web_search_call.results" -
const ResponseIncludableWebSearchCallActionSources ResponseIncludable = "web_search_call.action.sources" -
const ResponseIncludableMessageInputImageImageURL ResponseIncludable = "message.input_image.image_url" -
const ResponseIncludableComputerCallOutputOutputImageURL ResponseIncludable = "computer_call_output.output.image_url" -
const ResponseIncludableCodeInterpreterCallOutputs ResponseIncludable = "code_interpreter_call.outputs" -
const ResponseIncludableReasoningEncryptedContent ResponseIncludable = "reasoning.encrypted_content" -
const ResponseIncludableMessageOutputTextLogprobs ResponseIncludable = "message.output_text.logprobs"
-
-
Input param.Field[ResponseNewParamsInputUnion]Text, image, or file inputs to the model, used to generate a response.
Learn more:
-
string -
type ResponseInput []ResponseInputItemUnionA list of one or many input items to the model, containing different content types.
-
type EasyInputMessage struct{…}A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.-
Content EasyInputMessageContentUnionText, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
-
string -
type ResponseInputMessageContentList []ResponseInputContentUnionA list of one or many input items to the model, containing different content types.
-
type ResponseInputText struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
Detail ResponseInputImageDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageDetailLow ResponseInputImageDetail = "low" -
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high" -
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto" -
const ResponseInputImageDetailOriginal ResponseInputImageDetail = "original"
-
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFile struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileDetailLow ResponseInputFileDetail = "low" -
const ResponseInputFileDetailHigh ResponseInputFileDetail = "high"
-
-
FileData stringThe content of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Role EasyInputMessageRoleThe role of the message input. One of
user,assistant,system, ordeveloper.-
const EasyInputMessageRoleUser EasyInputMessageRole = "user" -
const EasyInputMessageRoleAssistant EasyInputMessageRole = "assistant" -
const EasyInputMessageRoleSystem EasyInputMessageRole = "system" -
const EasyInputMessageRoleDeveloper EasyInputMessageRole = "developer"
-
-
Phase EasyInputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const EasyInputMessagePhaseCommentary EasyInputMessagePhase = "commentary" -
const EasyInputMessagePhaseFinalAnswer EasyInputMessagePhase = "final_answer"
-
-
Type EasyInputMessageTypeThe type of the message input. Always
message.const EasyInputMessageTypeMessage EasyInputMessageType = "message"
-
-
type ResponseInputItemMessage struct{…}A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole.-
Content ResponseInputMessageContentListA list of one or many input items to the model, containing different content types.
-
Role stringThe role of the message input. One of
user,system, ordeveloper.-
const ResponseInputItemMessageRoleUser ResponseInputItemMessageRole = "user" -
const ResponseInputItemMessageRoleSystem ResponseInputItemMessageRole = "system" -
const ResponseInputItemMessageRoleDeveloper ResponseInputItemMessageRole = "developer"
-
-
Status stringThe status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputItemMessageStatusInProgress ResponseInputItemMessageStatus = "in_progress" -
const ResponseInputItemMessageStatusCompleted ResponseInputItemMessageStatus = "completed" -
const ResponseInputItemMessageStatusIncomplete ResponseInputItemMessageStatus = "incomplete"
-
-
Type stringThe type of the message input. Always set to
message.const ResponseInputItemMessageTypeMessage ResponseInputItemMessageType = "message"
-
-
type ResponseOutputMessage struct{…}An output message from the model.
-
ID stringThe unique ID of the output message.
-
Content []ResponseOutputMessageContentUnionThe content of the output message.
-
type ResponseOutputText struct{…}A text output from the model.
-
Annotations []ResponseOutputTextAnnotationUnionThe annotations of the text output.
-
type ResponseOutputTextAnnotationFileCitation struct{…}A citation to a file.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the file cited.
-
Index int64The index of the file in the list of files.
-
Type FileCitationThe type of the file citation. Always
file_citation.const FileCitationFileCitation FileCitation = "file_citation"
-
-
type ResponseOutputTextAnnotationURLCitation struct{…}A citation for a web resource used to generate a model response.
-
EndIndex int64The index of the last character of the URL citation in the message.
-
StartIndex int64The index of the first character of the URL citation in the message.
-
Title stringThe title of the web resource.
-
Type URLCitationThe type of the URL citation. Always
url_citation.const URLCitationURLCitation URLCitation = "url_citation"
-
URL stringThe URL of the web resource.
-
-
type ResponseOutputTextAnnotationContainerFileCitation struct{…}A citation for a container file used to generate a model response.
-
ContainerID stringThe ID of the container file.
-
EndIndex int64The index of the last character of the container file citation in the message.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the container file cited.
-
StartIndex int64The index of the first character of the container file citation in the message.
-
Type ContainerFileCitationThe type of the container file citation. Always
container_file_citation.const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"
-
-
type ResponseOutputTextAnnotationFilePath struct{…}A path to a file.
-
FileID stringThe ID of the file.
-
Index int64The index of the file in the list of files.
-
Type FilePathThe type of the file path. Always
file_path.const FilePathFilePath FilePath = "file_path"
-
-
-
Text stringThe text output from the model.
-
Type OutputTextThe type of the output text. Always
output_text.const OutputTextOutputText OutputText = "output_text"
-
Logprobs []ResponseOutputTextLogprob-
Token string -
Bytes []int64 -
Logprob float64 -
TopLogprobs []ResponseOutputTextLogprobTopLogprob-
Token string -
Bytes []int64 -
Logprob float64
-
-
-
-
type ResponseOutputRefusal struct{…}A refusal from the model.
-
Refusal stringThe refusal explanation from the model.
-
Type RefusalThe type of the refusal. Always
refusal.const RefusalRefusal Refusal = "refusal"
-
-
-
Role AssistantThe role of the output message. Always
assistant.const AssistantAssistant Assistant = "assistant"
-
Status ResponseOutputMessageStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseOutputMessageStatusInProgress ResponseOutputMessageStatus = "in_progress" -
const ResponseOutputMessageStatusCompleted ResponseOutputMessageStatus = "completed" -
const ResponseOutputMessageStatusIncomplete ResponseOutputMessageStatus = "incomplete"
-
-
Type MessageThe type of the output message. Always
message.const MessageMessage Message = "message"
-
Phase ResponseOutputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const ResponseOutputMessagePhaseCommentary ResponseOutputMessagePhase = "commentary" -
const ResponseOutputMessagePhaseFinalAnswer ResponseOutputMessagePhase = "final_answer"
-
-
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
ID stringThe unique ID of the file search tool call.
-
Queries []stringThe queries used to search for files.
-
Status ResponseFileSearchToolCallStatusThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
const ResponseFileSearchToolCallStatusInProgress ResponseFileSearchToolCallStatus = "in_progress" -
const ResponseFileSearchToolCallStatusSearching ResponseFileSearchToolCallStatus = "searching" -
const ResponseFileSearchToolCallStatusCompleted ResponseFileSearchToolCallStatus = "completed" -
const ResponseFileSearchToolCallStatusIncomplete ResponseFileSearchToolCallStatus = "incomplete" -
const ResponseFileSearchToolCallStatusFailed ResponseFileSearchToolCallStatus = "failed"
-
-
Type FileSearchCallThe type of the file search tool call. Always
file_search_call.const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"
-
Results []ResponseFileSearchToolCallResultThe results of the file search tool call.
-
Attributes map[string, ResponseFileSearchToolCallResultAttributeUnion]Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.
-
string -
float64 -
bool
-
-
FileID stringThe unique ID of the file.
-
Filename stringThe name of the file.
-
Score float64The relevance score of the file - a value between 0 and 1.
-
Text stringThe text that was retrieved from the file.
-
-
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
ID stringThe unique ID of the computer call.
-
CallID stringAn identifier used when responding to the tool call with output.
-
PendingSafetyChecks []ResponseComputerToolCallPendingSafetyCheckThe pending safety checks for the computer call.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status ResponseComputerToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseComputerToolCallStatusInProgress ResponseComputerToolCallStatus = "in_progress" -
const ResponseComputerToolCallStatusCompleted ResponseComputerToolCallStatus = "completed" -
const ResponseComputerToolCallStatusIncomplete ResponseComputerToolCallStatus = "incomplete"
-
-
Type ResponseComputerToolCallTypeThe type of the computer call. Always
computer_call.const ResponseComputerToolCallTypeComputerCall ResponseComputerToolCallType = "computer_call"
-
Action ResponseComputerToolCallActionUnionA click action.
-
type ResponseComputerToolCallActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ResponseComputerToolCallActionClickButtonLeft ResponseComputerToolCallActionClickButton = "left" -
const ResponseComputerToolCallActionClickButtonRight ResponseComputerToolCallActionClickButton = "right" -
const ResponseComputerToolCallActionClickButtonWheel ResponseComputerToolCallActionClickButton = "wheel" -
const ResponseComputerToolCallActionClickButtonBack ResponseComputerToolCallActionClickButton = "back" -
const ResponseComputerToolCallActionClickButtonForward ResponseComputerToolCallActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ResponseComputerToolCallActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ResponseComputerToolCallActionDrag struct{…}A drag action.
-
Path []ResponseComputerToolCallActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ResponseComputerToolCallActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ResponseComputerToolCallActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ResponseComputerToolCallActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ResponseComputerToolCallActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ResponseComputerToolCallActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ResponseComputerToolCallActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
Actions ComputerActionListFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
type ComputerActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ComputerActionClickButtonLeft ComputerActionClickButton = "left" -
const ComputerActionClickButtonRight ComputerActionClickButton = "right" -
const ComputerActionClickButtonWheel ComputerActionClickButton = "wheel" -
const ComputerActionClickButtonBack ComputerActionClickButton = "back" -
const ComputerActionClickButtonForward ComputerActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ComputerActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ComputerActionDrag struct{…}A drag action.
-
Path []ComputerActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ComputerActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ComputerActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ComputerActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ComputerActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ComputerActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ComputerActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
-
type ResponseInputItemComputerCallOutput struct{…}The output of a computer tool call.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Type ComputerScreenshotSpecifies the event type. For a computer screenshot, this property is always set to
computer_screenshot.const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"
-
FileID stringThe identifier of an uploaded file that contains the screenshot.
-
ImageURL stringThe URL of the screenshot image.
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
ID stringThe ID of the computer tool call output.
-
AcknowledgedSafetyChecks []ResponseInputItemComputerCallOutputAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status stringThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseInputItemComputerCallOutputStatusInProgress ResponseInputItemComputerCallOutputStatus = "in_progress" -
const ResponseInputItemComputerCallOutputStatusCompleted ResponseInputItemComputerCallOutputStatus = "completed" -
const ResponseInputItemComputerCallOutputStatusIncomplete ResponseInputItemComputerCallOutputStatus = "incomplete"
-
-
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
ID stringThe unique ID of the web search tool call.
-
Action ResponseFunctionWebSearchActionUnionAn object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
type ResponseFunctionWebSearchActionSearch struct{…}Action type "search" - Performs a web search query.
-
Type SearchThe action type.
const SearchSearch Search = "search"
-
Queries []stringThe search queries.
-
Query stringThe search query.
-
Sources []ResponseFunctionWebSearchActionSearchSourceThe sources used in the search.
-
Type URLThe type of source. Always
url.const URLURL URL = "url"
-
URL stringThe URL of the source.
-
-
-
type ResponseFunctionWebSearchActionOpenPage struct{…}Action type "open_page" - Opens a specific URL from search results.
-
Type OpenPageThe action type.
const OpenPageOpenPage OpenPage = "open_page"
-
URL stringThe URL opened by the model.
-
-
type ResponseFunctionWebSearchActionFindInPage struct{…}Action type "find_in_page": Searches for a pattern within a loaded page.
-
Pattern stringThe pattern or text to search for within the page.
-
Type FindInPageThe action type.
const FindInPageFindInPage FindInPage = "find_in_page"
-
URL stringThe URL of the page searched for the pattern.
-
-
-
Status ResponseFunctionWebSearchStatusThe status of the web search tool call.
-
const ResponseFunctionWebSearchStatusInProgress ResponseFunctionWebSearchStatus = "in_progress" -
const ResponseFunctionWebSearchStatusSearching ResponseFunctionWebSearchStatus = "searching" -
const ResponseFunctionWebSearchStatusCompleted ResponseFunctionWebSearchStatus = "completed" -
const ResponseFunctionWebSearchStatusFailed ResponseFunctionWebSearchStatus = "failed"
-
-
Type WebSearchCallThe type of the web search tool call. Always
web_search_call.const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"
-
-
type ResponseFunctionToolCall struct{…}A tool call to run a function. See the function calling guide for more information.
-
Arguments stringA JSON string of the arguments to pass to the function.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Name stringThe name of the function to run.
-
Type FunctionCallThe type of the function tool call. Always
function_call.const FunctionCallFunctionCall FunctionCall = "function_call"
-
ID stringThe unique ID of the function tool call.
-
Namespace stringThe namespace of the function to run.
-
Status ResponseFunctionToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallStatusInProgress ResponseFunctionToolCallStatus = "in_progress" -
const ResponseFunctionToolCallStatusCompleted ResponseFunctionToolCallStatus = "completed" -
const ResponseFunctionToolCallStatusIncomplete ResponseFunctionToolCallStatus = "incomplete"
-
-
-
type ResponseInputItemFunctionCallOutput struct{…}The output of a function tool call.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseInputItemFunctionCallOutputOutputUnionText, image, or file output of the function tool call.
-
string -
type ResponseFunctionCallOutputItemList []ResponseFunctionCallOutputItemUnionAn array of content outputs (text, image, file) for the function tool call.
-
type ResponseInputTextContent struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImageContent struct{…}An image input to the model. Learn about image inputs
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
Detail ResponseInputImageContentDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageContentDetailLow ResponseInputImageContentDetail = "low" -
const ResponseInputImageContentDetailHigh ResponseInputImageContentDetail = "high" -
const ResponseInputImageContentDetailAuto ResponseInputImageContentDetail = "auto" -
const ResponseInputImageContentDetailOriginal ResponseInputImageContentDetail = "original"
-
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFileContent struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileContentDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileContentDetailLow ResponseInputFileContentDetail = "low" -
const ResponseInputFileContentDetailHigh ResponseInputFileContentDetail = "high"
-
-
FileData stringThe base64-encoded data of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
ID stringThe unique ID of the function tool call output. Populated when this item is returned via API.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputItemFunctionCallOutputStatusInProgress ResponseInputItemFunctionCallOutputStatus = "in_progress" -
const ResponseInputItemFunctionCallOutputStatusCompleted ResponseInputItemFunctionCallOutputStatus = "completed" -
const ResponseInputItemFunctionCallOutputStatusIncomplete ResponseInputItemFunctionCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemToolSearchCall struct{…}-
Arguments anyThe arguments supplied to the tool search call.
-
Type ToolSearchCallThe item type. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
ID stringThe unique ID of this tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution stringWhether tool search was executed by the server or by the client.
-
const ResponseInputItemToolSearchCallExecutionServer ResponseInputItemToolSearchCallExecution = "server" -
const ResponseInputItemToolSearchCallExecutionClient ResponseInputItemToolSearchCallExecution = "client"
-
-
Status stringThe status of the tool search call.
-
const ResponseInputItemToolSearchCallStatusInProgress ResponseInputItemToolSearchCallStatus = "in_progress" -
const ResponseInputItemToolSearchCallStatusCompleted ResponseInputItemToolSearchCallStatus = "completed" -
const ResponseInputItemToolSearchCallStatusIncomplete ResponseInputItemToolSearchCallStatus = "incomplete"
-
-
-
type ResponseToolSearchOutputItemParamResp struct{…}-
Tools []ToolUnionThe loaded tool definitions returned by the tool search output.
-
type FunctionTool struct{…}Defines a function in your own code the model can choose to call. Learn more about function calling.
-
Name stringThe name of the function to call.
-
Parameters map[string, any]A JSON schema object describing the parameters of the function.
-
Strict boolWhether to enforce strict parameter validation. Default
true. -
Type FunctionThe type of the function tool. Always
function.const FunctionFunction Function = "function"
-
DeferLoading boolWhether this function is deferred and loaded via tool search.
-
Description stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
type FileSearchTool struct{…}A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
Type FileSearchThe type of the file search tool. Always
file_search.const FileSearchFileSearch FileSearch = "file_search"
-
VectorStoreIDs []stringThe IDs of the vector stores to search.
-
Filters FileSearchToolFiltersUnionA filter to apply.
-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
Key stringThe key to compare against the value.
-
Type ComparisonFilterTypeSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
const ComparisonFilterTypeEq ComparisonFilterType = "eq" -
const ComparisonFilterTypeNe ComparisonFilterType = "ne" -
const ComparisonFilterTypeGt ComparisonFilterType = "gt" -
const ComparisonFilterTypeGte ComparisonFilterType = "gte" -
const ComparisonFilterTypeLt ComparisonFilterType = "lt" -
const ComparisonFilterTypeLte ComparisonFilterType = "lte" -
const ComparisonFilterTypeIn ComparisonFilterType = "in" -
const ComparisonFilterTypeNin ComparisonFilterType = "nin"
-
-
Value ComparisonFilterValueUnionThe value to compare against the attribute key; supports string, number, or boolean types.
-
string -
float64 -
bool -
type ComparisonFilterValueArray []ComparisonFilterValueArrayItemUnion-
string -
float64
-
-
-
-
type CompoundFilter struct{…}Combine multiple filters using
andoror.-
Filters []ComparisonFilterArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
-
Type CompoundFilterTypeType of operation:
andoror.-
const CompoundFilterTypeAnd CompoundFilterType = "and" -
const CompoundFilterTypeOr CompoundFilterType = "or"
-
-
-
-
MaxNumResults int64The maximum number of results to return. This number should be between 1 and 50 inclusive.
-
RankingOptions FileSearchToolRankingOptionsRanking options for search.
-
HybridSearch FileSearchToolRankingOptionsHybridSearchWeights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
EmbeddingWeight float64The weight of the embedding in the reciprocal ranking fusion.
-
TextWeight float64The weight of the text in the reciprocal ranking fusion.
-
-
Ranker stringThe ranker to use for the file search.
-
const FileSearchToolRankingOptionsRankerAuto FileSearchToolRankingOptionsRanker = "auto" -
const FileSearchToolRankingOptionsRankerDefault2024_11_15 FileSearchToolRankingOptionsRanker = "default-2024-11-15"
-
-
ScoreThreshold float64The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
Type ComputerThe type of the computer tool. Always
computer.const ComputerComputer Computer = "computer"
-
-
type ComputerUsePreviewTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
DisplayHeight int64The height of the computer display.
-
DisplayWidth int64The width of the computer display.
-
Environment ComputerUsePreviewToolEnvironmentThe type of computer environment to control.
-
const ComputerUsePreviewToolEnvironmentWindows ComputerUsePreviewToolEnvironment = "windows" -
const ComputerUsePreviewToolEnvironmentMac ComputerUsePreviewToolEnvironment = "mac" -
const ComputerUsePreviewToolEnvironmentLinux ComputerUsePreviewToolEnvironment = "linux" -
const ComputerUsePreviewToolEnvironmentUbuntu ComputerUsePreviewToolEnvironment = "ubuntu" -
const ComputerUsePreviewToolEnvironmentBrowser ComputerUsePreviewToolEnvironment = "browser"
-
-
Type ComputerUsePreviewThe type of the computer use tool. Always
computer_use_preview.const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"
-
-
type WebSearchTool struct{…}Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
Type WebSearchToolTypeThe type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
const WebSearchToolTypeWebSearch WebSearchToolType = "web_search" -
const WebSearchToolTypeWebSearch2025_08_26 WebSearchToolType = "web_search_2025_08_26"
-
-
Filters WebSearchToolFiltersFilters for the search.
-
AllowedDomains []stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
SearchContextSize WebSearchToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchToolSearchContextSizeLow WebSearchToolSearchContextSize = "low" -
const WebSearchToolSearchContextSizeMedium WebSearchToolSearchContextSize = "medium" -
const WebSearchToolSearchContextSizeHigh WebSearchToolSearchContextSize = "high"
-
-
UserLocation WebSearchToolUserLocationThe approximate location of the user.
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
Type stringThe type of location approximation. Always
approximate.const WebSearchToolUserLocationTypeApproximate WebSearchToolUserLocationType = "approximate"
-
-
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
ServerLabel stringA label for this MCP server, used to identify it in tool calls.
-
Type McpThe type of the MCP tool. Always
mcp.const McpMcp Mcp = "mcp"
-
AllowedTools ToolMcpAllowedToolsUnionList of allowed tool names or a filter object.
-
type ToolMcpAllowedToolsMcpAllowedTools []stringA string array of allowed tool names
-
type ToolMcpAllowedToolsMcpToolFilter struct{…}A filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
Authorization stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
ConnectorID stringIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
const ToolMcpConnectorIDConnectorDropbox ToolMcpConnectorID = "connector_dropbox" -
const ToolMcpConnectorIDConnectorGmail ToolMcpConnectorID = "connector_gmail" -
const ToolMcpConnectorIDConnectorGooglecalendar ToolMcpConnectorID = "connector_googlecalendar" -
const ToolMcpConnectorIDConnectorGoogledrive ToolMcpConnectorID = "connector_googledrive" -
const ToolMcpConnectorIDConnectorMicrosoftteams ToolMcpConnectorID = "connector_microsoftteams" -
const ToolMcpConnectorIDConnectorOutlookcalendar ToolMcpConnectorID = "connector_outlookcalendar" -
const ToolMcpConnectorIDConnectorOutlookemail ToolMcpConnectorID = "connector_outlookemail" -
const ToolMcpConnectorIDConnectorSharepoint ToolMcpConnectorID = "connector_sharepoint"
-
-
DeferLoading boolWhether this MCP tool is deferred and discovered via tool search.
-
Headers map[string, string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
RequireApproval ToolMcpRequireApprovalUnionSpecify which of the MCP server's tools require approval.
-
type ToolMcpRequireApprovalMcpToolApprovalFilter 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.-
Always ToolMcpRequireApprovalMcpToolApprovalFilterAlwaysA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
Never ToolMcpRequireApprovalMcpToolApprovalFilterNeverA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
type ToolMcpRequireApprovalMcpToolApprovalSetting stringSpecify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
const ToolMcpRequireApprovalMcpToolApprovalSettingAlways ToolMcpRequireApprovalMcpToolApprovalSetting = "always" -
const ToolMcpRequireApprovalMcpToolApprovalSettingNever ToolMcpRequireApprovalMcpToolApprovalSetting = "never"
-
-
-
ServerDescription stringOptional description of the MCP server, used to provide more context.
-
ServerURL stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
TunnelID stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
Container ToolCodeInterpreterContainerUnionThe code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
string -
type ToolCodeInterpreterContainerCodeInterpreterContainerAuto struct{…}Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
Type AutoAlways
auto.const AutoAuto Auto = "auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit stringThe memory limit for the code interpreter container.
-
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"
-
-
NetworkPolicy ToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…}-
Type DisabledDisable outbound network access. Always
disabled.const DisabledDisabled Disabled = "disabled"
-
-
type ContainerNetworkPolicyAllowlist struct{…}-
AllowedDomains []stringA list of allowed domains when type is
allowlist. -
Type AllowlistAllow outbound network access only to specified domains. Always
allowlist.const AllowlistAllowlist Allowlist = "allowlist"
-
DomainSecrets []ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
Domain stringThe domain associated with the secret.
-
Name stringThe name of the secret to inject for the domain.
-
Value stringThe secret value to inject for the domain.
-
-
-
-
-
-
Type CodeInterpreterThe type of the code interpreter tool. Always
code_interpreter.const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"
-
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
Type ImageGenerationThe type of the image generation tool. Always
image_generation.const ImageGenerationImageGeneration ImageGeneration = "image_generation"
-
Action stringWhether to generate a new image or edit an existing image. Default:
auto.-
const ToolImageGenerationActionGenerate ToolImageGenerationAction = "generate" -
const ToolImageGenerationActionEdit ToolImageGenerationAction = "edit" -
const ToolImageGenerationActionAuto ToolImageGenerationAction = "auto"
-
-
Background stringAllows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
const ToolImageGenerationBackgroundTransparent ToolImageGenerationBackground = "transparent" -
const ToolImageGenerationBackgroundOpaque ToolImageGenerationBackground = "opaque" -
const ToolImageGenerationBackgroundAuto ToolImageGenerationBackground = "auto"
-
-
InputFidelity stringControl how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
const ToolImageGenerationInputFidelityHigh ToolImageGenerationInputFidelity = "high" -
const ToolImageGenerationInputFidelityLow ToolImageGenerationInputFidelity = "low"
-
-
InputImageMask ToolImageGenerationInputImageMaskOptional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
FileID stringFile ID for the mask image.
-
ImageURL stringBase64-encoded mask image.
-
-
Model stringThe image generation model to use. Default:
gpt-image-1.-
string -
string-
const ToolImageGenerationModelGPTImage1 ToolImageGenerationModel = "gpt-image-1" -
const ToolImageGenerationModelGPTImage1Mini ToolImageGenerationModel = "gpt-image-1-mini" -
const ToolImageGenerationModelGPTImage2 ToolImageGenerationModel = "gpt-image-2" -
const ToolImageGenerationModelGPTImage2_2026_04_21 ToolImageGenerationModel = "gpt-image-2-2026-04-21" -
const ToolImageGenerationModelGPTImage1_5 ToolImageGenerationModel = "gpt-image-1.5" -
const ToolImageGenerationModelChatgptImageLatest ToolImageGenerationModel = "chatgpt-image-latest"
-
-
-
Moderation stringModeration level for the generated image. Default:
auto.-
const ToolImageGenerationModerationAuto ToolImageGenerationModeration = "auto" -
const ToolImageGenerationModerationLow ToolImageGenerationModeration = "low"
-
-
OutputCompression int64Compression level for the output image. Default: 100.
-
OutputFormat stringThe output format of the generated image. One of
png,webp, orjpeg. Default:png.-
const ToolImageGenerationOutputFormatPNG ToolImageGenerationOutputFormat = "png" -
const ToolImageGenerationOutputFormatWebP ToolImageGenerationOutputFormat = "webp" -
const ToolImageGenerationOutputFormatJPEG ToolImageGenerationOutputFormat = "jpeg"
-
-
PartialImages int64Number of partial images to generate in streaming mode, from 0 (default value) to 3.
-
Quality stringThe quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
const ToolImageGenerationQualityLow ToolImageGenerationQuality = "low" -
const ToolImageGenerationQualityMedium ToolImageGenerationQuality = "medium" -
const ToolImageGenerationQualityHigh ToolImageGenerationQuality = "high" -
const ToolImageGenerationQualityAuto ToolImageGenerationQuality = "auto"
-
-
Size stringThe size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
string -
string-
const ToolImageGenerationSize1024x1024 ToolImageGenerationSize = "1024x1024" -
const ToolImageGenerationSize1024x1536 ToolImageGenerationSize = "1024x1536" -
const ToolImageGenerationSize1536x1024 ToolImageGenerationSize = "1536x1024" -
const ToolImageGenerationSizeAuto ToolImageGenerationSize = "auto"
-
-
-
-
type ToolLocalShell struct{…}A tool that allows the model to execute shell commands in a local environment.
-
Type LocalShellThe type of the local shell tool. Always
local_shell.const LocalShellLocalShell LocalShell = "local_shell"
-
-
type FunctionShellTool struct{…}A tool that allows the model to execute shell commands.
-
Type ShellThe type of the shell tool. Always
shell.const ShellShell Shell = "shell"
-
Environment FunctionShellToolEnvironmentUnion-
type ContainerAuto struct{…}-
Type ContainerAutoAutomatically creates a container for this request
const ContainerAutoContainerAuto ContainerAuto = "container_auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit ContainerAutoMemoryLimitThe memory limit for the container.
-
const ContainerAutoMemoryLimit1g ContainerAutoMemoryLimit = "1g" -
const ContainerAutoMemoryLimit4g ContainerAutoMemoryLimit = "4g" -
const ContainerAutoMemoryLimit16g ContainerAutoMemoryLimit = "16g" -
const ContainerAutoMemoryLimit64g ContainerAutoMemoryLimit = "64g"
-
-
NetworkPolicy ContainerAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…} -
type ContainerNetworkPolicyAllowlist struct{…}
-
-
Skills []ContainerAutoSkillUnionAn optional list of skills referenced by id or inline data.
-
type SkillReference struct{…}-
SkillID stringThe ID of the referenced skill.
-
Type SkillReferenceReferences a skill created with the /v1/skills endpoint.
const SkillReferenceSkillReference SkillReference = "skill_reference"
-
Version stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
type InlineSkill struct{…}-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Source InlineSkillSourceInline skill payload
-
Data stringBase64-encoded skill zip bundle.
-
MediaType ApplicationZipThe media type of the inline skill payload. Must be
application/zip.const ApplicationZipApplicationZip ApplicationZip = "application/zip"
-
Type Base64The type of the inline skill source. Must be
base64.const Base64Base64 Base64 = "base64"
-
-
Type InlineDefines an inline skill for this request.
const InlineInline Inline = "inline"
-
-
-
-
type LocalEnvironment struct{…}-
Type LocalUse a local computer environment.
const LocalLocal Local = "local"
-
Skills []LocalSkillAn optional list of skills.
-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Path stringThe path to the directory containing the skill.
-
-
-
type ContainerReference struct{…}-
ContainerID stringThe ID of the referenced container.
-
Type ContainerReferenceReferences a container created with the /v1/containers endpoint
const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
Name stringThe name of the custom tool, used to identify it in tool calls.
-
Type CustomThe type of the custom tool. Always
custom.const CustomCustom Custom = "custom"
-
DeferLoading boolWhether this tool should be deferred and discovered via tool search.
-
Description stringOptional description of the custom tool, used to provide more context.
-
Format CustomToolInputFormatUnionThe input format for the custom tool. Default is unconstrained text.
-
type CustomToolInputFormatText struct{…}Unconstrained free-form text.
-
Type TextUnconstrained text format. Always
text.const TextText Text = "text"
-
-
type CustomToolInputFormatGrammar struct{…}A grammar defined by the user.
-
Definition stringThe grammar definition.
-
Syntax stringThe syntax of the grammar definition. One of
larkorregex.-
const CustomToolInputFormatGrammarSyntaxLark CustomToolInputFormatGrammarSyntax = "lark" -
const CustomToolInputFormatGrammarSyntaxRegex CustomToolInputFormatGrammarSyntax = "regex"
-
-
Type GrammarGrammar format. Always
grammar.const GrammarGrammar Grammar = "grammar"
-
-
-
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
Description stringA description of the namespace shown to the model.
-
Name stringThe namespace name used in tool calls (for example,
crm). -
Tools []NamespaceToolToolUnionThe function/custom tools available inside this namespace.
-
type NamespaceToolToolFunction struct{…}-
Name string -
Type Functionconst FunctionFunction Function = "function"
-
DeferLoading boolWhether this function should be deferred and discovered via tool search.
-
Description string -
Parameters any -
Strict bool
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
-
Type NamespaceThe type of the tool. Always
namespace.const NamespaceNamespace Namespace = "namespace"
-
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
Type ToolSearchThe type of the tool. Always
tool_search.const ToolSearchToolSearch ToolSearch = "tool_search"
-
Description stringDescription shown to the model for a client-executed tool search tool.
-
Execution ToolSearchToolExecutionWhether tool search is executed by the server or by the client.
-
const ToolSearchToolExecutionServer ToolSearchToolExecution = "server" -
const ToolSearchToolExecutionClient ToolSearchToolExecution = "client"
-
-
Parameters anyParameter schema for a client-executed tool search tool.
-
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
Type WebSearchPreviewToolTypeThe type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
const WebSearchPreviewToolTypeWebSearchPreview WebSearchPreviewToolType = "web_search_preview" -
const WebSearchPreviewToolTypeWebSearchPreview2025_03_11 WebSearchPreviewToolType = "web_search_preview_2025_03_11"
-
-
SearchContentTypes []string-
const WebSearchPreviewToolSearchContentTypeText WebSearchPreviewToolSearchContentType = "text" -
const WebSearchPreviewToolSearchContentTypeImage WebSearchPreviewToolSearchContentType = "image"
-
-
SearchContextSize WebSearchPreviewToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchPreviewToolSearchContextSizeLow WebSearchPreviewToolSearchContextSize = "low" -
const WebSearchPreviewToolSearchContextSizeMedium WebSearchPreviewToolSearchContextSize = "medium" -
const WebSearchPreviewToolSearchContextSizeHigh WebSearchPreviewToolSearchContextSize = "high"
-
-
UserLocation WebSearchPreviewToolUserLocationThe user's location.
-
Type ApproximateThe type of location approximation. Always
approximate.const ApproximateApproximate Approximate = "approximate"
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
Type ApplyPatchThe type of the tool. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
-
Type ToolSearchOutputThe item type. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
ID stringThe unique ID of this tool search output.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemParamExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemParamExecutionServer ResponseToolSearchOutputItemParamExecution = "server" -
const ResponseToolSearchOutputItemParamExecutionClient ResponseToolSearchOutputItemParamExecution = "client"
-
-
Status ResponseToolSearchOutputItemParamStatusThe status of the tool search output.
-
const ResponseToolSearchOutputItemParamStatusInProgress ResponseToolSearchOutputItemParamStatus = "in_progress" -
const ResponseToolSearchOutputItemParamStatusCompleted ResponseToolSearchOutputItemParamStatus = "completed" -
const ResponseToolSearchOutputItemParamStatusIncomplete ResponseToolSearchOutputItemParamStatus = "incomplete"
-
-
-
type ResponseInputItemAdditionalTools struct{…}-
Role DeveloperThe role that provided the additional tools. Only
developeris supported.const DeveloperDeveloper Developer = "developer"
-
Tools []ToolUnionA list of additional tools made available at this item.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type AdditionalToolsThe item type. Always
additional_tools.const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"
-
ID stringThe unique ID of this additional tools item.
-
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
ID stringThe unique identifier of the reasoning content.
-
Summary []ResponseReasoningItemSummaryReasoning summary content.
-
Text stringA summary of the reasoning output from the model so far.
-
Type SummaryTextThe type of the object. Always
summary_text.const SummaryTextSummaryText SummaryText = "summary_text"
-
-
Type ReasoningThe type of the object. Always
reasoning.const ReasoningReasoning Reasoning = "reasoning"
-
Content []ResponseReasoningItemContentReasoning text content.
-
Text stringThe reasoning text from the model.
-
Type ReasoningTextThe type of the reasoning text. Always
reasoning_text.const ReasoningTextReasoningText ReasoningText = "reasoning_text"
-
-
EncryptedContent stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
Status ResponseReasoningItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseReasoningItemStatusInProgress ResponseReasoningItemStatus = "in_progress" -
const ResponseReasoningItemStatusCompleted ResponseReasoningItemStatus = "completed" -
const ResponseReasoningItemStatusIncomplete ResponseReasoningItemStatus = "incomplete"
-
-
-
type ResponseCompactionItemParamResp struct{…}A compaction item generated by the
v1/responses/compactAPI.-
EncryptedContent stringThe encrypted content of the compaction summary.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
ID stringThe ID of the compaction item.
-
-
type ResponseInputItemImageGenerationCall struct{…}An image generation request made by the model.
-
ID stringThe unique ID of the image generation call.
-
Result stringThe generated image encoded in base64.
-
Status stringThe status of the image generation call.
-
const ResponseInputItemImageGenerationCallStatusInProgress ResponseInputItemImageGenerationCallStatus = "in_progress" -
const ResponseInputItemImageGenerationCallStatusCompleted ResponseInputItemImageGenerationCallStatus = "completed" -
const ResponseInputItemImageGenerationCallStatusGenerating ResponseInputItemImageGenerationCallStatus = "generating" -
const ResponseInputItemImageGenerationCallStatusFailed ResponseInputItemImageGenerationCallStatus = "failed"
-
-
Type ImageGenerationCallThe type of the image generation call. Always
image_generation_call.const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"
-
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
ID stringThe unique ID of the code interpreter tool call.
-
Code stringThe code to run, or null if not available.
-
ContainerID stringThe ID of the container used to run the code.
-
Outputs []ResponseCodeInterpreterToolCallOutputUnionThe outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
type ResponseCodeInterpreterToolCallOutputLogs struct{…}The logs output from the code interpreter.
-
Logs stringThe logs output from the code interpreter.
-
Type LogsThe type of the output. Always
logs.const LogsLogs Logs = "logs"
-
-
type ResponseCodeInterpreterToolCallOutputImage struct{…}The image output from the code interpreter.
-
Type ImageThe type of the output. Always
image.const ImageImage Image = "image"
-
URL stringThe URL of the image output from the code interpreter.
-
-
-
Status ResponseCodeInterpreterToolCallStatusThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
const ResponseCodeInterpreterToolCallStatusInProgress ResponseCodeInterpreterToolCallStatus = "in_progress" -
const ResponseCodeInterpreterToolCallStatusCompleted ResponseCodeInterpreterToolCallStatus = "completed" -
const ResponseCodeInterpreterToolCallStatusIncomplete ResponseCodeInterpreterToolCallStatus = "incomplete" -
const ResponseCodeInterpreterToolCallStatusInterpreting ResponseCodeInterpreterToolCallStatus = "interpreting" -
const ResponseCodeInterpreterToolCallStatusFailed ResponseCodeInterpreterToolCallStatus = "failed"
-
-
Type CodeInterpreterCallThe type of the code interpreter tool call. Always
code_interpreter_call.const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"
-
-
type ResponseInputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
ID stringThe unique ID of the local shell call.
-
Action ResponseInputItemLocalShellCallActionExecute a shell command on the server.
-
Command []stringThe command to run.
-
Env map[string, string]Environment variables to set for the command.
-
Type ExecThe type of the local shell action. Always
exec.const ExecExec Exec = "exec"
-
TimeoutMs int64Optional timeout in milliseconds for the command.
-
User stringOptional user to run the command as.
-
WorkingDirectory stringOptional working directory to run the command in.
-
-
CallID stringThe unique ID of the local shell tool call generated by the model.
-
Status stringThe status of the local shell call.
-
const ResponseInputItemLocalShellCallStatusInProgress ResponseInputItemLocalShellCallStatus = "in_progress" -
const ResponseInputItemLocalShellCallStatusCompleted ResponseInputItemLocalShellCallStatus = "completed" -
const ResponseInputItemLocalShellCallStatusIncomplete ResponseInputItemLocalShellCallStatus = "incomplete"
-
-
Type LocalShellCallThe type of the local shell call. Always
local_shell_call.const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"
-
-
type ResponseInputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
ID stringThe unique ID of the local shell tool call generated by the model.
-
Output stringA JSON string of the output of the local shell tool call.
-
Type LocalShellCallOutputThe type of the local shell tool call output. Always
local_shell_call_output.const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete.-
const ResponseInputItemLocalShellCallOutputStatusInProgress ResponseInputItemLocalShellCallOutputStatus = "in_progress" -
const ResponseInputItemLocalShellCallOutputStatusCompleted ResponseInputItemLocalShellCallOutputStatus = "completed" -
const ResponseInputItemLocalShellCallOutputStatusIncomplete ResponseInputItemLocalShellCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemShellCall struct{…}A tool representing a request to execute one or more shell commands.
-
Action ResponseInputItemShellCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []stringOrdered shell commands for the execution environment to run.
-
MaxOutputLength int64Maximum number of UTF-8 characters to capture from combined stdout and stderr output.
-
TimeoutMs int64Maximum wall-clock time in milliseconds to allow the shell commands to run.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Environment ResponseInputItemShellCallEnvironmentUnionThe environment to execute the shell commands in.
-
type LocalEnvironment struct{…} -
type ContainerReference struct{…}
-
-
Status stringThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseInputItemShellCallStatusInProgress ResponseInputItemShellCallStatus = "in_progress" -
const ResponseInputItemShellCallStatusCompleted ResponseInputItemShellCallStatus = "completed" -
const ResponseInputItemShellCallStatusIncomplete ResponseInputItemShellCallStatus = "incomplete"
-
-
-
type ResponseInputItemShellCallOutput struct{…}The streamed output items emitted by a shell tool call.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Output []ResponseFunctionShellCallOutputContentCaptured chunks of stdout and stderr output, along with their associated outcomes.
-
Outcome ResponseFunctionShellCallOutputContentOutcomeUnionThe exit or timeout outcome associated with this shell call.
-
type ResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellCallOutputContentOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64The exit code returned by the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringCaptured stderr output for the shell call.
-
Stdout stringCaptured stdout output for the shell call.
-
-
Type ShellCallOutputThe type of the item. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
ID stringThe unique ID of the shell tool call output. Populated when this item is returned via API.
-
MaxOutputLength int64The maximum number of UTF-8 characters captured for this shell call's combined output.
-
Status stringThe status of the shell call output.
-
const ResponseInputItemShellCallOutputStatusInProgress ResponseInputItemShellCallOutputStatus = "in_progress" -
const ResponseInputItemShellCallOutputStatusCompleted ResponseInputItemShellCallOutputStatus = "completed" -
const ResponseInputItemShellCallOutputStatusIncomplete ResponseInputItemShellCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemApplyPatchCall struct{…}A tool call representing a request to create, delete, or update files using diff patches.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseInputItemApplyPatchCallOperationUnionThe specific create, delete, or update instruction for the apply_patch tool call.
-
type ResponseInputItemApplyPatchCallOperationCreateFile struct{…}Instruction for creating a new file via the apply_patch tool.
-
Diff stringUnified diff content to apply when creating the file.
-
Path stringPath of the file to create relative to the workspace root.
-
Type CreateFileThe operation type. Always
create_file.const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseInputItemApplyPatchCallOperationDeleteFile struct{…}Instruction for deleting an existing file via the apply_patch tool.
-
Path stringPath of the file to delete relative to the workspace root.
-
Type DeleteFileThe operation type. Always
delete_file.const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseInputItemApplyPatchCallOperationUpdateFile struct{…}Instruction for updating an existing file via the apply_patch tool.
-
Diff stringUnified diff content to apply to the existing file.
-
Path stringPath of the file to update relative to the workspace root.
-
Type UpdateFileThe operation type. Always
update_file.const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status stringThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseInputItemApplyPatchCallStatusInProgress ResponseInputItemApplyPatchCallStatus = "in_progress" -
const ResponseInputItemApplyPatchCallStatusCompleted ResponseInputItemApplyPatchCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
-
type ResponseInputItemApplyPatchCallOutput struct{…}The streamed output emitted by an apply patch tool call.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status stringThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseInputItemApplyPatchCallOutputStatusCompleted ResponseInputItemApplyPatchCallOutputStatus = "completed" -
const ResponseInputItemApplyPatchCallOutputStatusFailed ResponseInputItemApplyPatchCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
Output stringOptional human-readable log text from the apply patch tool (e.g., patch results or errors).
-
-
type ResponseInputItemMcpListTools struct{…}A list of tools available on an MCP server.
-
ID stringThe unique ID of the list.
-
ServerLabel stringThe label of the MCP server.
-
Tools []ResponseInputItemMcpListToolsToolThe tools available on the server.
-
InputSchema anyThe JSON schema describing the tool's input.
-
Name stringThe name of the tool.
-
Annotations anyAdditional annotations about the tool.
-
Description stringThe description of the tool.
-
-
Type McpListToolsThe type of the item. Always
mcp_list_tools.const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
-
Error stringError message if the server could not list tools.
-
-
type ResponseInputItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
ID stringThe unique ID of the approval request.
-
Arguments stringA JSON string of arguments for the tool.
-
Name stringThe name of the tool to run.
-
ServerLabel stringThe label of the MCP server making the request.
-
Type McpApprovalRequestThe type of the item. Always
mcp_approval_request.const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"
-
-
type ResponseInputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
ApprovalRequestID stringThe ID of the approval request being answered.
-
Approve boolWhether the request was approved.
-
Type McpApprovalResponseThe type of the item. Always
mcp_approval_response.const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
-
ID stringThe unique ID of the approval response
-
Reason stringOptional reason for the decision.
-
-
type ResponseInputItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
ID stringThe unique ID of the tool call.
-
Arguments stringA JSON string of the arguments passed to the tool.
-
Name stringThe name of the tool that was run.
-
ServerLabel stringThe label of the MCP server running the tool.
-
Type McpCallThe type of the item. Always
mcp_call.const McpCallMcpCall McpCall = "mcp_call"
-
ApprovalRequestID stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
Error stringThe error from the tool call, if any.
-
Output stringThe output from the tool call.
-
Status stringThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
const ResponseInputItemMcpCallStatusInProgress ResponseInputItemMcpCallStatus = "in_progress" -
const ResponseInputItemMcpCallStatusCompleted ResponseInputItemMcpCallStatus = "completed" -
const ResponseInputItemMcpCallStatusIncomplete ResponseInputItemMcpCallStatus = "incomplete" -
const ResponseInputItemMcpCallStatusCalling ResponseInputItemMcpCallStatus = "calling" -
const ResponseInputItemMcpCallStatusFailed ResponseInputItemMcpCallStatus = "failed"
-
-
-
type ResponseCustomToolCallOutput struct{…}The output of a custom tool call from your code, being sent back to the model.
-
CallID stringThe call ID, used to map this custom tool call output to a custom tool call.
-
Output ResponseCustomToolCallOutputOutputUnionThe output from the custom tool call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseCustomToolCallOutputOutputOutputContentList []ResponseCustomToolCallOutputOutputOutputContentListItemUnionText, image, or file output of the custom tool call.
-
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
-
Type CustomToolCallOutputThe type of the custom tool call output. Always
custom_tool_call_output.const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"
-
ID stringThe unique ID of the custom tool call output in the OpenAI platform.
-
-
type ResponseCustomToolCall struct{…}A call to a custom tool created by the model.
-
CallID stringAn identifier used to map this custom tool call to a tool call output.
-
Input stringThe input for the custom tool call generated by the model.
-
Name stringThe name of the custom tool being called.
-
Type CustomToolCallThe type of the custom tool call. Always
custom_tool_call.const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"
-
ID stringThe unique ID of the custom tool call in the OpenAI platform.
-
Namespace stringThe namespace of the custom tool being called.
-
-
type ResponseInputItemCompactionTrigger struct{…}Compacts the current context. Must be the final input item.
-
Type CompactionTriggerThe type of the item. Always
compaction_trigger.const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"
-
-
type ResponseInputItemItemReference struct{…}An internal identifier for an item to reference.
-
ID stringThe ID of the item to reference.
-
Type stringThe type of item to reference. Always
item_reference.const ResponseInputItemItemReferenceTypeItemReference ResponseInputItemItemReferenceType = "item_reference"
-
-
-
Instructions param.Field[string]A system (or developer) message inserted into the model's context.
When using along with
previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses. -
MaxOutputTokens param.Field[int64]An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
MaxToolCalls param.Field[int64]The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored.
-
Metadata param.Field[Metadata]Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
-
Model param.Field[ResponsesModel]Model ID used to generate the response, like
gpt-4ooro3. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. -
Moderation param.Field[ResponseNewParamsModeration]Configuration for running moderation on the input and output of this response.
-
Model stringThe moderation model to use for moderated completions, e.g. 'omni-moderation-latest'.
-
-
ParallelToolCalls param.Field[bool]Whether to allow the model to run tool calls in parallel.
-
PreviousResponseID param.Field[string]The unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about conversation state. Cannot be used in conjunction with
conversation. -
Prompt param.Field[ResponsePrompt]Reference to a prompt template and its variables. Learn more.
-
PromptCacheKey param.Field[string]Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more. -
PromptCacheRetention param.Field[ResponseNewParamsPromptCacheRetention]The retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. Forgpt-5.5,gpt-5.5-pro, and future models, only24his supported.For older models that support both
in_memoryand24h, the default depends on your organization's data retention policy:-
Organizations without ZDR enabled default to
24h. -
Organizations with ZDR enabled default to
in_memorywhenprompt_cache_retentionis not specified. -
const ResponseNewParamsPromptCacheRetentionInMemory ResponseNewParamsPromptCacheRetention = "in_memory" -
const ResponseNewParamsPromptCacheRetention24h ResponseNewParamsPromptCacheRetention = "24h"
-
-
Reasoning param.Field[Reasoning]gpt-5 and o-series models only
Configuration options for reasoning models.
-
SafetyIdentifier param.Field[string]A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
ServiceTier param.Field[ResponseNewParamsServiceTier]Specifies the processing type used for serving the request.
- If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'.
- If set to 'default', then the request will be processed with the standard pricing and performance for the selected model.
- If set to 'flex' or 'priority', then the request will be processed with the corresponding service tier.
- When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.-
const ResponseNewParamsServiceTierAuto ResponseNewParamsServiceTier = "auto" -
const ResponseNewParamsServiceTierDefault ResponseNewParamsServiceTier = "default" -
const ResponseNewParamsServiceTierFlex ResponseNewParamsServiceTier = "flex" -
const ResponseNewParamsServiceTierScale ResponseNewParamsServiceTier = "scale" -
const ResponseNewParamsServiceTierPriority ResponseNewParamsServiceTier = "priority"
-
Store param.Field[bool]Whether to store the generated model response for later retrieval via API.
-
``
-
StreamOptions param.Field[ResponseNewParamsStreamOptions]Options for streaming responses. Only set this when you set
stream: true.-
IncludeObfuscation boolWhen true, stream obfuscation will be enabled. Stream obfuscation adds random characters to an
obfuscationfield on streaming delta events to normalize payload sizes as a mitigation to certain side-channel attacks. These obfuscation fields are included by default, but add a small amount of overhead to the data stream. You can setinclude_obfuscationto false to optimize for bandwidth if you trust the network links between your application and the OpenAI API.
-
-
Temperature param.Field[float64]What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or
top_pbut not both. -
Text param.Field[ResponseTextConfig]Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
ToolChoice param.Field[ResponseNewParamsToolChoiceUnion]How the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call.-
type ToolChoiceOptions stringControls which (if any) tool is called by the model.
nonemeans the model will not call any tool and instead generates a message.automeans the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools.-
const ToolChoiceOptionsNone ToolChoiceOptions = "none" -
const ToolChoiceOptionsAuto ToolChoiceOptions = "auto" -
const ToolChoiceOptionsRequired ToolChoiceOptions = "required"
-
-
type ToolChoiceAllowed struct{…}Constrains the tools available to the model to a pre-defined set.
-
Mode ToolChoiceAllowedModeConstrains the tools available to the model to a pre-defined set.
autoallows the model to pick from among the allowed tools and generate a message.requiredrequires the model to call one or more of the allowed tools.-
const ToolChoiceAllowedModeAuto ToolChoiceAllowedMode = "auto" -
const ToolChoiceAllowedModeRequired ToolChoiceAllowedMode = "required"
-
-
Tools []map[string, any]A list of tool definitions that the model should be allowed to call.
For the Responses API, the list of tool definitions might look like:
[ { "type": "function", "name": "get_weather" }, { "type": "mcp", "server_label": "deepwiki" }, { "type": "image_generation" } ] -
Type AllowedToolsAllowed tool configuration type. Always
allowed_tools.const AllowedToolsAllowedTools AllowedTools = "allowed_tools"
-
-
type ToolChoiceTypes struct{…}Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
-
Type ToolChoiceTypesTypeThe type of hosted tool the model should to use. Learn more about built-in tools.
Allowed values are:
-
file_search -
web_search_preview -
computer -
computer_use_preview -
computer_use -
code_interpreter -
image_generation -
const ToolChoiceTypesTypeFileSearch ToolChoiceTypesType = "file_search" -
const ToolChoiceTypesTypeWebSearchPreview ToolChoiceTypesType = "web_search_preview" -
const ToolChoiceTypesTypeComputer ToolChoiceTypesType = "computer" -
const ToolChoiceTypesTypeComputerUsePreview ToolChoiceTypesType = "computer_use_preview" -
const ToolChoiceTypesTypeComputerUse ToolChoiceTypesType = "computer_use" -
const ToolChoiceTypesTypeWebSearchPreview2025_03_11 ToolChoiceTypesType = "web_search_preview_2025_03_11" -
const ToolChoiceTypesTypeImageGeneration ToolChoiceTypesType = "image_generation" -
const ToolChoiceTypesTypeCodeInterpreter ToolChoiceTypesType = "code_interpreter"
-
-
-
type ToolChoiceFunction struct{…}Use this option to force the model to call a specific function.
-
Name stringThe name of the function to call.
-
Type FunctionFor function calling, the type is always
function.const FunctionFunction Function = "function"
-
-
type ToolChoiceMcp struct{…}Use this option to force the model to call a specific tool on a remote MCP server.
-
ServerLabel stringThe label of the MCP server to use.
-
Type McpFor MCP tools, the type is always
mcp.const McpMcp Mcp = "mcp"
-
Name stringThe name of the tool to call on the server.
-
-
type ToolChoiceCustom struct{…}Use this option to force the model to call a specific custom tool.
-
Name stringThe name of the custom tool to call.
-
Type CustomFor custom tool calling, the type is always
custom.const CustomCustom Custom = "custom"
-
-
type ToolChoiceApplyPatch struct{…}Forces the model to call the apply_patch tool when executing a tool call.
-
Type ApplyPatchThe tool to call. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
type ToolChoiceShell struct{…}Forces the model to call the shell tool when a tool call is required.
-
Type ShellThe tool to call. Always
shell.const ShellShell Shell = "shell"
-
-
-
Tools param.Field[[]ToolUnion]An array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.We support the following categories of tools:
-
Built-in tools: Tools that are provided by OpenAI that extend the model's capabilities, like web search or file search. Learn more about built-in tools.
-
MCP Tools: Integrations with third-party systems via custom MCP servers or predefined connectors such as Google Drive and SharePoint. Learn more about MCP Tools.
-
Function calls (custom tools): Functions that are defined by you, enabling the model to call your own code with strongly typed arguments and outputs. Learn more about function calling. You can also use custom tools to call your own code.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
TopLogprobs param.Field[int64]An integer between 0 and 20 specifying the maximum number of most likely tokens to return at each token position, each with an associated log probability. In some cases, the number of returned tokens may be fewer than requested.
-
TopP param.Field[float64]An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
We generally recommend altering this or
temperaturebut not both. -
Truncation param.Field[ResponseNewParamsTruncation]The truncation strategy to use for the model response.
-
auto: If the input to this Response exceeds the model's context window size, the model will truncate the response to fit the context window by dropping items from the beginning of the conversation. -
disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error. -
const ResponseNewParamsTruncationAuto ResponseNewParamsTruncation = "auto" -
const ResponseNewParamsTruncationDisabled ResponseNewParamsTruncation = "disabled"
-
-
User param.Field[string]This field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead to maintain caching optimizations. A stable identifier for your end-users. Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. Learn more.
-
Returns
-
type Response struct{…}-
ID stringUnique identifier for this Response.
-
CreatedAt float64Unix timestamp (in seconds) of when this Response was created.
-
Error ResponseErrorAn error object returned when the model fails to generate a Response.
-
Code ResponseErrorCodeThe error code for the response.
-
const ResponseErrorCodeServerError ResponseErrorCode = "server_error" -
const ResponseErrorCodeRateLimitExceeded ResponseErrorCode = "rate_limit_exceeded" -
const ResponseErrorCodeInvalidPrompt ResponseErrorCode = "invalid_prompt" -
const ResponseErrorCodeVectorStoreTimeout ResponseErrorCode = "vector_store_timeout" -
const ResponseErrorCodeInvalidImage ResponseErrorCode = "invalid_image" -
const ResponseErrorCodeInvalidImageFormat ResponseErrorCode = "invalid_image_format" -
const ResponseErrorCodeInvalidBase64Image ResponseErrorCode = "invalid_base64_image" -
const ResponseErrorCodeInvalidImageURL ResponseErrorCode = "invalid_image_url" -
const ResponseErrorCodeImageTooLarge ResponseErrorCode = "image_too_large" -
const ResponseErrorCodeImageTooSmall ResponseErrorCode = "image_too_small" -
const ResponseErrorCodeImageParseError ResponseErrorCode = "image_parse_error" -
const ResponseErrorCodeImageContentPolicyViolation ResponseErrorCode = "image_content_policy_violation" -
const ResponseErrorCodeInvalidImageMode ResponseErrorCode = "invalid_image_mode" -
const ResponseErrorCodeImageFileTooLarge ResponseErrorCode = "image_file_too_large" -
const ResponseErrorCodeUnsupportedImageMediaType ResponseErrorCode = "unsupported_image_media_type" -
const ResponseErrorCodeEmptyImageFile ResponseErrorCode = "empty_image_file" -
const ResponseErrorCodeFailedToDownloadImage ResponseErrorCode = "failed_to_download_image" -
const ResponseErrorCodeImageFileNotFound ResponseErrorCode = "image_file_not_found"
-
-
Message stringA human-readable description of the error.
-
-
IncompleteDetails ResponseIncompleteDetailsDetails about why the response is incomplete.
-
Reason stringThe reason why the response is incomplete.
-
const ResponseIncompleteDetailsReasonMaxOutputTokens ResponseIncompleteDetailsReason = "max_output_tokens" -
const ResponseIncompleteDetailsReasonContentFilter ResponseIncompleteDetailsReason = "content_filter"
-
-
-
Instructions ResponseInstructionsUnionA system (or developer) message inserted into the model's context.
When using along with
previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses.-
string -
type ResponseInstructionsInputItemList []ResponseInputItemUnionA list of one or many input items to the model, containing different content types.
-
type EasyInputMessage struct{…}A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.-
Content EasyInputMessageContentUnionText, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
-
string -
type ResponseInputMessageContentList []ResponseInputContentUnionA list of one or many input items to the model, containing different content types.
-
type ResponseInputText struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
Detail ResponseInputImageDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageDetailLow ResponseInputImageDetail = "low" -
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high" -
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto" -
const ResponseInputImageDetailOriginal ResponseInputImageDetail = "original"
-
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFile struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileDetailLow ResponseInputFileDetail = "low" -
const ResponseInputFileDetailHigh ResponseInputFileDetail = "high"
-
-
FileData stringThe content of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Role EasyInputMessageRoleThe role of the message input. One of
user,assistant,system, ordeveloper.-
const EasyInputMessageRoleUser EasyInputMessageRole = "user" -
const EasyInputMessageRoleAssistant EasyInputMessageRole = "assistant" -
const EasyInputMessageRoleSystem EasyInputMessageRole = "system" -
const EasyInputMessageRoleDeveloper EasyInputMessageRole = "developer"
-
-
Phase EasyInputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const EasyInputMessagePhaseCommentary EasyInputMessagePhase = "commentary" -
const EasyInputMessagePhaseFinalAnswer EasyInputMessagePhase = "final_answer"
-
-
Type EasyInputMessageTypeThe type of the message input. Always
message.const EasyInputMessageTypeMessage EasyInputMessageType = "message"
-
-
type ResponseInputItemMessage struct{…}A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole.-
Content ResponseInputMessageContentListA list of one or many input items to the model, containing different content types.
-
Role stringThe role of the message input. One of
user,system, ordeveloper.-
const ResponseInputItemMessageRoleUser ResponseInputItemMessageRole = "user" -
const ResponseInputItemMessageRoleSystem ResponseInputItemMessageRole = "system" -
const ResponseInputItemMessageRoleDeveloper ResponseInputItemMessageRole = "developer"
-
-
Status stringThe status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputItemMessageStatusInProgress ResponseInputItemMessageStatus = "in_progress" -
const ResponseInputItemMessageStatusCompleted ResponseInputItemMessageStatus = "completed" -
const ResponseInputItemMessageStatusIncomplete ResponseInputItemMessageStatus = "incomplete"
-
-
Type stringThe type of the message input. Always set to
message.const ResponseInputItemMessageTypeMessage ResponseInputItemMessageType = "message"
-
-
type ResponseOutputMessage struct{…}An output message from the model.
-
ID stringThe unique ID of the output message.
-
Content []ResponseOutputMessageContentUnionThe content of the output message.
-
type ResponseOutputText struct{…}A text output from the model.
-
Annotations []ResponseOutputTextAnnotationUnionThe annotations of the text output.
-
type ResponseOutputTextAnnotationFileCitation struct{…}A citation to a file.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the file cited.
-
Index int64The index of the file in the list of files.
-
Type FileCitationThe type of the file citation. Always
file_citation.const FileCitationFileCitation FileCitation = "file_citation"
-
-
type ResponseOutputTextAnnotationURLCitation struct{…}A citation for a web resource used to generate a model response.
-
EndIndex int64The index of the last character of the URL citation in the message.
-
StartIndex int64The index of the first character of the URL citation in the message.
-
Title stringThe title of the web resource.
-
Type URLCitationThe type of the URL citation. Always
url_citation.const URLCitationURLCitation URLCitation = "url_citation"
-
URL stringThe URL of the web resource.
-
-
type ResponseOutputTextAnnotationContainerFileCitation struct{…}A citation for a container file used to generate a model response.
-
ContainerID stringThe ID of the container file.
-
EndIndex int64The index of the last character of the container file citation in the message.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the container file cited.
-
StartIndex int64The index of the first character of the container file citation in the message.
-
Type ContainerFileCitationThe type of the container file citation. Always
container_file_citation.const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"
-
-
type ResponseOutputTextAnnotationFilePath struct{…}A path to a file.
-
FileID stringThe ID of the file.
-
Index int64The index of the file in the list of files.
-
Type FilePathThe type of the file path. Always
file_path.const FilePathFilePath FilePath = "file_path"
-
-
-
Text stringThe text output from the model.
-
Type OutputTextThe type of the output text. Always
output_text.const OutputTextOutputText OutputText = "output_text"
-
Logprobs []ResponseOutputTextLogprob-
Token string -
Bytes []int64 -
Logprob float64 -
TopLogprobs []ResponseOutputTextLogprobTopLogprob-
Token string -
Bytes []int64 -
Logprob float64
-
-
-
-
type ResponseOutputRefusal struct{…}A refusal from the model.
-
Refusal stringThe refusal explanation from the model.
-
Type RefusalThe type of the refusal. Always
refusal.const RefusalRefusal Refusal = "refusal"
-
-
-
Role AssistantThe role of the output message. Always
assistant.const AssistantAssistant Assistant = "assistant"
-
Status ResponseOutputMessageStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseOutputMessageStatusInProgress ResponseOutputMessageStatus = "in_progress" -
const ResponseOutputMessageStatusCompleted ResponseOutputMessageStatus = "completed" -
const ResponseOutputMessageStatusIncomplete ResponseOutputMessageStatus = "incomplete"
-
-
Type MessageThe type of the output message. Always
message.const MessageMessage Message = "message"
-
Phase ResponseOutputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const ResponseOutputMessagePhaseCommentary ResponseOutputMessagePhase = "commentary" -
const ResponseOutputMessagePhaseFinalAnswer ResponseOutputMessagePhase = "final_answer"
-
-
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
ID stringThe unique ID of the file search tool call.
-
Queries []stringThe queries used to search for files.
-
Status ResponseFileSearchToolCallStatusThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
const ResponseFileSearchToolCallStatusInProgress ResponseFileSearchToolCallStatus = "in_progress" -
const ResponseFileSearchToolCallStatusSearching ResponseFileSearchToolCallStatus = "searching" -
const ResponseFileSearchToolCallStatusCompleted ResponseFileSearchToolCallStatus = "completed" -
const ResponseFileSearchToolCallStatusIncomplete ResponseFileSearchToolCallStatus = "incomplete" -
const ResponseFileSearchToolCallStatusFailed ResponseFileSearchToolCallStatus = "failed"
-
-
Type FileSearchCallThe type of the file search tool call. Always
file_search_call.const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"
-
Results []ResponseFileSearchToolCallResultThe results of the file search tool call.
-
Attributes map[string, ResponseFileSearchToolCallResultAttributeUnion]Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.
-
string -
float64 -
bool
-
-
FileID stringThe unique ID of the file.
-
Filename stringThe name of the file.
-
Score float64The relevance score of the file - a value between 0 and 1.
-
Text stringThe text that was retrieved from the file.
-
-
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
ID stringThe unique ID of the computer call.
-
CallID stringAn identifier used when responding to the tool call with output.
-
PendingSafetyChecks []ResponseComputerToolCallPendingSafetyCheckThe pending safety checks for the computer call.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status ResponseComputerToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseComputerToolCallStatusInProgress ResponseComputerToolCallStatus = "in_progress" -
const ResponseComputerToolCallStatusCompleted ResponseComputerToolCallStatus = "completed" -
const ResponseComputerToolCallStatusIncomplete ResponseComputerToolCallStatus = "incomplete"
-
-
Type ResponseComputerToolCallTypeThe type of the computer call. Always
computer_call.const ResponseComputerToolCallTypeComputerCall ResponseComputerToolCallType = "computer_call"
-
Action ResponseComputerToolCallActionUnionA click action.
-
type ResponseComputerToolCallActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ResponseComputerToolCallActionClickButtonLeft ResponseComputerToolCallActionClickButton = "left" -
const ResponseComputerToolCallActionClickButtonRight ResponseComputerToolCallActionClickButton = "right" -
const ResponseComputerToolCallActionClickButtonWheel ResponseComputerToolCallActionClickButton = "wheel" -
const ResponseComputerToolCallActionClickButtonBack ResponseComputerToolCallActionClickButton = "back" -
const ResponseComputerToolCallActionClickButtonForward ResponseComputerToolCallActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ResponseComputerToolCallActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ResponseComputerToolCallActionDrag struct{…}A drag action.
-
Path []ResponseComputerToolCallActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ResponseComputerToolCallActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ResponseComputerToolCallActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ResponseComputerToolCallActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ResponseComputerToolCallActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ResponseComputerToolCallActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ResponseComputerToolCallActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
Actions ComputerActionListFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
type ComputerActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ComputerActionClickButtonLeft ComputerActionClickButton = "left" -
const ComputerActionClickButtonRight ComputerActionClickButton = "right" -
const ComputerActionClickButtonWheel ComputerActionClickButton = "wheel" -
const ComputerActionClickButtonBack ComputerActionClickButton = "back" -
const ComputerActionClickButtonForward ComputerActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ComputerActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ComputerActionDrag struct{…}A drag action.
-
Path []ComputerActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ComputerActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ComputerActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ComputerActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ComputerActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ComputerActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ComputerActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
-
type ResponseInputItemComputerCallOutput struct{…}The output of a computer tool call.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Type ComputerScreenshotSpecifies the event type. For a computer screenshot, this property is always set to
computer_screenshot.const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"
-
FileID stringThe identifier of an uploaded file that contains the screenshot.
-
ImageURL stringThe URL of the screenshot image.
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
ID stringThe ID of the computer tool call output.
-
AcknowledgedSafetyChecks []ResponseInputItemComputerCallOutputAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status stringThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseInputItemComputerCallOutputStatusInProgress ResponseInputItemComputerCallOutputStatus = "in_progress" -
const ResponseInputItemComputerCallOutputStatusCompleted ResponseInputItemComputerCallOutputStatus = "completed" -
const ResponseInputItemComputerCallOutputStatusIncomplete ResponseInputItemComputerCallOutputStatus = "incomplete"
-
-
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
ID stringThe unique ID of the web search tool call.
-
Action ResponseFunctionWebSearchActionUnionAn object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
type ResponseFunctionWebSearchActionSearch struct{…}Action type "search" - Performs a web search query.
-
Type SearchThe action type.
const SearchSearch Search = "search"
-
Queries []stringThe search queries.
-
Query stringThe search query.
-
Sources []ResponseFunctionWebSearchActionSearchSourceThe sources used in the search.
-
Type URLThe type of source. Always
url.const URLURL URL = "url"
-
URL stringThe URL of the source.
-
-
-
type ResponseFunctionWebSearchActionOpenPage struct{…}Action type "open_page" - Opens a specific URL from search results.
-
Type OpenPageThe action type.
const OpenPageOpenPage OpenPage = "open_page"
-
URL stringThe URL opened by the model.
-
-
type ResponseFunctionWebSearchActionFindInPage struct{…}Action type "find_in_page": Searches for a pattern within a loaded page.
-
Pattern stringThe pattern or text to search for within the page.
-
Type FindInPageThe action type.
const FindInPageFindInPage FindInPage = "find_in_page"
-
URL stringThe URL of the page searched for the pattern.
-
-
-
Status ResponseFunctionWebSearchStatusThe status of the web search tool call.
-
const ResponseFunctionWebSearchStatusInProgress ResponseFunctionWebSearchStatus = "in_progress" -
const ResponseFunctionWebSearchStatusSearching ResponseFunctionWebSearchStatus = "searching" -
const ResponseFunctionWebSearchStatusCompleted ResponseFunctionWebSearchStatus = "completed" -
const ResponseFunctionWebSearchStatusFailed ResponseFunctionWebSearchStatus = "failed"
-
-
Type WebSearchCallThe type of the web search tool call. Always
web_search_call.const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"
-
-
type ResponseFunctionToolCall struct{…}A tool call to run a function. See the function calling guide for more information.
-
Arguments stringA JSON string of the arguments to pass to the function.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Name stringThe name of the function to run.
-
Type FunctionCallThe type of the function tool call. Always
function_call.const FunctionCallFunctionCall FunctionCall = "function_call"
-
ID stringThe unique ID of the function tool call.
-
Namespace stringThe namespace of the function to run.
-
Status ResponseFunctionToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallStatusInProgress ResponseFunctionToolCallStatus = "in_progress" -
const ResponseFunctionToolCallStatusCompleted ResponseFunctionToolCallStatus = "completed" -
const ResponseFunctionToolCallStatusIncomplete ResponseFunctionToolCallStatus = "incomplete"
-
-
-
type ResponseInputItemFunctionCallOutput struct{…}The output of a function tool call.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseInputItemFunctionCallOutputOutputUnionText, image, or file output of the function tool call.
-
string -
type ResponseFunctionCallOutputItemList []ResponseFunctionCallOutputItemUnionAn array of content outputs (text, image, file) for the function tool call.
-
type ResponseInputTextContent struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImageContent struct{…}An image input to the model. Learn about image inputs
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
Detail ResponseInputImageContentDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageContentDetailLow ResponseInputImageContentDetail = "low" -
const ResponseInputImageContentDetailHigh ResponseInputImageContentDetail = "high" -
const ResponseInputImageContentDetailAuto ResponseInputImageContentDetail = "auto" -
const ResponseInputImageContentDetailOriginal ResponseInputImageContentDetail = "original"
-
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFileContent struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileContentDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileContentDetailLow ResponseInputFileContentDetail = "low" -
const ResponseInputFileContentDetailHigh ResponseInputFileContentDetail = "high"
-
-
FileData stringThe base64-encoded data of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
ID stringThe unique ID of the function tool call output. Populated when this item is returned via API.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputItemFunctionCallOutputStatusInProgress ResponseInputItemFunctionCallOutputStatus = "in_progress" -
const ResponseInputItemFunctionCallOutputStatusCompleted ResponseInputItemFunctionCallOutputStatus = "completed" -
const ResponseInputItemFunctionCallOutputStatusIncomplete ResponseInputItemFunctionCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemToolSearchCall struct{…}-
Arguments anyThe arguments supplied to the tool search call.
-
Type ToolSearchCallThe item type. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
ID stringThe unique ID of this tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution stringWhether tool search was executed by the server or by the client.
-
const ResponseInputItemToolSearchCallExecutionServer ResponseInputItemToolSearchCallExecution = "server" -
const ResponseInputItemToolSearchCallExecutionClient ResponseInputItemToolSearchCallExecution = "client"
-
-
Status stringThe status of the tool search call.
-
const ResponseInputItemToolSearchCallStatusInProgress ResponseInputItemToolSearchCallStatus = "in_progress" -
const ResponseInputItemToolSearchCallStatusCompleted ResponseInputItemToolSearchCallStatus = "completed" -
const ResponseInputItemToolSearchCallStatusIncomplete ResponseInputItemToolSearchCallStatus = "incomplete"
-
-
-
type ResponseToolSearchOutputItemParamResp struct{…}-
Tools []ToolUnionThe loaded tool definitions returned by the tool search output.
-
type FunctionTool struct{…}Defines a function in your own code the model can choose to call. Learn more about function calling.
-
Name stringThe name of the function to call.
-
Parameters map[string, any]A JSON schema object describing the parameters of the function.
-
Strict boolWhether to enforce strict parameter validation. Default
true. -
Type FunctionThe type of the function tool. Always
function.const FunctionFunction Function = "function"
-
DeferLoading boolWhether this function is deferred and loaded via tool search.
-
Description stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
type FileSearchTool struct{…}A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
Type FileSearchThe type of the file search tool. Always
file_search.const FileSearchFileSearch FileSearch = "file_search"
-
VectorStoreIDs []stringThe IDs of the vector stores to search.
-
Filters FileSearchToolFiltersUnionA filter to apply.
-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
Key stringThe key to compare against the value.
-
Type ComparisonFilterTypeSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
const ComparisonFilterTypeEq ComparisonFilterType = "eq" -
const ComparisonFilterTypeNe ComparisonFilterType = "ne" -
const ComparisonFilterTypeGt ComparisonFilterType = "gt" -
const ComparisonFilterTypeGte ComparisonFilterType = "gte" -
const ComparisonFilterTypeLt ComparisonFilterType = "lt" -
const ComparisonFilterTypeLte ComparisonFilterType = "lte" -
const ComparisonFilterTypeIn ComparisonFilterType = "in" -
const ComparisonFilterTypeNin ComparisonFilterType = "nin"
-
-
Value ComparisonFilterValueUnionThe value to compare against the attribute key; supports string, number, or boolean types.
-
string -
float64 -
bool -
type ComparisonFilterValueArray []ComparisonFilterValueArrayItemUnion-
string -
float64
-
-
-
-
type CompoundFilter struct{…}Combine multiple filters using
andoror.-
Filters []ComparisonFilterArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
-
Type CompoundFilterTypeType of operation:
andoror.-
const CompoundFilterTypeAnd CompoundFilterType = "and" -
const CompoundFilterTypeOr CompoundFilterType = "or"
-
-
-
-
MaxNumResults int64The maximum number of results to return. This number should be between 1 and 50 inclusive.
-
RankingOptions FileSearchToolRankingOptionsRanking options for search.
-
HybridSearch FileSearchToolRankingOptionsHybridSearchWeights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
EmbeddingWeight float64The weight of the embedding in the reciprocal ranking fusion.
-
TextWeight float64The weight of the text in the reciprocal ranking fusion.
-
-
Ranker stringThe ranker to use for the file search.
-
const FileSearchToolRankingOptionsRankerAuto FileSearchToolRankingOptionsRanker = "auto" -
const FileSearchToolRankingOptionsRankerDefault2024_11_15 FileSearchToolRankingOptionsRanker = "default-2024-11-15"
-
-
ScoreThreshold float64The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
Type ComputerThe type of the computer tool. Always
computer.const ComputerComputer Computer = "computer"
-
-
type ComputerUsePreviewTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
DisplayHeight int64The height of the computer display.
-
DisplayWidth int64The width of the computer display.
-
Environment ComputerUsePreviewToolEnvironmentThe type of computer environment to control.
-
const ComputerUsePreviewToolEnvironmentWindows ComputerUsePreviewToolEnvironment = "windows" -
const ComputerUsePreviewToolEnvironmentMac ComputerUsePreviewToolEnvironment = "mac" -
const ComputerUsePreviewToolEnvironmentLinux ComputerUsePreviewToolEnvironment = "linux" -
const ComputerUsePreviewToolEnvironmentUbuntu ComputerUsePreviewToolEnvironment = "ubuntu" -
const ComputerUsePreviewToolEnvironmentBrowser ComputerUsePreviewToolEnvironment = "browser"
-
-
Type ComputerUsePreviewThe type of the computer use tool. Always
computer_use_preview.const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"
-
-
type WebSearchTool struct{…}Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
Type WebSearchToolTypeThe type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
const WebSearchToolTypeWebSearch WebSearchToolType = "web_search" -
const WebSearchToolTypeWebSearch2025_08_26 WebSearchToolType = "web_search_2025_08_26"
-
-
Filters WebSearchToolFiltersFilters for the search.
-
AllowedDomains []stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
SearchContextSize WebSearchToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchToolSearchContextSizeLow WebSearchToolSearchContextSize = "low" -
const WebSearchToolSearchContextSizeMedium WebSearchToolSearchContextSize = "medium" -
const WebSearchToolSearchContextSizeHigh WebSearchToolSearchContextSize = "high"
-
-
UserLocation WebSearchToolUserLocationThe approximate location of the user.
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
Type stringThe type of location approximation. Always
approximate.const WebSearchToolUserLocationTypeApproximate WebSearchToolUserLocationType = "approximate"
-
-
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
ServerLabel stringA label for this MCP server, used to identify it in tool calls.
-
Type McpThe type of the MCP tool. Always
mcp.const McpMcp Mcp = "mcp"
-
AllowedTools ToolMcpAllowedToolsUnionList of allowed tool names or a filter object.
-
type ToolMcpAllowedToolsMcpAllowedTools []stringA string array of allowed tool names
-
type ToolMcpAllowedToolsMcpToolFilter struct{…}A filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
Authorization stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
ConnectorID stringIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
const ToolMcpConnectorIDConnectorDropbox ToolMcpConnectorID = "connector_dropbox" -
const ToolMcpConnectorIDConnectorGmail ToolMcpConnectorID = "connector_gmail" -
const ToolMcpConnectorIDConnectorGooglecalendar ToolMcpConnectorID = "connector_googlecalendar" -
const ToolMcpConnectorIDConnectorGoogledrive ToolMcpConnectorID = "connector_googledrive" -
const ToolMcpConnectorIDConnectorMicrosoftteams ToolMcpConnectorID = "connector_microsoftteams" -
const ToolMcpConnectorIDConnectorOutlookcalendar ToolMcpConnectorID = "connector_outlookcalendar" -
const ToolMcpConnectorIDConnectorOutlookemail ToolMcpConnectorID = "connector_outlookemail" -
const ToolMcpConnectorIDConnectorSharepoint ToolMcpConnectorID = "connector_sharepoint"
-
-
DeferLoading boolWhether this MCP tool is deferred and discovered via tool search.
-
Headers map[string, string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
RequireApproval ToolMcpRequireApprovalUnionSpecify which of the MCP server's tools require approval.
-
type ToolMcpRequireApprovalMcpToolApprovalFilter 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.-
Always ToolMcpRequireApprovalMcpToolApprovalFilterAlwaysA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
Never ToolMcpRequireApprovalMcpToolApprovalFilterNeverA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
type ToolMcpRequireApprovalMcpToolApprovalSetting stringSpecify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
const ToolMcpRequireApprovalMcpToolApprovalSettingAlways ToolMcpRequireApprovalMcpToolApprovalSetting = "always" -
const ToolMcpRequireApprovalMcpToolApprovalSettingNever ToolMcpRequireApprovalMcpToolApprovalSetting = "never"
-
-
-
ServerDescription stringOptional description of the MCP server, used to provide more context.
-
ServerURL stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
TunnelID stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
Container ToolCodeInterpreterContainerUnionThe code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
string -
type ToolCodeInterpreterContainerCodeInterpreterContainerAuto struct{…}Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
Type AutoAlways
auto.const AutoAuto Auto = "auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit stringThe memory limit for the code interpreter container.
-
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"
-
-
NetworkPolicy ToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…}-
Type DisabledDisable outbound network access. Always
disabled.const DisabledDisabled Disabled = "disabled"
-
-
type ContainerNetworkPolicyAllowlist struct{…}-
AllowedDomains []stringA list of allowed domains when type is
allowlist. -
Type AllowlistAllow outbound network access only to specified domains. Always
allowlist.const AllowlistAllowlist Allowlist = "allowlist"
-
DomainSecrets []ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
Domain stringThe domain associated with the secret.
-
Name stringThe name of the secret to inject for the domain.
-
Value stringThe secret value to inject for the domain.
-
-
-
-
-
-
Type CodeInterpreterThe type of the code interpreter tool. Always
code_interpreter.const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"
-
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
Type ImageGenerationThe type of the image generation tool. Always
image_generation.const ImageGenerationImageGeneration ImageGeneration = "image_generation"
-
Action stringWhether to generate a new image or edit an existing image. Default:
auto.-
const ToolImageGenerationActionGenerate ToolImageGenerationAction = "generate" -
const ToolImageGenerationActionEdit ToolImageGenerationAction = "edit" -
const ToolImageGenerationActionAuto ToolImageGenerationAction = "auto"
-
-
Background stringAllows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
const ToolImageGenerationBackgroundTransparent ToolImageGenerationBackground = "transparent" -
const ToolImageGenerationBackgroundOpaque ToolImageGenerationBackground = "opaque" -
const ToolImageGenerationBackgroundAuto ToolImageGenerationBackground = "auto"
-
-
InputFidelity stringControl how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
const ToolImageGenerationInputFidelityHigh ToolImageGenerationInputFidelity = "high" -
const ToolImageGenerationInputFidelityLow ToolImageGenerationInputFidelity = "low"
-
-
InputImageMask ToolImageGenerationInputImageMaskOptional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
FileID stringFile ID for the mask image.
-
ImageURL stringBase64-encoded mask image.
-
-
Model stringThe image generation model to use. Default:
gpt-image-1.-
string -
string-
const ToolImageGenerationModelGPTImage1 ToolImageGenerationModel = "gpt-image-1" -
const ToolImageGenerationModelGPTImage1Mini ToolImageGenerationModel = "gpt-image-1-mini" -
const ToolImageGenerationModelGPTImage2 ToolImageGenerationModel = "gpt-image-2" -
const ToolImageGenerationModelGPTImage2_2026_04_21 ToolImageGenerationModel = "gpt-image-2-2026-04-21" -
const ToolImageGenerationModelGPTImage1_5 ToolImageGenerationModel = "gpt-image-1.5" -
const ToolImageGenerationModelChatgptImageLatest ToolImageGenerationModel = "chatgpt-image-latest"
-
-
-
Moderation stringModeration level for the generated image. Default:
auto.-
const ToolImageGenerationModerationAuto ToolImageGenerationModeration = "auto" -
const ToolImageGenerationModerationLow ToolImageGenerationModeration = "low"
-
-
OutputCompression int64Compression level for the output image. Default: 100.
-
OutputFormat stringThe output format of the generated image. One of
png,webp, orjpeg. Default:png.-
const ToolImageGenerationOutputFormatPNG ToolImageGenerationOutputFormat = "png" -
const ToolImageGenerationOutputFormatWebP ToolImageGenerationOutputFormat = "webp" -
const ToolImageGenerationOutputFormatJPEG ToolImageGenerationOutputFormat = "jpeg"
-
-
PartialImages int64Number of partial images to generate in streaming mode, from 0 (default value) to 3.
-
Quality stringThe quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
const ToolImageGenerationQualityLow ToolImageGenerationQuality = "low" -
const ToolImageGenerationQualityMedium ToolImageGenerationQuality = "medium" -
const ToolImageGenerationQualityHigh ToolImageGenerationQuality = "high" -
const ToolImageGenerationQualityAuto ToolImageGenerationQuality = "auto"
-
-
Size stringThe size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
string -
string-
const ToolImageGenerationSize1024x1024 ToolImageGenerationSize = "1024x1024" -
const ToolImageGenerationSize1024x1536 ToolImageGenerationSize = "1024x1536" -
const ToolImageGenerationSize1536x1024 ToolImageGenerationSize = "1536x1024" -
const ToolImageGenerationSizeAuto ToolImageGenerationSize = "auto"
-
-
-
-
type ToolLocalShell struct{…}A tool that allows the model to execute shell commands in a local environment.
-
Type LocalShellThe type of the local shell tool. Always
local_shell.const LocalShellLocalShell LocalShell = "local_shell"
-
-
type FunctionShellTool struct{…}A tool that allows the model to execute shell commands.
-
Type ShellThe type of the shell tool. Always
shell.const ShellShell Shell = "shell"
-
Environment FunctionShellToolEnvironmentUnion-
type ContainerAuto struct{…}-
Type ContainerAutoAutomatically creates a container for this request
const ContainerAutoContainerAuto ContainerAuto = "container_auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit ContainerAutoMemoryLimitThe memory limit for the container.
-
const ContainerAutoMemoryLimit1g ContainerAutoMemoryLimit = "1g" -
const ContainerAutoMemoryLimit4g ContainerAutoMemoryLimit = "4g" -
const ContainerAutoMemoryLimit16g ContainerAutoMemoryLimit = "16g" -
const ContainerAutoMemoryLimit64g ContainerAutoMemoryLimit = "64g"
-
-
NetworkPolicy ContainerAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…} -
type ContainerNetworkPolicyAllowlist struct{…}
-
-
Skills []ContainerAutoSkillUnionAn optional list of skills referenced by id or inline data.
-
type SkillReference struct{…}-
SkillID stringThe ID of the referenced skill.
-
Type SkillReferenceReferences a skill created with the /v1/skills endpoint.
const SkillReferenceSkillReference SkillReference = "skill_reference"
-
Version stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
type InlineSkill struct{…}-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Source InlineSkillSourceInline skill payload
-
Data stringBase64-encoded skill zip bundle.
-
MediaType ApplicationZipThe media type of the inline skill payload. Must be
application/zip.const ApplicationZipApplicationZip ApplicationZip = "application/zip"
-
Type Base64The type of the inline skill source. Must be
base64.const Base64Base64 Base64 = "base64"
-
-
Type InlineDefines an inline skill for this request.
const InlineInline Inline = "inline"
-
-
-
-
type LocalEnvironment struct{…}-
Type LocalUse a local computer environment.
const LocalLocal Local = "local"
-
Skills []LocalSkillAn optional list of skills.
-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Path stringThe path to the directory containing the skill.
-
-
-
type ContainerReference struct{…}-
ContainerID stringThe ID of the referenced container.
-
Type ContainerReferenceReferences a container created with the /v1/containers endpoint
const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
Name stringThe name of the custom tool, used to identify it in tool calls.
-
Type CustomThe type of the custom tool. Always
custom.const CustomCustom Custom = "custom"
-
DeferLoading boolWhether this tool should be deferred and discovered via tool search.
-
Description stringOptional description of the custom tool, used to provide more context.
-
Format CustomToolInputFormatUnionThe input format for the custom tool. Default is unconstrained text.
-
type CustomToolInputFormatText struct{…}Unconstrained free-form text.
-
Type TextUnconstrained text format. Always
text.const TextText Text = "text"
-
-
type CustomToolInputFormatGrammar struct{…}A grammar defined by the user.
-
Definition stringThe grammar definition.
-
Syntax stringThe syntax of the grammar definition. One of
larkorregex.-
const CustomToolInputFormatGrammarSyntaxLark CustomToolInputFormatGrammarSyntax = "lark" -
const CustomToolInputFormatGrammarSyntaxRegex CustomToolInputFormatGrammarSyntax = "regex"
-
-
Type GrammarGrammar format. Always
grammar.const GrammarGrammar Grammar = "grammar"
-
-
-
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
Description stringA description of the namespace shown to the model.
-
Name stringThe namespace name used in tool calls (for example,
crm). -
Tools []NamespaceToolToolUnionThe function/custom tools available inside this namespace.
-
type NamespaceToolToolFunction struct{…}-
Name string -
Type Functionconst FunctionFunction Function = "function"
-
DeferLoading boolWhether this function should be deferred and discovered via tool search.
-
Description string -
Parameters any -
Strict bool
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
-
Type NamespaceThe type of the tool. Always
namespace.const NamespaceNamespace Namespace = "namespace"
-
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
Type ToolSearchThe type of the tool. Always
tool_search.const ToolSearchToolSearch ToolSearch = "tool_search"
-
Description stringDescription shown to the model for a client-executed tool search tool.
-
Execution ToolSearchToolExecutionWhether tool search is executed by the server or by the client.
-
const ToolSearchToolExecutionServer ToolSearchToolExecution = "server" -
const ToolSearchToolExecutionClient ToolSearchToolExecution = "client"
-
-
Parameters anyParameter schema for a client-executed tool search tool.
-
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
Type WebSearchPreviewToolTypeThe type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
const WebSearchPreviewToolTypeWebSearchPreview WebSearchPreviewToolType = "web_search_preview" -
const WebSearchPreviewToolTypeWebSearchPreview2025_03_11 WebSearchPreviewToolType = "web_search_preview_2025_03_11"
-
-
SearchContentTypes []string-
const WebSearchPreviewToolSearchContentTypeText WebSearchPreviewToolSearchContentType = "text" -
const WebSearchPreviewToolSearchContentTypeImage WebSearchPreviewToolSearchContentType = "image"
-
-
SearchContextSize WebSearchPreviewToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchPreviewToolSearchContextSizeLow WebSearchPreviewToolSearchContextSize = "low" -
const WebSearchPreviewToolSearchContextSizeMedium WebSearchPreviewToolSearchContextSize = "medium" -
const WebSearchPreviewToolSearchContextSizeHigh WebSearchPreviewToolSearchContextSize = "high"
-
-
UserLocation WebSearchPreviewToolUserLocationThe user's location.
-
Type ApproximateThe type of location approximation. Always
approximate.const ApproximateApproximate Approximate = "approximate"
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
Type ApplyPatchThe type of the tool. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
-
Type ToolSearchOutputThe item type. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
ID stringThe unique ID of this tool search output.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemParamExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemParamExecutionServer ResponseToolSearchOutputItemParamExecution = "server" -
const ResponseToolSearchOutputItemParamExecutionClient ResponseToolSearchOutputItemParamExecution = "client"
-
-
Status ResponseToolSearchOutputItemParamStatusThe status of the tool search output.
-
const ResponseToolSearchOutputItemParamStatusInProgress ResponseToolSearchOutputItemParamStatus = "in_progress" -
const ResponseToolSearchOutputItemParamStatusCompleted ResponseToolSearchOutputItemParamStatus = "completed" -
const ResponseToolSearchOutputItemParamStatusIncomplete ResponseToolSearchOutputItemParamStatus = "incomplete"
-
-
-
type ResponseInputItemAdditionalTools struct{…}-
Role DeveloperThe role that provided the additional tools. Only
developeris supported.const DeveloperDeveloper Developer = "developer"
-
Tools []ToolUnionA list of additional tools made available at this item.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type AdditionalToolsThe item type. Always
additional_tools.const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"
-
ID stringThe unique ID of this additional tools item.
-
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
ID stringThe unique identifier of the reasoning content.
-
Summary []ResponseReasoningItemSummaryReasoning summary content.
-
Text stringA summary of the reasoning output from the model so far.
-
Type SummaryTextThe type of the object. Always
summary_text.const SummaryTextSummaryText SummaryText = "summary_text"
-
-
Type ReasoningThe type of the object. Always
reasoning.const ReasoningReasoning Reasoning = "reasoning"
-
Content []ResponseReasoningItemContentReasoning text content.
-
Text stringThe reasoning text from the model.
-
Type ReasoningTextThe type of the reasoning text. Always
reasoning_text.const ReasoningTextReasoningText ReasoningText = "reasoning_text"
-
-
EncryptedContent stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
Status ResponseReasoningItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseReasoningItemStatusInProgress ResponseReasoningItemStatus = "in_progress" -
const ResponseReasoningItemStatusCompleted ResponseReasoningItemStatus = "completed" -
const ResponseReasoningItemStatusIncomplete ResponseReasoningItemStatus = "incomplete"
-
-
-
type ResponseCompactionItemParamResp struct{…}A compaction item generated by the
v1/responses/compactAPI.-
EncryptedContent stringThe encrypted content of the compaction summary.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
ID stringThe ID of the compaction item.
-
-
type ResponseInputItemImageGenerationCall struct{…}An image generation request made by the model.
-
ID stringThe unique ID of the image generation call.
-
Result stringThe generated image encoded in base64.
-
Status stringThe status of the image generation call.
-
const ResponseInputItemImageGenerationCallStatusInProgress ResponseInputItemImageGenerationCallStatus = "in_progress" -
const ResponseInputItemImageGenerationCallStatusCompleted ResponseInputItemImageGenerationCallStatus = "completed" -
const ResponseInputItemImageGenerationCallStatusGenerating ResponseInputItemImageGenerationCallStatus = "generating" -
const ResponseInputItemImageGenerationCallStatusFailed ResponseInputItemImageGenerationCallStatus = "failed"
-
-
Type ImageGenerationCallThe type of the image generation call. Always
image_generation_call.const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"
-
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
ID stringThe unique ID of the code interpreter tool call.
-
Code stringThe code to run, or null if not available.
-
ContainerID stringThe ID of the container used to run the code.
-
Outputs []ResponseCodeInterpreterToolCallOutputUnionThe outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
type ResponseCodeInterpreterToolCallOutputLogs struct{…}The logs output from the code interpreter.
-
Logs stringThe logs output from the code interpreter.
-
Type LogsThe type of the output. Always
logs.const LogsLogs Logs = "logs"
-
-
type ResponseCodeInterpreterToolCallOutputImage struct{…}The image output from the code interpreter.
-
Type ImageThe type of the output. Always
image.const ImageImage Image = "image"
-
URL stringThe URL of the image output from the code interpreter.
-
-
-
Status ResponseCodeInterpreterToolCallStatusThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
const ResponseCodeInterpreterToolCallStatusInProgress ResponseCodeInterpreterToolCallStatus = "in_progress" -
const ResponseCodeInterpreterToolCallStatusCompleted ResponseCodeInterpreterToolCallStatus = "completed" -
const ResponseCodeInterpreterToolCallStatusIncomplete ResponseCodeInterpreterToolCallStatus = "incomplete" -
const ResponseCodeInterpreterToolCallStatusInterpreting ResponseCodeInterpreterToolCallStatus = "interpreting" -
const ResponseCodeInterpreterToolCallStatusFailed ResponseCodeInterpreterToolCallStatus = "failed"
-
-
Type CodeInterpreterCallThe type of the code interpreter tool call. Always
code_interpreter_call.const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"
-
-
type ResponseInputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
ID stringThe unique ID of the local shell call.
-
Action ResponseInputItemLocalShellCallActionExecute a shell command on the server.
-
Command []stringThe command to run.
-
Env map[string, string]Environment variables to set for the command.
-
Type ExecThe type of the local shell action. Always
exec.const ExecExec Exec = "exec"
-
TimeoutMs int64Optional timeout in milliseconds for the command.
-
User stringOptional user to run the command as.
-
WorkingDirectory stringOptional working directory to run the command in.
-
-
CallID stringThe unique ID of the local shell tool call generated by the model.
-
Status stringThe status of the local shell call.
-
const ResponseInputItemLocalShellCallStatusInProgress ResponseInputItemLocalShellCallStatus = "in_progress" -
const ResponseInputItemLocalShellCallStatusCompleted ResponseInputItemLocalShellCallStatus = "completed" -
const ResponseInputItemLocalShellCallStatusIncomplete ResponseInputItemLocalShellCallStatus = "incomplete"
-
-
Type LocalShellCallThe type of the local shell call. Always
local_shell_call.const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"
-
-
type ResponseInputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
ID stringThe unique ID of the local shell tool call generated by the model.
-
Output stringA JSON string of the output of the local shell tool call.
-
Type LocalShellCallOutputThe type of the local shell tool call output. Always
local_shell_call_output.const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete.-
const ResponseInputItemLocalShellCallOutputStatusInProgress ResponseInputItemLocalShellCallOutputStatus = "in_progress" -
const ResponseInputItemLocalShellCallOutputStatusCompleted ResponseInputItemLocalShellCallOutputStatus = "completed" -
const ResponseInputItemLocalShellCallOutputStatusIncomplete ResponseInputItemLocalShellCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemShellCall struct{…}A tool representing a request to execute one or more shell commands.
-
Action ResponseInputItemShellCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []stringOrdered shell commands for the execution environment to run.
-
MaxOutputLength int64Maximum number of UTF-8 characters to capture from combined stdout and stderr output.
-
TimeoutMs int64Maximum wall-clock time in milliseconds to allow the shell commands to run.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Environment ResponseInputItemShellCallEnvironmentUnionThe environment to execute the shell commands in.
-
type LocalEnvironment struct{…} -
type ContainerReference struct{…}
-
-
Status stringThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseInputItemShellCallStatusInProgress ResponseInputItemShellCallStatus = "in_progress" -
const ResponseInputItemShellCallStatusCompleted ResponseInputItemShellCallStatus = "completed" -
const ResponseInputItemShellCallStatusIncomplete ResponseInputItemShellCallStatus = "incomplete"
-
-
-
type ResponseInputItemShellCallOutput struct{…}The streamed output items emitted by a shell tool call.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Output []ResponseFunctionShellCallOutputContentCaptured chunks of stdout and stderr output, along with their associated outcomes.
-
Outcome ResponseFunctionShellCallOutputContentOutcomeUnionThe exit or timeout outcome associated with this shell call.
-
type ResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellCallOutputContentOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64The exit code returned by the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringCaptured stderr output for the shell call.
-
Stdout stringCaptured stdout output for the shell call.
-
-
Type ShellCallOutputThe type of the item. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
ID stringThe unique ID of the shell tool call output. Populated when this item is returned via API.
-
MaxOutputLength int64The maximum number of UTF-8 characters captured for this shell call's combined output.
-
Status stringThe status of the shell call output.
-
const ResponseInputItemShellCallOutputStatusInProgress ResponseInputItemShellCallOutputStatus = "in_progress" -
const ResponseInputItemShellCallOutputStatusCompleted ResponseInputItemShellCallOutputStatus = "completed" -
const ResponseInputItemShellCallOutputStatusIncomplete ResponseInputItemShellCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemApplyPatchCall struct{…}A tool call representing a request to create, delete, or update files using diff patches.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseInputItemApplyPatchCallOperationUnionThe specific create, delete, or update instruction for the apply_patch tool call.
-
type ResponseInputItemApplyPatchCallOperationCreateFile struct{…}Instruction for creating a new file via the apply_patch tool.
-
Diff stringUnified diff content to apply when creating the file.
-
Path stringPath of the file to create relative to the workspace root.
-
Type CreateFileThe operation type. Always
create_file.const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseInputItemApplyPatchCallOperationDeleteFile struct{…}Instruction for deleting an existing file via the apply_patch tool.
-
Path stringPath of the file to delete relative to the workspace root.
-
Type DeleteFileThe operation type. Always
delete_file.const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseInputItemApplyPatchCallOperationUpdateFile struct{…}Instruction for updating an existing file via the apply_patch tool.
-
Diff stringUnified diff content to apply to the existing file.
-
Path stringPath of the file to update relative to the workspace root.
-
Type UpdateFileThe operation type. Always
update_file.const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status stringThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseInputItemApplyPatchCallStatusInProgress ResponseInputItemApplyPatchCallStatus = "in_progress" -
const ResponseInputItemApplyPatchCallStatusCompleted ResponseInputItemApplyPatchCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
-
type ResponseInputItemApplyPatchCallOutput struct{…}The streamed output emitted by an apply patch tool call.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status stringThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseInputItemApplyPatchCallOutputStatusCompleted ResponseInputItemApplyPatchCallOutputStatus = "completed" -
const ResponseInputItemApplyPatchCallOutputStatusFailed ResponseInputItemApplyPatchCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
Output stringOptional human-readable log text from the apply patch tool (e.g., patch results or errors).
-
-
type ResponseInputItemMcpListTools struct{…}A list of tools available on an MCP server.
-
ID stringThe unique ID of the list.
-
ServerLabel stringThe label of the MCP server.
-
Tools []ResponseInputItemMcpListToolsToolThe tools available on the server.
-
InputSchema anyThe JSON schema describing the tool's input.
-
Name stringThe name of the tool.
-
Annotations anyAdditional annotations about the tool.
-
Description stringThe description of the tool.
-
-
Type McpListToolsThe type of the item. Always
mcp_list_tools.const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
-
Error stringError message if the server could not list tools.
-
-
type ResponseInputItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
ID stringThe unique ID of the approval request.
-
Arguments stringA JSON string of arguments for the tool.
-
Name stringThe name of the tool to run.
-
ServerLabel stringThe label of the MCP server making the request.
-
Type McpApprovalRequestThe type of the item. Always
mcp_approval_request.const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"
-
-
type ResponseInputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
ApprovalRequestID stringThe ID of the approval request being answered.
-
Approve boolWhether the request was approved.
-
Type McpApprovalResponseThe type of the item. Always
mcp_approval_response.const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
-
ID stringThe unique ID of the approval response
-
Reason stringOptional reason for the decision.
-
-
type ResponseInputItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
ID stringThe unique ID of the tool call.
-
Arguments stringA JSON string of the arguments passed to the tool.
-
Name stringThe name of the tool that was run.
-
ServerLabel stringThe label of the MCP server running the tool.
-
Type McpCallThe type of the item. Always
mcp_call.const McpCallMcpCall McpCall = "mcp_call"
-
ApprovalRequestID stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
Error stringThe error from the tool call, if any.
-
Output stringThe output from the tool call.
-
Status stringThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
const ResponseInputItemMcpCallStatusInProgress ResponseInputItemMcpCallStatus = "in_progress" -
const ResponseInputItemMcpCallStatusCompleted ResponseInputItemMcpCallStatus = "completed" -
const ResponseInputItemMcpCallStatusIncomplete ResponseInputItemMcpCallStatus = "incomplete" -
const ResponseInputItemMcpCallStatusCalling ResponseInputItemMcpCallStatus = "calling" -
const ResponseInputItemMcpCallStatusFailed ResponseInputItemMcpCallStatus = "failed"
-
-
-
type ResponseCustomToolCallOutput struct{…}The output of a custom tool call from your code, being sent back to the model.
-
CallID stringThe call ID, used to map this custom tool call output to a custom tool call.
-
Output ResponseCustomToolCallOutputOutputUnionThe output from the custom tool call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseCustomToolCallOutputOutputOutputContentList []ResponseCustomToolCallOutputOutputOutputContentListItemUnionText, image, or file output of the custom tool call.
-
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
-
Type CustomToolCallOutputThe type of the custom tool call output. Always
custom_tool_call_output.const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"
-
ID stringThe unique ID of the custom tool call output in the OpenAI platform.
-
-
type ResponseCustomToolCall struct{…}A call to a custom tool created by the model.
-
CallID stringAn identifier used to map this custom tool call to a tool call output.
-
Input stringThe input for the custom tool call generated by the model.
-
Name stringThe name of the custom tool being called.
-
Type CustomToolCallThe type of the custom tool call. Always
custom_tool_call.const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"
-
ID stringThe unique ID of the custom tool call in the OpenAI platform.
-
Namespace stringThe namespace of the custom tool being called.
-
-
type ResponseInputItemCompactionTrigger struct{…}Compacts the current context. Must be the final input item.
-
Type CompactionTriggerThe type of the item. Always
compaction_trigger.const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"
-
-
type ResponseInputItemItemReference struct{…}An internal identifier for an item to reference.
-
ID stringThe ID of the item to reference.
-
Type stringThe type of item to reference. Always
item_reference.const ResponseInputItemItemReferenceTypeItemReference ResponseInputItemItemReferenceType = "item_reference"
-
-
-
-
Metadata MetadataSet of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
-
Model ResponsesModelModel ID used to generate the response, like
gpt-4ooro3. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models.-
string -
type ChatModel string-
const ChatModelGPT5_4 ChatModel = "gpt-5.4" -
const ChatModelGPT5_4Mini ChatModel = "gpt-5.4-mini" -
const ChatModelGPT5_4Nano ChatModel = "gpt-5.4-nano" -
const ChatModelGPT5_4Mini2026_03_17 ChatModel = "gpt-5.4-mini-2026-03-17" -
const ChatModelGPT5_4Nano2026_03_17 ChatModel = "gpt-5.4-nano-2026-03-17" -
const ChatModelGPT5_3ChatLatest ChatModel = "gpt-5.3-chat-latest" -
const ChatModelGPT5_2 ChatModel = "gpt-5.2" -
const ChatModelGPT5_2_2025_12_11 ChatModel = "gpt-5.2-2025-12-11" -
const ChatModelGPT5_2ChatLatest ChatModel = "gpt-5.2-chat-latest" -
const ChatModelGPT5_2Pro ChatModel = "gpt-5.2-pro" -
const ChatModelGPT5_2Pro2025_12_11 ChatModel = "gpt-5.2-pro-2025-12-11" -
const ChatModelGPT5_1 ChatModel = "gpt-5.1" -
const ChatModelGPT5_1_2025_11_13 ChatModel = "gpt-5.1-2025-11-13" -
const ChatModelGPT5_1Codex ChatModel = "gpt-5.1-codex" -
const ChatModelGPT5_1Mini ChatModel = "gpt-5.1-mini" -
const ChatModelGPT5_1ChatLatest ChatModel = "gpt-5.1-chat-latest" -
const ChatModelGPT5 ChatModel = "gpt-5" -
const ChatModelGPT5Mini ChatModel = "gpt-5-mini" -
const ChatModelGPT5Nano ChatModel = "gpt-5-nano" -
const ChatModelGPT5_2025_08_07 ChatModel = "gpt-5-2025-08-07" -
const ChatModelGPT5Mini2025_08_07 ChatModel = "gpt-5-mini-2025-08-07" -
const ChatModelGPT5Nano2025_08_07 ChatModel = "gpt-5-nano-2025-08-07" -
const ChatModelGPT5ChatLatest ChatModel = "gpt-5-chat-latest" -
const ChatModelGPT4_1 ChatModel = "gpt-4.1" -
const ChatModelGPT4_1Mini ChatModel = "gpt-4.1-mini" -
const ChatModelGPT4_1Nano ChatModel = "gpt-4.1-nano" -
const ChatModelGPT4_1_2025_04_14 ChatModel = "gpt-4.1-2025-04-14" -
const ChatModelGPT4_1Mini2025_04_14 ChatModel = "gpt-4.1-mini-2025-04-14" -
const ChatModelGPT4_1Nano2025_04_14 ChatModel = "gpt-4.1-nano-2025-04-14" -
const ChatModelO4Mini ChatModel = "o4-mini" -
const ChatModelO4Mini2025_04_16 ChatModel = "o4-mini-2025-04-16" -
const ChatModelO3 ChatModel = "o3" -
const ChatModelO3_2025_04_16 ChatModel = "o3-2025-04-16" -
const ChatModelO3Mini ChatModel = "o3-mini" -
const ChatModelO3Mini2025_01_31 ChatModel = "o3-mini-2025-01-31" -
const ChatModelO1 ChatModel = "o1" -
const ChatModelO1_2024_12_17 ChatModel = "o1-2024-12-17" -
const ChatModelO1Preview ChatModel = "o1-preview" -
const ChatModelO1Preview2024_09_12 ChatModel = "o1-preview-2024-09-12" -
const ChatModelO1Mini ChatModel = "o1-mini" -
const ChatModelO1Mini2024_09_12 ChatModel = "o1-mini-2024-09-12" -
const ChatModelGPT4o ChatModel = "gpt-4o" -
const ChatModelGPT4o2024_11_20 ChatModel = "gpt-4o-2024-11-20" -
const ChatModelGPT4o2024_08_06 ChatModel = "gpt-4o-2024-08-06" -
const ChatModelGPT4o2024_05_13 ChatModel = "gpt-4o-2024-05-13" -
const ChatModelGPT4oAudioPreview ChatModel = "gpt-4o-audio-preview" -
const ChatModelGPT4oAudioPreview2024_10_01 ChatModel = "gpt-4o-audio-preview-2024-10-01" -
const ChatModelGPT4oAudioPreview2024_12_17 ChatModel = "gpt-4o-audio-preview-2024-12-17" -
const ChatModelGPT4oAudioPreview2025_06_03 ChatModel = "gpt-4o-audio-preview-2025-06-03" -
const ChatModelGPT4oMiniAudioPreview ChatModel = "gpt-4o-mini-audio-preview" -
const ChatModelGPT4oMiniAudioPreview2024_12_17 ChatModel = "gpt-4o-mini-audio-preview-2024-12-17" -
const ChatModelGPT4oSearchPreview ChatModel = "gpt-4o-search-preview" -
const ChatModelGPT4oMiniSearchPreview ChatModel = "gpt-4o-mini-search-preview" -
const ChatModelGPT4oSearchPreview2025_03_11 ChatModel = "gpt-4o-search-preview-2025-03-11" -
const ChatModelGPT4oMiniSearchPreview2025_03_11 ChatModel = "gpt-4o-mini-search-preview-2025-03-11" -
const ChatModelChatgpt4oLatest ChatModel = "chatgpt-4o-latest" -
const ChatModelCodexMiniLatest ChatModel = "codex-mini-latest" -
const ChatModelGPT4oMini ChatModel = "gpt-4o-mini" -
const ChatModelGPT4oMini2024_07_18 ChatModel = "gpt-4o-mini-2024-07-18" -
const ChatModelGPT4Turbo ChatModel = "gpt-4-turbo" -
const ChatModelGPT4Turbo2024_04_09 ChatModel = "gpt-4-turbo-2024-04-09" -
const ChatModelGPT4_0125Preview ChatModel = "gpt-4-0125-preview" -
const ChatModelGPT4TurboPreview ChatModel = "gpt-4-turbo-preview" -
const ChatModelGPT4_1106Preview ChatModel = "gpt-4-1106-preview" -
const ChatModelGPT4VisionPreview ChatModel = "gpt-4-vision-preview" -
const ChatModelGPT4 ChatModel = "gpt-4" -
const ChatModelGPT4_0314 ChatModel = "gpt-4-0314" -
const ChatModelGPT4_0613 ChatModel = "gpt-4-0613" -
const ChatModelGPT4_32k ChatModel = "gpt-4-32k" -
const ChatModelGPT4_32k0314 ChatModel = "gpt-4-32k-0314" -
const ChatModelGPT4_32k0613 ChatModel = "gpt-4-32k-0613" -
const ChatModelGPT3_5Turbo ChatModel = "gpt-3.5-turbo" -
const ChatModelGPT3_5Turbo16k ChatModel = "gpt-3.5-turbo-16k" -
const ChatModelGPT3_5Turbo0301 ChatModel = "gpt-3.5-turbo-0301" -
const ChatModelGPT3_5Turbo0613 ChatModel = "gpt-3.5-turbo-0613" -
const ChatModelGPT3_5Turbo1106 ChatModel = "gpt-3.5-turbo-1106" -
const ChatModelGPT3_5Turbo0125 ChatModel = "gpt-3.5-turbo-0125" -
const ChatModelGPT3_5Turbo16k0613 ChatModel = "gpt-3.5-turbo-16k-0613"
-
-
type ResponsesModel string-
const ResponsesModelO1Pro ResponsesModel = "o1-pro" -
const ResponsesModelO1Pro2025_03_19 ResponsesModel = "o1-pro-2025-03-19" -
const ResponsesModelO3Pro ResponsesModel = "o3-pro" -
const ResponsesModelO3Pro2025_06_10 ResponsesModel = "o3-pro-2025-06-10" -
const ResponsesModelO3DeepResearch ResponsesModel = "o3-deep-research" -
const ResponsesModelO3DeepResearch2025_06_26 ResponsesModel = "o3-deep-research-2025-06-26" -
const ResponsesModelO4MiniDeepResearch ResponsesModel = "o4-mini-deep-research" -
const ResponsesModelO4MiniDeepResearch2025_06_26 ResponsesModel = "o4-mini-deep-research-2025-06-26" -
const ResponsesModelComputerUsePreview ResponsesModel = "computer-use-preview" -
const ResponsesModelComputerUsePreview2025_03_11 ResponsesModel = "computer-use-preview-2025-03-11" -
const ResponsesModelGPT5Codex ResponsesModel = "gpt-5-codex" -
const ResponsesModelGPT5Pro ResponsesModel = "gpt-5-pro" -
const ResponsesModelGPT5Pro2025_10_06 ResponsesModel = "gpt-5-pro-2025-10-06" -
const ResponsesModelGPT5_1CodexMax ResponsesModel = "gpt-5.1-codex-max"
-
-
-
Object ResponseThe object type of this resource - always set to
response.const ResponseResponse Response = "response"
-
Output []ResponseOutputItemUnionAn array of content items generated by the model.
-
The length and order of items in the
outputarray is dependent on the model's response. -
Rather than accessing the first item in the
outputarray and assuming it's anassistantmessage with the content generated by the model, you might consider using theoutput_textproperty where supported in SDKs. -
type ResponseOutputMessage struct{…}An output message from the model.
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
type ResponseFunctionToolCall struct{…}A tool call to run a function. See the function calling guide for more information.
-
type ResponseFunctionToolCallOutputItem struct{…}-
ID stringThe unique ID of the function call tool output.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseFunctionToolCallOutputItemOutputUnionThe output from the function call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseFunctionToolCallOutputItemOutputOutputContentList []ResponseFunctionToolCallOutputItemOutputOutputContentListItemUnionText, image, or file output of the function call.
-
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
-
Status ResponseFunctionToolCallOutputItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallOutputItemStatusInProgress ResponseFunctionToolCallOutputItemStatus = "in_progress" -
const ResponseFunctionToolCallOutputItemStatusCompleted ResponseFunctionToolCallOutputItemStatus = "completed" -
const ResponseFunctionToolCallOutputItemStatusIncomplete ResponseFunctionToolCallOutputItemStatus = "incomplete"
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
type ResponseComputerToolCallOutputItem struct{…}-
ID stringThe unique ID of the computer call tool output.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Status ResponseComputerToolCallOutputItemStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseComputerToolCallOutputItemStatusCompleted ResponseComputerToolCallOutputItemStatus = "completed" -
const ResponseComputerToolCallOutputItemStatusIncomplete ResponseComputerToolCallOutputItemStatus = "incomplete" -
const ResponseComputerToolCallOutputItemStatusFailed ResponseComputerToolCallOutputItemStatus = "failed" -
const ResponseComputerToolCallOutputItemStatusInProgress ResponseComputerToolCallOutputItemStatus = "in_progress"
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
AcknowledgedSafetyChecks []ResponseComputerToolCallOutputItemAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context. -
type ResponseToolSearchCall struct{…}-
ID stringThe unique ID of the tool search call item.
-
Arguments anyArguments used for the tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchCallExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchCallExecutionServer ResponseToolSearchCallExecution = "server" -
const ResponseToolSearchCallExecutionClient ResponseToolSearchCallExecution = "client"
-
-
Status ResponseToolSearchCallStatusThe status of the tool search call item that was recorded.
-
const ResponseToolSearchCallStatusInProgress ResponseToolSearchCallStatus = "in_progress" -
const ResponseToolSearchCallStatusCompleted ResponseToolSearchCallStatus = "completed" -
const ResponseToolSearchCallStatusIncomplete ResponseToolSearchCallStatus = "incomplete"
-
-
Type ToolSearchCallThe type of the item. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseToolSearchOutputItem struct{…}-
ID stringThe unique ID of the tool search output item.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemExecutionServer ResponseToolSearchOutputItemExecution = "server" -
const ResponseToolSearchOutputItemExecutionClient ResponseToolSearchOutputItemExecution = "client"
-
-
Status ResponseToolSearchOutputItemStatusThe status of the tool search output item that was recorded.
-
const ResponseToolSearchOutputItemStatusInProgress ResponseToolSearchOutputItemStatus = "in_progress" -
const ResponseToolSearchOutputItemStatusCompleted ResponseToolSearchOutputItemStatus = "completed" -
const ResponseToolSearchOutputItemStatusIncomplete ResponseToolSearchOutputItemStatus = "incomplete"
-
-
Tools []ToolUnionThe loaded tool definitions returned by tool search.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type ToolSearchOutputThe type of the item. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseOutputItemAdditionalTools struct{…}-
ID stringThe unique ID of the additional tools item.
-
Role stringThe role that provided the additional tools.
-
const ResponseOutputItemAdditionalToolsRoleUnknown ResponseOutputItemAdditionalToolsRole = "unknown" -
const ResponseOutputItemAdditionalToolsRoleUser ResponseOutputItemAdditionalToolsRole = "user" -
const ResponseOutputItemAdditionalToolsRoleAssistant ResponseOutputItemAdditionalToolsRole = "assistant" -
const ResponseOutputItemAdditionalToolsRoleSystem ResponseOutputItemAdditionalToolsRole = "system" -
const ResponseOutputItemAdditionalToolsRoleCritic ResponseOutputItemAdditionalToolsRole = "critic" -
const ResponseOutputItemAdditionalToolsRoleDiscriminator ResponseOutputItemAdditionalToolsRole = "discriminator" -
const ResponseOutputItemAdditionalToolsRoleDeveloper ResponseOutputItemAdditionalToolsRole = "developer" -
const ResponseOutputItemAdditionalToolsRoleTool ResponseOutputItemAdditionalToolsRole = "tool"
-
-
Tools []ToolUnionThe additional tool definitions made available at this item.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type AdditionalToolsThe type of the item. Always
additional_tools.const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"
-
-
type ResponseCompactionItem struct{…}A compaction item generated by the
v1/responses/compactAPI.-
ID stringThe unique ID of the compaction item.
-
EncryptedContent stringThe encrypted content that was produced by compaction.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseOutputItemImageGenerationCall struct{…}An image generation request made by the model.
-
ID stringThe unique ID of the image generation call.
-
Result stringThe generated image encoded in base64.
-
Status stringThe status of the image generation call.
-
const ResponseOutputItemImageGenerationCallStatusInProgress ResponseOutputItemImageGenerationCallStatus = "in_progress" -
const ResponseOutputItemImageGenerationCallStatusCompleted ResponseOutputItemImageGenerationCallStatus = "completed" -
const ResponseOutputItemImageGenerationCallStatusGenerating ResponseOutputItemImageGenerationCallStatus = "generating" -
const ResponseOutputItemImageGenerationCallStatusFailed ResponseOutputItemImageGenerationCallStatus = "failed"
-
-
Type ImageGenerationCallThe type of the image generation call. Always
image_generation_call.const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"
-
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
type ResponseOutputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
ID stringThe unique ID of the local shell call.
-
Action ResponseOutputItemLocalShellCallActionExecute a shell command on the server.
-
Command []stringThe command to run.
-
Env map[string, string]Environment variables to set for the command.
-
Type ExecThe type of the local shell action. Always
exec.const ExecExec Exec = "exec"
-
TimeoutMs int64Optional timeout in milliseconds for the command.
-
User stringOptional user to run the command as.
-
WorkingDirectory stringOptional working directory to run the command in.
-
-
CallID stringThe unique ID of the local shell tool call generated by the model.
-
Status stringThe status of the local shell call.
-
const ResponseOutputItemLocalShellCallStatusInProgress ResponseOutputItemLocalShellCallStatus = "in_progress" -
const ResponseOutputItemLocalShellCallStatusCompleted ResponseOutputItemLocalShellCallStatus = "completed" -
const ResponseOutputItemLocalShellCallStatusIncomplete ResponseOutputItemLocalShellCallStatus = "incomplete"
-
-
Type LocalShellCallThe type of the local shell call. Always
local_shell_call.const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"
-
-
type ResponseOutputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
ID stringThe unique ID of the local shell tool call generated by the model.
-
Output stringA JSON string of the output of the local shell tool call.
-
Type LocalShellCallOutputThe type of the local shell tool call output. Always
local_shell_call_output.const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete.-
const ResponseOutputItemLocalShellCallOutputStatusInProgress ResponseOutputItemLocalShellCallOutputStatus = "in_progress" -
const ResponseOutputItemLocalShellCallOutputStatusCompleted ResponseOutputItemLocalShellCallOutputStatus = "completed" -
const ResponseOutputItemLocalShellCallOutputStatusIncomplete ResponseOutputItemLocalShellCallOutputStatus = "incomplete"
-
-
-
type ResponseFunctionShellToolCall struct{…}A tool call that executes one or more shell commands in a managed environment.
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Action ResponseFunctionShellToolCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []string -
MaxOutputLength int64Optional maximum number of characters to return from each command.
-
TimeoutMs int64Optional timeout in milliseconds for the commands.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Environment ResponseFunctionShellToolCallEnvironmentUnionRepresents the use of a local environment to perform shell actions.
-
type ResponseLocalEnvironment struct{…}Represents the use of a local environment to perform shell actions.
-
Type LocalThe environment type. Always
local.const LocalLocal Local = "local"
-
-
type ResponseContainerReference struct{…}Represents a container created with /v1/containers.
-
ContainerID string -
Type ContainerReferenceThe environment type. Always
container_reference.const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
Status ResponseFunctionShellToolCallStatusThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallStatusInProgress ResponseFunctionShellToolCallStatus = "in_progress" -
const ResponseFunctionShellToolCallStatusCompleted ResponseFunctionShellToolCallStatus = "completed" -
const ResponseFunctionShellToolCallStatusIncomplete ResponseFunctionShellToolCallStatus = "incomplete"
-
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseFunctionShellToolCallOutput struct{…}The output of a shell tool call that was emitted.
-
ID stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
MaxOutputLength int64The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
Output []ResponseFunctionShellToolCallOutputOutputAn array of shell call output contents
-
Outcome ResponseFunctionShellToolCallOutputOutputOutcomeUnionRepresents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
type ResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64Exit code from the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringThe standard error output that was captured.
-
Stdout stringThe standard output that was captured.
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
Status ResponseFunctionShellToolCallOutputStatusThe status of the shell call output. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallOutputStatusInProgress ResponseFunctionShellToolCallOutputStatus = "in_progress" -
const ResponseFunctionShellToolCallOutputStatusCompleted ResponseFunctionShellToolCallOutputStatus = "completed" -
const ResponseFunctionShellToolCallOutputStatusIncomplete ResponseFunctionShellToolCallOutputStatus = "incomplete"
-
-
Type ShellCallOutputThe type of the shell call output. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseApplyPatchToolCall struct{…}A tool call that applies file diffs by creating, deleting, or updating files.
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseApplyPatchToolCallOperationUnionOne of the create_file, delete_file, or update_file operations applied via apply_patch.
-
type ResponseApplyPatchToolCallOperationCreateFile struct{…}Instruction describing how to create a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to create.
-
Type CreateFileCreate a new file with the provided diff.
const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseApplyPatchToolCallOperationDeleteFile struct{…}Instruction describing how to delete a file via the apply_patch tool.
-
Path stringPath of the file to delete.
-
Type DeleteFileDelete the specified file.
const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseApplyPatchToolCallOperationUpdateFile struct{…}Instruction describing how to update a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to update.
-
Type UpdateFileUpdate an existing file with the provided diff.
const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status ResponseApplyPatchToolCallStatusThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseApplyPatchToolCallStatusInProgress ResponseApplyPatchToolCallStatus = "in_progress" -
const ResponseApplyPatchToolCallStatusCompleted ResponseApplyPatchToolCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseApplyPatchToolCallOutput struct{…}The output emitted by an apply patch tool call.
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status ResponseApplyPatchToolCallOutputStatusThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseApplyPatchToolCallOutputStatusCompleted ResponseApplyPatchToolCallOutputStatus = "completed" -
const ResponseApplyPatchToolCallOutputStatusFailed ResponseApplyPatchToolCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
CreatedBy stringThe ID of the entity that created this tool call output.
-
Output stringOptional textual output returned by the apply patch tool.
-
-
type ResponseOutputItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
ID stringThe unique ID of the tool call.
-
Arguments stringA JSON string of the arguments passed to the tool.
-
Name stringThe name of the tool that was run.
-
ServerLabel stringThe label of the MCP server running the tool.
-
Type McpCallThe type of the item. Always
mcp_call.const McpCallMcpCall McpCall = "mcp_call"
-
ApprovalRequestID stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
Error stringThe error from the tool call, if any.
-
Output stringThe output from the tool call.
-
Status stringThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
const ResponseOutputItemMcpCallStatusInProgress ResponseOutputItemMcpCallStatus = "in_progress" -
const ResponseOutputItemMcpCallStatusCompleted ResponseOutputItemMcpCallStatus = "completed" -
const ResponseOutputItemMcpCallStatusIncomplete ResponseOutputItemMcpCallStatus = "incomplete" -
const ResponseOutputItemMcpCallStatusCalling ResponseOutputItemMcpCallStatus = "calling" -
const ResponseOutputItemMcpCallStatusFailed ResponseOutputItemMcpCallStatus = "failed"
-
-
-
type ResponseOutputItemMcpListTools struct{…}A list of tools available on an MCP server.
-
ID stringThe unique ID of the list.
-
ServerLabel stringThe label of the MCP server.
-
Tools []ResponseOutputItemMcpListToolsToolThe tools available on the server.
-
InputSchema anyThe JSON schema describing the tool's input.
-
Name stringThe name of the tool.
-
Annotations anyAdditional annotations about the tool.
-
Description stringThe description of the tool.
-
-
Type McpListToolsThe type of the item. Always
mcp_list_tools.const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
-
Error stringError message if the server could not list tools.
-
-
type ResponseOutputItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
ID stringThe unique ID of the approval request.
-
Arguments stringA JSON string of arguments for the tool.
-
Name stringThe name of the tool to run.
-
ServerLabel stringThe label of the MCP server making the request.
-
Type McpApprovalRequestThe type of the item. Always
mcp_approval_request.const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"
-
-
type ResponseOutputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
ID stringThe unique ID of the approval response
-
ApprovalRequestID stringThe ID of the approval request being answered.
-
Approve boolWhether the request was approved.
-
Type McpApprovalResponseThe type of the item. Always
mcp_approval_response.const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
-
Reason stringOptional reason for the decision.
-
-
type ResponseCustomToolCall struct{…}A call to a custom tool created by the model.
-
type ResponseCustomToolCallOutputItem struct{…}The output of a custom tool call from your code, being sent back to the model.
-
ID stringThe unique ID of the custom tool call output item.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseCustomToolCallOutputItemStatusInProgress ResponseCustomToolCallOutputItemStatus = "in_progress" -
const ResponseCustomToolCallOutputItemStatusCompleted ResponseCustomToolCallOutputItemStatus = "completed" -
const ResponseCustomToolCallOutputItemStatusIncomplete ResponseCustomToolCallOutputItemStatus = "incomplete"
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
-
ParallelToolCalls boolWhether to allow the model to run tool calls in parallel.
-
Temperature float64What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or
top_pbut not both. -
ToolChoice ResponseToolChoiceUnionHow the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call.-
type ToolChoiceOptions stringControls which (if any) tool is called by the model.
nonemeans the model will not call any tool and instead generates a message.automeans the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools.-
const ToolChoiceOptionsNone ToolChoiceOptions = "none" -
const ToolChoiceOptionsAuto ToolChoiceOptions = "auto" -
const ToolChoiceOptionsRequired ToolChoiceOptions = "required"
-
-
type ToolChoiceAllowed struct{…}Constrains the tools available to the model to a pre-defined set.
-
Mode ToolChoiceAllowedModeConstrains the tools available to the model to a pre-defined set.
autoallows the model to pick from among the allowed tools and generate a message.requiredrequires the model to call one or more of the allowed tools.-
const ToolChoiceAllowedModeAuto ToolChoiceAllowedMode = "auto" -
const ToolChoiceAllowedModeRequired ToolChoiceAllowedMode = "required"
-
-
Tools []map[string, any]A list of tool definitions that the model should be allowed to call.
For the Responses API, the list of tool definitions might look like:
[ { "type": "function", "name": "get_weather" }, { "type": "mcp", "server_label": "deepwiki" }, { "type": "image_generation" } ] -
Type AllowedToolsAllowed tool configuration type. Always
allowed_tools.const AllowedToolsAllowedTools AllowedTools = "allowed_tools"
-
-
type ToolChoiceTypes struct{…}Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
-
Type ToolChoiceTypesTypeThe type of hosted tool the model should to use. Learn more about built-in tools.
Allowed values are:
-
file_search -
web_search_preview -
computer -
computer_use_preview -
computer_use -
code_interpreter -
image_generation -
const ToolChoiceTypesTypeFileSearch ToolChoiceTypesType = "file_search" -
const ToolChoiceTypesTypeWebSearchPreview ToolChoiceTypesType = "web_search_preview" -
const ToolChoiceTypesTypeComputer ToolChoiceTypesType = "computer" -
const ToolChoiceTypesTypeComputerUsePreview ToolChoiceTypesType = "computer_use_preview" -
const ToolChoiceTypesTypeComputerUse ToolChoiceTypesType = "computer_use" -
const ToolChoiceTypesTypeWebSearchPreview2025_03_11 ToolChoiceTypesType = "web_search_preview_2025_03_11" -
const ToolChoiceTypesTypeImageGeneration ToolChoiceTypesType = "image_generation" -
const ToolChoiceTypesTypeCodeInterpreter ToolChoiceTypesType = "code_interpreter"
-
-
-
type ToolChoiceFunction struct{…}Use this option to force the model to call a specific function.
-
Name stringThe name of the function to call.
-
Type FunctionFor function calling, the type is always
function.const FunctionFunction Function = "function"
-
-
type ToolChoiceMcp struct{…}Use this option to force the model to call a specific tool on a remote MCP server.
-
ServerLabel stringThe label of the MCP server to use.
-
Type McpFor MCP tools, the type is always
mcp.const McpMcp Mcp = "mcp"
-
Name stringThe name of the tool to call on the server.
-
-
type ToolChoiceCustom struct{…}Use this option to force the model to call a specific custom tool.
-
Name stringThe name of the custom tool to call.
-
Type CustomFor custom tool calling, the type is always
custom.const CustomCustom Custom = "custom"
-
-
type ToolChoiceApplyPatch struct{…}Forces the model to call the apply_patch tool when executing a tool call.
-
Type ApplyPatchThe tool to call. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
type ToolChoiceShell struct{…}Forces the model to call the shell tool when a tool call is required.
-
Type ShellThe tool to call. Always
shell.const ShellShell Shell = "shell"
-
-
-
Tools []ToolUnionAn array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.We support the following categories of tools:
-
Built-in tools: Tools that are provided by OpenAI that extend the model's capabilities, like web search or file search. Learn more about built-in tools.
-
MCP Tools: Integrations with third-party systems via custom MCP servers or predefined connectors such as Google Drive and SharePoint. Learn more about MCP Tools.
-
Function calls (custom tools): Functions that are defined by you, enabling the model to call your own code with strongly typed arguments and outputs. Learn more about function calling. You can also use custom tools to call your own code.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
TopP float64An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
We generally recommend altering this or
temperaturebut not both. -
Background boolWhether to run the model response in the background. Learn more.
-
CompletedAt float64Unix timestamp (in seconds) of when this Response was completed. Only present when the status is
completed. -
Conversation ResponseConversationThe conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
-
ID stringThe unique ID of the conversation that this response was associated with.
-
-
MaxOutputTokens int64An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
MaxToolCalls int64The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored.
-
Moderation ResponseModerationModeration results for the response input and output, if moderated completions were requested.
-
Input ResponseModerationInputUnionModeration for the response input.
-
type ResponseModerationInputModerationResult struct{…}A moderation result produced for the response input or output.
-
Categories map[string, bool]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
CategoryAppliedInputTypes map[string, []string]Which modalities of input are reflected by the score for each category.
-
const ResponseModerationInputModerationResultCategoryAppliedInputTypeText ResponseModerationInputModerationResultCategoryAppliedInputType = "text" -
const ResponseModerationInputModerationResultCategoryAppliedInputTypeImage ResponseModerationInputModerationResultCategoryAppliedInputType = "image"
-
-
CategoryScores map[string, float64]A dictionary of moderation categories to scores.
-
Flagged boolA boolean indicating whether the content was flagged by any category.
-
Model stringThe moderation model that produced this result.
-
Type ModerationResultThe object type, which was always
moderation_resultfor successful moderation results.const ModerationResultModerationResult ModerationResult = "moderation_result"
-
-
type ResponseModerationInputError struct{…}An error produced while attempting moderation for the response input or output.
-
Code stringThe error code.
-
Message stringThe error message.
-
Type ErrorThe object type, which was always
errorfor moderation failures.const ErrorError Error = "error"
-
-
-
Output ResponseModerationOutputUnionModeration for the response output.
-
type ResponseModerationOutputModerationResult struct{…}A moderation result produced for the response input or output.
-
Categories map[string, bool]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
CategoryAppliedInputTypes map[string, []string]Which modalities of input are reflected by the score for each category.
-
const ResponseModerationOutputModerationResultCategoryAppliedInputTypeText ResponseModerationOutputModerationResultCategoryAppliedInputType = "text" -
const ResponseModerationOutputModerationResultCategoryAppliedInputTypeImage ResponseModerationOutputModerationResultCategoryAppliedInputType = "image"
-
-
CategoryScores map[string, float64]A dictionary of moderation categories to scores.
-
Flagged boolA boolean indicating whether the content was flagged by any category.
-
Model stringThe moderation model that produced this result.
-
Type ModerationResultThe object type, which was always
moderation_resultfor successful moderation results.const ModerationResultModerationResult ModerationResult = "moderation_result"
-
-
type ResponseModerationOutputError struct{…}An error produced while attempting moderation for the response input or output.
-
Code stringThe error code.
-
Message stringThe error message.
-
Type ErrorThe object type, which was always
errorfor moderation failures.const ErrorError Error = "error"
-
-
-
-
PreviousResponseID stringThe unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about conversation state. Cannot be used in conjunction with
conversation. -
Prompt ResponsePromptReference to a prompt template and its variables. Learn more.
-
ID stringThe unique identifier of the prompt template to use.
-
Variables map[string, ResponsePromptVariableUnion]Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files.
-
string -
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
Version stringOptional version of the prompt template.
-
-
PromptCacheKey stringUsed by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more. -
PromptCacheRetention ResponsePromptCacheRetentionThe retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. Forgpt-5.5,gpt-5.5-pro, and future models, only24his supported.For older models that support both
in_memoryand24h, the default depends on your organization's data retention policy:-
Organizations without ZDR enabled default to
24h. -
Organizations with ZDR enabled default to
in_memorywhenprompt_cache_retentionis not specified. -
const ResponsePromptCacheRetentionInMemory ResponsePromptCacheRetention = "in_memory" -
const ResponsePromptCacheRetention24h ResponsePromptCacheRetention = "24h"
-
-
Reasoning Reasoninggpt-5 and o-series models only
Configuration options for reasoning models.
-
Context ReasoningContextControls which reasoning items are rendered back to the model on later turns. When returned on a response, this is the effective reasoning context mode used for the response.
-
const ReasoningContextAuto ReasoningContext = "auto" -
const ReasoningContextCurrentTurn ReasoningContext = "current_turn" -
const ReasoningContextAllTurns ReasoningContext = "all_turns"
-
-
Effort ReasoningEffortConstrains effort on reasoning for reasoning models. Currently supported values are
none,minimal,low,medium,high, andxhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.-
gpt-5.1defaults tonone, which does not perform reasoning. The supported reasoning values forgpt-5.1arenone,low,medium, andhigh. Tool calls are supported for all reasoning values in gpt-5.1. -
All models before
gpt-5.1default tomediumreasoning effort, and do not supportnone. -
The
gpt-5-promodel defaults to (and only supports)highreasoning effort. -
xhighis supported for all models aftergpt-5.1-codex-max. -
const ReasoningEffortNone ReasoningEffort = "none" -
const ReasoningEffortMinimal ReasoningEffort = "minimal" -
const ReasoningEffortLow ReasoningEffort = "low" -
const ReasoningEffortMedium ReasoningEffort = "medium" -
const ReasoningEffortHigh ReasoningEffort = "high" -
const ReasoningEffortXhigh ReasoningEffort = "xhigh"
-
-
GenerateSummary ReasoningGenerateSummaryDeprecated: use
summaryinstead.A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.-
const ReasoningGenerateSummaryAuto ReasoningGenerateSummary = "auto" -
const ReasoningGenerateSummaryConcise ReasoningGenerateSummary = "concise" -
const ReasoningGenerateSummaryDetailed ReasoningGenerateSummary = "detailed"
-
-
Summary ReasoningSummaryA summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.conciseis supported forcomputer-use-previewmodels and all reasoning models aftergpt-5.-
const ReasoningSummaryAuto ReasoningSummary = "auto" -
const ReasoningSummaryConcise ReasoningSummary = "concise" -
const ReasoningSummaryDetailed ReasoningSummary = "detailed"
-
-
-
SafetyIdentifier stringA stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
ServiceTier ResponseServiceTierSpecifies the processing type used for serving the request.
- If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'.
- If set to 'default', then the request will be processed with the standard pricing and performance for the selected model.
- If set to 'flex' or 'priority', then the request will be processed with the corresponding service tier.
- When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.-
const ResponseServiceTierAuto ResponseServiceTier = "auto" -
const ResponseServiceTierDefault ResponseServiceTier = "default" -
const ResponseServiceTierFlex ResponseServiceTier = "flex" -
const ResponseServiceTierScale ResponseServiceTier = "scale" -
const ResponseServiceTierPriority ResponseServiceTier = "priority"
-
Status ResponseStatusThe status of the response generation. One of
completed,failed,in_progress,cancelled,queued, orincomplete.-
const ResponseStatusCompleted ResponseStatus = "completed" -
const ResponseStatusFailed ResponseStatus = "failed" -
const ResponseStatusInProgress ResponseStatus = "in_progress" -
const ResponseStatusCancelled ResponseStatus = "cancelled" -
const ResponseStatusQueued ResponseStatus = "queued" -
const ResponseStatusIncomplete ResponseStatus = "incomplete"
-
-
Text ResponseTextConfigConfiguration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
Format ResponseFormatTextConfigUnionAn object specifying the format that the model must output.
Configuring
{ "type": "json_schema" }enables Structured Outputs, which ensures the model will match your supplied JSON schema. Learn more in the Structured Outputs guide.The default format is
{ "type": "text" }with no additional options.Not recommended for gpt-4o and newer models:
Setting to
{ "type": "json_object" }enables the older JSON mode, which ensures the message the model generates is valid JSON. Usingjson_schemais preferred for models that support it.-
type ResponseFormatText struct{…}Default response format. Used to generate text responses.
-
Type TextThe type of response format being defined. Always
text.const TextText Text = "text"
-
-
type ResponseFormatTextJSONSchemaConfig struct{…}JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
Name stringThe name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
-
Schema map[string, any]The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
-
Type JSONSchemaThe type of response format being defined. Always
json_schema.const JSONSchemaJSONSchema JSONSchema = "json_schema"
-
Description stringA description of what the response format is for, used by the model to determine how to respond in the format.
-
Strict boolWhether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the
schemafield. Only a subset of JSON Schema is supported whenstrictistrue. To learn more, read the Structured Outputs guide.
-
-
type ResponseFormatJSONObject struct{…}JSON object response format. An older method of generating JSON responses. Using
json_schemais 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 JSONObjectThe type of response format being defined. Always
json_object.const JSONObjectJSONObject JSONObject = "json_object"
-
-
-
Verbosity ResponseTextConfigVerbosityConstrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses. Currently supported values are
low,medium, andhigh.-
const ResponseTextConfigVerbosityLow ResponseTextConfigVerbosity = "low" -
const ResponseTextConfigVerbosityMedium ResponseTextConfigVerbosity = "medium" -
const ResponseTextConfigVerbosityHigh ResponseTextConfigVerbosity = "high"
-
-
TopLogprobs int64An integer between 0 and 20 specifying the maximum number of most likely tokens to return at each token position, each with an associated log probability. In some cases, the number of returned tokens may be fewer than requested.
-
Truncation ResponseTruncationThe truncation strategy to use for the model response.
-
auto: If the input to this Response exceeds the model's context window size, the model will truncate the response to fit the context window by dropping items from the beginning of the conversation. -
disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error. -
const ResponseTruncationAuto ResponseTruncation = "auto" -
const ResponseTruncationDisabled ResponseTruncation = "disabled"
-
-
Usage ResponseUsageRepresents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
-
InputTokens int64The number of input tokens.
-
InputTokensDetails ResponseUsageInputTokensDetailsA detailed breakdown of the input tokens.
-
CachedTokens int64The number of tokens that were retrieved from the cache. More on prompt caching.
-
-
OutputTokens int64The number of output tokens.
-
OutputTokensDetails ResponseUsageOutputTokensDetailsA detailed breakdown of the output tokens.
-
ReasoningTokens int64The number of reasoning tokens.
-
-
TotalTokens int64The total number of tokens used.
-
-
User stringThis field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead to maintain caching optimizations. A stable identifier for your end-users. Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. Learn more.
-
Example
package main
import (
"context"
"fmt"
"github.com/openai/openai-go"
"github.com/openai/openai-go/option"
"github.com/openai/openai-go/responses"
)
func main() {
client := openai.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.ID)
}
Response
{
"id": "id",
"created_at": 0,
"error": {
"code": "server_error",
"message": "message"
},
"incomplete_details": {
"reason": "max_output_tokens"
},
"instructions": "string",
"metadata": {
"foo": "string"
},
"model": "gpt-5.1",
"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,
"temperature": 1,
"tool_choice": "none",
"tools": [
{
"name": "name",
"parameters": {
"foo": "bar"
},
"strict": true,
"type": "function",
"defer_loading": true,
"description": "description"
}
],
"top_p": 1,
"background": true,
"completed_at": 0,
"conversation": {
"id": "id"
},
"max_output_tokens": 0,
"max_tool_calls": 0,
"moderation": {
"input": {
"categories": {
"foo": true
},
"category_applied_input_types": {
"foo": [
"text"
]
},
"category_scores": {
"foo": 0
},
"flagged": true,
"model": "model",
"type": "moderation_result"
},
"output": {
"categories": {
"foo": true
},
"category_applied_input_types": {
"foo": [
"text"
]
},
"category_scores": {
"foo": 0
},
"flagged": true,
"model": "model",
"type": "moderation_result"
}
},
"output_text": "output_text",
"previous_response_id": "previous_response_id",
"prompt": {
"id": "id",
"variables": {
"foo": "string"
},
"version": "version"
},
"prompt_cache_key": "prompt-cache-key-1234",
"prompt_cache_retention": "in_memory",
"reasoning": {
"context": "auto",
"effort": "none",
"generate_summary": "auto",
"summary": "auto"
},
"safety_identifier": "safety-identifier-1234",
"service_tier": "auto",
"status": "completed",
"text": {
"format": {
"type": "text"
},
"verbosity": "low"
},
"top_logprobs": 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-1234"
}
Get a model response
client.Responses.Get(ctx, responseID, query) (*Response, error)
get /responses/{response_id}
Retrieves a model response with the given ID.
Parameters
-
responseID string -
query ResponseGetParams-
Include param.Field[[]ResponseIncludable]Additional fields to include in the response. See the
includeparameter for Response creation above for more information.-
const ResponseIncludableFileSearchCallResults ResponseIncludable = "file_search_call.results" -
const ResponseIncludableWebSearchCallResults ResponseIncludable = "web_search_call.results" -
const ResponseIncludableWebSearchCallActionSources ResponseIncludable = "web_search_call.action.sources" -
const ResponseIncludableMessageInputImageImageURL ResponseIncludable = "message.input_image.image_url" -
const ResponseIncludableComputerCallOutputOutputImageURL ResponseIncludable = "computer_call_output.output.image_url" -
const ResponseIncludableCodeInterpreterCallOutputs ResponseIncludable = "code_interpreter_call.outputs" -
const ResponseIncludableReasoningEncryptedContent ResponseIncludable = "reasoning.encrypted_content" -
const ResponseIncludableMessageOutputTextLogprobs ResponseIncludable = "message.output_text.logprobs"
-
-
IncludeObfuscation param.Field[bool]When true, stream obfuscation will be enabled. Stream obfuscation adds random characters to an
obfuscationfield on streaming delta events to normalize payload sizes as a mitigation to certain side-channel attacks. These obfuscation fields are included by default, but add a small amount of overhead to the data stream. You can setinclude_obfuscationto false to optimize for bandwidth if you trust the network links between your application and the OpenAI API. -
StartingAfter param.Field[int64]The sequence number of the event after which to start streaming.
-
``
-
Returns
-
type Response struct{…}-
ID stringUnique identifier for this Response.
-
CreatedAt float64Unix timestamp (in seconds) of when this Response was created.
-
Error ResponseErrorAn error object returned when the model fails to generate a Response.
-
Code ResponseErrorCodeThe error code for the response.
-
const ResponseErrorCodeServerError ResponseErrorCode = "server_error" -
const ResponseErrorCodeRateLimitExceeded ResponseErrorCode = "rate_limit_exceeded" -
const ResponseErrorCodeInvalidPrompt ResponseErrorCode = "invalid_prompt" -
const ResponseErrorCodeVectorStoreTimeout ResponseErrorCode = "vector_store_timeout" -
const ResponseErrorCodeInvalidImage ResponseErrorCode = "invalid_image" -
const ResponseErrorCodeInvalidImageFormat ResponseErrorCode = "invalid_image_format" -
const ResponseErrorCodeInvalidBase64Image ResponseErrorCode = "invalid_base64_image" -
const ResponseErrorCodeInvalidImageURL ResponseErrorCode = "invalid_image_url" -
const ResponseErrorCodeImageTooLarge ResponseErrorCode = "image_too_large" -
const ResponseErrorCodeImageTooSmall ResponseErrorCode = "image_too_small" -
const ResponseErrorCodeImageParseError ResponseErrorCode = "image_parse_error" -
const ResponseErrorCodeImageContentPolicyViolation ResponseErrorCode = "image_content_policy_violation" -
const ResponseErrorCodeInvalidImageMode ResponseErrorCode = "invalid_image_mode" -
const ResponseErrorCodeImageFileTooLarge ResponseErrorCode = "image_file_too_large" -
const ResponseErrorCodeUnsupportedImageMediaType ResponseErrorCode = "unsupported_image_media_type" -
const ResponseErrorCodeEmptyImageFile ResponseErrorCode = "empty_image_file" -
const ResponseErrorCodeFailedToDownloadImage ResponseErrorCode = "failed_to_download_image" -
const ResponseErrorCodeImageFileNotFound ResponseErrorCode = "image_file_not_found"
-
-
Message stringA human-readable description of the error.
-
-
IncompleteDetails ResponseIncompleteDetailsDetails about why the response is incomplete.
-
Reason stringThe reason why the response is incomplete.
-
const ResponseIncompleteDetailsReasonMaxOutputTokens ResponseIncompleteDetailsReason = "max_output_tokens" -
const ResponseIncompleteDetailsReasonContentFilter ResponseIncompleteDetailsReason = "content_filter"
-
-
-
Instructions ResponseInstructionsUnionA system (or developer) message inserted into the model's context.
When using along with
previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses.-
string -
type ResponseInstructionsInputItemList []ResponseInputItemUnionA list of one or many input items to the model, containing different content types.
-
type EasyInputMessage struct{…}A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.-
Content EasyInputMessageContentUnionText, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
-
string -
type ResponseInputMessageContentList []ResponseInputContentUnionA list of one or many input items to the model, containing different content types.
-
type ResponseInputText struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
Detail ResponseInputImageDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageDetailLow ResponseInputImageDetail = "low" -
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high" -
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto" -
const ResponseInputImageDetailOriginal ResponseInputImageDetail = "original"
-
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFile struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileDetailLow ResponseInputFileDetail = "low" -
const ResponseInputFileDetailHigh ResponseInputFileDetail = "high"
-
-
FileData stringThe content of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Role EasyInputMessageRoleThe role of the message input. One of
user,assistant,system, ordeveloper.-
const EasyInputMessageRoleUser EasyInputMessageRole = "user" -
const EasyInputMessageRoleAssistant EasyInputMessageRole = "assistant" -
const EasyInputMessageRoleSystem EasyInputMessageRole = "system" -
const EasyInputMessageRoleDeveloper EasyInputMessageRole = "developer"
-
-
Phase EasyInputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const EasyInputMessagePhaseCommentary EasyInputMessagePhase = "commentary" -
const EasyInputMessagePhaseFinalAnswer EasyInputMessagePhase = "final_answer"
-
-
Type EasyInputMessageTypeThe type of the message input. Always
message.const EasyInputMessageTypeMessage EasyInputMessageType = "message"
-
-
type ResponseInputItemMessage struct{…}A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole.-
Content ResponseInputMessageContentListA list of one or many input items to the model, containing different content types.
-
Role stringThe role of the message input. One of
user,system, ordeveloper.-
const ResponseInputItemMessageRoleUser ResponseInputItemMessageRole = "user" -
const ResponseInputItemMessageRoleSystem ResponseInputItemMessageRole = "system" -
const ResponseInputItemMessageRoleDeveloper ResponseInputItemMessageRole = "developer"
-
-
Status stringThe status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputItemMessageStatusInProgress ResponseInputItemMessageStatus = "in_progress" -
const ResponseInputItemMessageStatusCompleted ResponseInputItemMessageStatus = "completed" -
const ResponseInputItemMessageStatusIncomplete ResponseInputItemMessageStatus = "incomplete"
-
-
Type stringThe type of the message input. Always set to
message.const ResponseInputItemMessageTypeMessage ResponseInputItemMessageType = "message"
-
-
type ResponseOutputMessage struct{…}An output message from the model.
-
ID stringThe unique ID of the output message.
-
Content []ResponseOutputMessageContentUnionThe content of the output message.
-
type ResponseOutputText struct{…}A text output from the model.
-
Annotations []ResponseOutputTextAnnotationUnionThe annotations of the text output.
-
type ResponseOutputTextAnnotationFileCitation struct{…}A citation to a file.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the file cited.
-
Index int64The index of the file in the list of files.
-
Type FileCitationThe type of the file citation. Always
file_citation.const FileCitationFileCitation FileCitation = "file_citation"
-
-
type ResponseOutputTextAnnotationURLCitation struct{…}A citation for a web resource used to generate a model response.
-
EndIndex int64The index of the last character of the URL citation in the message.
-
StartIndex int64The index of the first character of the URL citation in the message.
-
Title stringThe title of the web resource.
-
Type URLCitationThe type of the URL citation. Always
url_citation.const URLCitationURLCitation URLCitation = "url_citation"
-
URL stringThe URL of the web resource.
-
-
type ResponseOutputTextAnnotationContainerFileCitation struct{…}A citation for a container file used to generate a model response.
-
ContainerID stringThe ID of the container file.
-
EndIndex int64The index of the last character of the container file citation in the message.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the container file cited.
-
StartIndex int64The index of the first character of the container file citation in the message.
-
Type ContainerFileCitationThe type of the container file citation. Always
container_file_citation.const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"
-
-
type ResponseOutputTextAnnotationFilePath struct{…}A path to a file.
-
FileID stringThe ID of the file.
-
Index int64The index of the file in the list of files.
-
Type FilePathThe type of the file path. Always
file_path.const FilePathFilePath FilePath = "file_path"
-
-
-
Text stringThe text output from the model.
-
Type OutputTextThe type of the output text. Always
output_text.const OutputTextOutputText OutputText = "output_text"
-
Logprobs []ResponseOutputTextLogprob-
Token string -
Bytes []int64 -
Logprob float64 -
TopLogprobs []ResponseOutputTextLogprobTopLogprob-
Token string -
Bytes []int64 -
Logprob float64
-
-
-
-
type ResponseOutputRefusal struct{…}A refusal from the model.
-
Refusal stringThe refusal explanation from the model.
-
Type RefusalThe type of the refusal. Always
refusal.const RefusalRefusal Refusal = "refusal"
-
-
-
Role AssistantThe role of the output message. Always
assistant.const AssistantAssistant Assistant = "assistant"
-
Status ResponseOutputMessageStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseOutputMessageStatusInProgress ResponseOutputMessageStatus = "in_progress" -
const ResponseOutputMessageStatusCompleted ResponseOutputMessageStatus = "completed" -
const ResponseOutputMessageStatusIncomplete ResponseOutputMessageStatus = "incomplete"
-
-
Type MessageThe type of the output message. Always
message.const MessageMessage Message = "message"
-
Phase ResponseOutputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const ResponseOutputMessagePhaseCommentary ResponseOutputMessagePhase = "commentary" -
const ResponseOutputMessagePhaseFinalAnswer ResponseOutputMessagePhase = "final_answer"
-
-
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
ID stringThe unique ID of the file search tool call.
-
Queries []stringThe queries used to search for files.
-
Status ResponseFileSearchToolCallStatusThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
const ResponseFileSearchToolCallStatusInProgress ResponseFileSearchToolCallStatus = "in_progress" -
const ResponseFileSearchToolCallStatusSearching ResponseFileSearchToolCallStatus = "searching" -
const ResponseFileSearchToolCallStatusCompleted ResponseFileSearchToolCallStatus = "completed" -
const ResponseFileSearchToolCallStatusIncomplete ResponseFileSearchToolCallStatus = "incomplete" -
const ResponseFileSearchToolCallStatusFailed ResponseFileSearchToolCallStatus = "failed"
-
-
Type FileSearchCallThe type of the file search tool call. Always
file_search_call.const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"
-
Results []ResponseFileSearchToolCallResultThe results of the file search tool call.
-
Attributes map[string, ResponseFileSearchToolCallResultAttributeUnion]Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.
-
string -
float64 -
bool
-
-
FileID stringThe unique ID of the file.
-
Filename stringThe name of the file.
-
Score float64The relevance score of the file - a value between 0 and 1.
-
Text stringThe text that was retrieved from the file.
-
-
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
ID stringThe unique ID of the computer call.
-
CallID stringAn identifier used when responding to the tool call with output.
-
PendingSafetyChecks []ResponseComputerToolCallPendingSafetyCheckThe pending safety checks for the computer call.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status ResponseComputerToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseComputerToolCallStatusInProgress ResponseComputerToolCallStatus = "in_progress" -
const ResponseComputerToolCallStatusCompleted ResponseComputerToolCallStatus = "completed" -
const ResponseComputerToolCallStatusIncomplete ResponseComputerToolCallStatus = "incomplete"
-
-
Type ResponseComputerToolCallTypeThe type of the computer call. Always
computer_call.const ResponseComputerToolCallTypeComputerCall ResponseComputerToolCallType = "computer_call"
-
Action ResponseComputerToolCallActionUnionA click action.
-
type ResponseComputerToolCallActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ResponseComputerToolCallActionClickButtonLeft ResponseComputerToolCallActionClickButton = "left" -
const ResponseComputerToolCallActionClickButtonRight ResponseComputerToolCallActionClickButton = "right" -
const ResponseComputerToolCallActionClickButtonWheel ResponseComputerToolCallActionClickButton = "wheel" -
const ResponseComputerToolCallActionClickButtonBack ResponseComputerToolCallActionClickButton = "back" -
const ResponseComputerToolCallActionClickButtonForward ResponseComputerToolCallActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ResponseComputerToolCallActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ResponseComputerToolCallActionDrag struct{…}A drag action.
-
Path []ResponseComputerToolCallActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ResponseComputerToolCallActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ResponseComputerToolCallActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ResponseComputerToolCallActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ResponseComputerToolCallActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ResponseComputerToolCallActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ResponseComputerToolCallActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
Actions ComputerActionListFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
type ComputerActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ComputerActionClickButtonLeft ComputerActionClickButton = "left" -
const ComputerActionClickButtonRight ComputerActionClickButton = "right" -
const ComputerActionClickButtonWheel ComputerActionClickButton = "wheel" -
const ComputerActionClickButtonBack ComputerActionClickButton = "back" -
const ComputerActionClickButtonForward ComputerActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ComputerActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ComputerActionDrag struct{…}A drag action.
-
Path []ComputerActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ComputerActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ComputerActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ComputerActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ComputerActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ComputerActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ComputerActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
-
type ResponseInputItemComputerCallOutput struct{…}The output of a computer tool call.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Type ComputerScreenshotSpecifies the event type. For a computer screenshot, this property is always set to
computer_screenshot.const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"
-
FileID stringThe identifier of an uploaded file that contains the screenshot.
-
ImageURL stringThe URL of the screenshot image.
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
ID stringThe ID of the computer tool call output.
-
AcknowledgedSafetyChecks []ResponseInputItemComputerCallOutputAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status stringThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseInputItemComputerCallOutputStatusInProgress ResponseInputItemComputerCallOutputStatus = "in_progress" -
const ResponseInputItemComputerCallOutputStatusCompleted ResponseInputItemComputerCallOutputStatus = "completed" -
const ResponseInputItemComputerCallOutputStatusIncomplete ResponseInputItemComputerCallOutputStatus = "incomplete"
-
-
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
ID stringThe unique ID of the web search tool call.
-
Action ResponseFunctionWebSearchActionUnionAn object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
type ResponseFunctionWebSearchActionSearch struct{…}Action type "search" - Performs a web search query.
-
Type SearchThe action type.
const SearchSearch Search = "search"
-
Queries []stringThe search queries.
-
Query stringThe search query.
-
Sources []ResponseFunctionWebSearchActionSearchSourceThe sources used in the search.
-
Type URLThe type of source. Always
url.const URLURL URL = "url"
-
URL stringThe URL of the source.
-
-
-
type ResponseFunctionWebSearchActionOpenPage struct{…}Action type "open_page" - Opens a specific URL from search results.
-
Type OpenPageThe action type.
const OpenPageOpenPage OpenPage = "open_page"
-
URL stringThe URL opened by the model.
-
-
type ResponseFunctionWebSearchActionFindInPage struct{…}Action type "find_in_page": Searches for a pattern within a loaded page.
-
Pattern stringThe pattern or text to search for within the page.
-
Type FindInPageThe action type.
const FindInPageFindInPage FindInPage = "find_in_page"
-
URL stringThe URL of the page searched for the pattern.
-
-
-
Status ResponseFunctionWebSearchStatusThe status of the web search tool call.
-
const ResponseFunctionWebSearchStatusInProgress ResponseFunctionWebSearchStatus = "in_progress" -
const ResponseFunctionWebSearchStatusSearching ResponseFunctionWebSearchStatus = "searching" -
const ResponseFunctionWebSearchStatusCompleted ResponseFunctionWebSearchStatus = "completed" -
const ResponseFunctionWebSearchStatusFailed ResponseFunctionWebSearchStatus = "failed"
-
-
Type WebSearchCallThe type of the web search tool call. Always
web_search_call.const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"
-
-
type ResponseFunctionToolCall struct{…}A tool call to run a function. See the function calling guide for more information.
-
Arguments stringA JSON string of the arguments to pass to the function.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Name stringThe name of the function to run.
-
Type FunctionCallThe type of the function tool call. Always
function_call.const FunctionCallFunctionCall FunctionCall = "function_call"
-
ID stringThe unique ID of the function tool call.
-
Namespace stringThe namespace of the function to run.
-
Status ResponseFunctionToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallStatusInProgress ResponseFunctionToolCallStatus = "in_progress" -
const ResponseFunctionToolCallStatusCompleted ResponseFunctionToolCallStatus = "completed" -
const ResponseFunctionToolCallStatusIncomplete ResponseFunctionToolCallStatus = "incomplete"
-
-
-
type ResponseInputItemFunctionCallOutput struct{…}The output of a function tool call.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseInputItemFunctionCallOutputOutputUnionText, image, or file output of the function tool call.
-
string -
type ResponseFunctionCallOutputItemList []ResponseFunctionCallOutputItemUnionAn array of content outputs (text, image, file) for the function tool call.
-
type ResponseInputTextContent struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImageContent struct{…}An image input to the model. Learn about image inputs
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
Detail ResponseInputImageContentDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageContentDetailLow ResponseInputImageContentDetail = "low" -
const ResponseInputImageContentDetailHigh ResponseInputImageContentDetail = "high" -
const ResponseInputImageContentDetailAuto ResponseInputImageContentDetail = "auto" -
const ResponseInputImageContentDetailOriginal ResponseInputImageContentDetail = "original"
-
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFileContent struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileContentDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileContentDetailLow ResponseInputFileContentDetail = "low" -
const ResponseInputFileContentDetailHigh ResponseInputFileContentDetail = "high"
-
-
FileData stringThe base64-encoded data of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
ID stringThe unique ID of the function tool call output. Populated when this item is returned via API.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputItemFunctionCallOutputStatusInProgress ResponseInputItemFunctionCallOutputStatus = "in_progress" -
const ResponseInputItemFunctionCallOutputStatusCompleted ResponseInputItemFunctionCallOutputStatus = "completed" -
const ResponseInputItemFunctionCallOutputStatusIncomplete ResponseInputItemFunctionCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemToolSearchCall struct{…}-
Arguments anyThe arguments supplied to the tool search call.
-
Type ToolSearchCallThe item type. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
ID stringThe unique ID of this tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution stringWhether tool search was executed by the server or by the client.
-
const ResponseInputItemToolSearchCallExecutionServer ResponseInputItemToolSearchCallExecution = "server" -
const ResponseInputItemToolSearchCallExecutionClient ResponseInputItemToolSearchCallExecution = "client"
-
-
Status stringThe status of the tool search call.
-
const ResponseInputItemToolSearchCallStatusInProgress ResponseInputItemToolSearchCallStatus = "in_progress" -
const ResponseInputItemToolSearchCallStatusCompleted ResponseInputItemToolSearchCallStatus = "completed" -
const ResponseInputItemToolSearchCallStatusIncomplete ResponseInputItemToolSearchCallStatus = "incomplete"
-
-
-
type ResponseToolSearchOutputItemParamResp struct{…}-
Tools []ToolUnionThe loaded tool definitions returned by the tool search output.
-
type FunctionTool struct{…}Defines a function in your own code the model can choose to call. Learn more about function calling.
-
Name stringThe name of the function to call.
-
Parameters map[string, any]A JSON schema object describing the parameters of the function.
-
Strict boolWhether to enforce strict parameter validation. Default
true. -
Type FunctionThe type of the function tool. Always
function.const FunctionFunction Function = "function"
-
DeferLoading boolWhether this function is deferred and loaded via tool search.
-
Description stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
type FileSearchTool struct{…}A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
Type FileSearchThe type of the file search tool. Always
file_search.const FileSearchFileSearch FileSearch = "file_search"
-
VectorStoreIDs []stringThe IDs of the vector stores to search.
-
Filters FileSearchToolFiltersUnionA filter to apply.
-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
Key stringThe key to compare against the value.
-
Type ComparisonFilterTypeSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
const ComparisonFilterTypeEq ComparisonFilterType = "eq" -
const ComparisonFilterTypeNe ComparisonFilterType = "ne" -
const ComparisonFilterTypeGt ComparisonFilterType = "gt" -
const ComparisonFilterTypeGte ComparisonFilterType = "gte" -
const ComparisonFilterTypeLt ComparisonFilterType = "lt" -
const ComparisonFilterTypeLte ComparisonFilterType = "lte" -
const ComparisonFilterTypeIn ComparisonFilterType = "in" -
const ComparisonFilterTypeNin ComparisonFilterType = "nin"
-
-
Value ComparisonFilterValueUnionThe value to compare against the attribute key; supports string, number, or boolean types.
-
string -
float64 -
bool -
type ComparisonFilterValueArray []ComparisonFilterValueArrayItemUnion-
string -
float64
-
-
-
-
type CompoundFilter struct{…}Combine multiple filters using
andoror.-
Filters []ComparisonFilterArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
-
Type CompoundFilterTypeType of operation:
andoror.-
const CompoundFilterTypeAnd CompoundFilterType = "and" -
const CompoundFilterTypeOr CompoundFilterType = "or"
-
-
-
-
MaxNumResults int64The maximum number of results to return. This number should be between 1 and 50 inclusive.
-
RankingOptions FileSearchToolRankingOptionsRanking options for search.
-
HybridSearch FileSearchToolRankingOptionsHybridSearchWeights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
EmbeddingWeight float64The weight of the embedding in the reciprocal ranking fusion.
-
TextWeight float64The weight of the text in the reciprocal ranking fusion.
-
-
Ranker stringThe ranker to use for the file search.
-
const FileSearchToolRankingOptionsRankerAuto FileSearchToolRankingOptionsRanker = "auto" -
const FileSearchToolRankingOptionsRankerDefault2024_11_15 FileSearchToolRankingOptionsRanker = "default-2024-11-15"
-
-
ScoreThreshold float64The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
Type ComputerThe type of the computer tool. Always
computer.const ComputerComputer Computer = "computer"
-
-
type ComputerUsePreviewTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
DisplayHeight int64The height of the computer display.
-
DisplayWidth int64The width of the computer display.
-
Environment ComputerUsePreviewToolEnvironmentThe type of computer environment to control.
-
const ComputerUsePreviewToolEnvironmentWindows ComputerUsePreviewToolEnvironment = "windows" -
const ComputerUsePreviewToolEnvironmentMac ComputerUsePreviewToolEnvironment = "mac" -
const ComputerUsePreviewToolEnvironmentLinux ComputerUsePreviewToolEnvironment = "linux" -
const ComputerUsePreviewToolEnvironmentUbuntu ComputerUsePreviewToolEnvironment = "ubuntu" -
const ComputerUsePreviewToolEnvironmentBrowser ComputerUsePreviewToolEnvironment = "browser"
-
-
Type ComputerUsePreviewThe type of the computer use tool. Always
computer_use_preview.const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"
-
-
type WebSearchTool struct{…}Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
Type WebSearchToolTypeThe type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
const WebSearchToolTypeWebSearch WebSearchToolType = "web_search" -
const WebSearchToolTypeWebSearch2025_08_26 WebSearchToolType = "web_search_2025_08_26"
-
-
Filters WebSearchToolFiltersFilters for the search.
-
AllowedDomains []stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
SearchContextSize WebSearchToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchToolSearchContextSizeLow WebSearchToolSearchContextSize = "low" -
const WebSearchToolSearchContextSizeMedium WebSearchToolSearchContextSize = "medium" -
const WebSearchToolSearchContextSizeHigh WebSearchToolSearchContextSize = "high"
-
-
UserLocation WebSearchToolUserLocationThe approximate location of the user.
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
Type stringThe type of location approximation. Always
approximate.const WebSearchToolUserLocationTypeApproximate WebSearchToolUserLocationType = "approximate"
-
-
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
ServerLabel stringA label for this MCP server, used to identify it in tool calls.
-
Type McpThe type of the MCP tool. Always
mcp.const McpMcp Mcp = "mcp"
-
AllowedTools ToolMcpAllowedToolsUnionList of allowed tool names or a filter object.
-
type ToolMcpAllowedToolsMcpAllowedTools []stringA string array of allowed tool names
-
type ToolMcpAllowedToolsMcpToolFilter struct{…}A filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
Authorization stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
ConnectorID stringIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
const ToolMcpConnectorIDConnectorDropbox ToolMcpConnectorID = "connector_dropbox" -
const ToolMcpConnectorIDConnectorGmail ToolMcpConnectorID = "connector_gmail" -
const ToolMcpConnectorIDConnectorGooglecalendar ToolMcpConnectorID = "connector_googlecalendar" -
const ToolMcpConnectorIDConnectorGoogledrive ToolMcpConnectorID = "connector_googledrive" -
const ToolMcpConnectorIDConnectorMicrosoftteams ToolMcpConnectorID = "connector_microsoftteams" -
const ToolMcpConnectorIDConnectorOutlookcalendar ToolMcpConnectorID = "connector_outlookcalendar" -
const ToolMcpConnectorIDConnectorOutlookemail ToolMcpConnectorID = "connector_outlookemail" -
const ToolMcpConnectorIDConnectorSharepoint ToolMcpConnectorID = "connector_sharepoint"
-
-
DeferLoading boolWhether this MCP tool is deferred and discovered via tool search.
-
Headers map[string, string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
RequireApproval ToolMcpRequireApprovalUnionSpecify which of the MCP server's tools require approval.
-
type ToolMcpRequireApprovalMcpToolApprovalFilter 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.-
Always ToolMcpRequireApprovalMcpToolApprovalFilterAlwaysA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
Never ToolMcpRequireApprovalMcpToolApprovalFilterNeverA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
type ToolMcpRequireApprovalMcpToolApprovalSetting stringSpecify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
const ToolMcpRequireApprovalMcpToolApprovalSettingAlways ToolMcpRequireApprovalMcpToolApprovalSetting = "always" -
const ToolMcpRequireApprovalMcpToolApprovalSettingNever ToolMcpRequireApprovalMcpToolApprovalSetting = "never"
-
-
-
ServerDescription stringOptional description of the MCP server, used to provide more context.
-
ServerURL stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
TunnelID stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
Container ToolCodeInterpreterContainerUnionThe code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
string -
type ToolCodeInterpreterContainerCodeInterpreterContainerAuto struct{…}Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
Type AutoAlways
auto.const AutoAuto Auto = "auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit stringThe memory limit for the code interpreter container.
-
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"
-
-
NetworkPolicy ToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…}-
Type DisabledDisable outbound network access. Always
disabled.const DisabledDisabled Disabled = "disabled"
-
-
type ContainerNetworkPolicyAllowlist struct{…}-
AllowedDomains []stringA list of allowed domains when type is
allowlist. -
Type AllowlistAllow outbound network access only to specified domains. Always
allowlist.const AllowlistAllowlist Allowlist = "allowlist"
-
DomainSecrets []ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
Domain stringThe domain associated with the secret.
-
Name stringThe name of the secret to inject for the domain.
-
Value stringThe secret value to inject for the domain.
-
-
-
-
-
-
Type CodeInterpreterThe type of the code interpreter tool. Always
code_interpreter.const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"
-
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
Type ImageGenerationThe type of the image generation tool. Always
image_generation.const ImageGenerationImageGeneration ImageGeneration = "image_generation"
-
Action stringWhether to generate a new image or edit an existing image. Default:
auto.-
const ToolImageGenerationActionGenerate ToolImageGenerationAction = "generate" -
const ToolImageGenerationActionEdit ToolImageGenerationAction = "edit" -
const ToolImageGenerationActionAuto ToolImageGenerationAction = "auto"
-
-
Background stringAllows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
const ToolImageGenerationBackgroundTransparent ToolImageGenerationBackground = "transparent" -
const ToolImageGenerationBackgroundOpaque ToolImageGenerationBackground = "opaque" -
const ToolImageGenerationBackgroundAuto ToolImageGenerationBackground = "auto"
-
-
InputFidelity stringControl how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
const ToolImageGenerationInputFidelityHigh ToolImageGenerationInputFidelity = "high" -
const ToolImageGenerationInputFidelityLow ToolImageGenerationInputFidelity = "low"
-
-
InputImageMask ToolImageGenerationInputImageMaskOptional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
FileID stringFile ID for the mask image.
-
ImageURL stringBase64-encoded mask image.
-
-
Model stringThe image generation model to use. Default:
gpt-image-1.-
string -
string-
const ToolImageGenerationModelGPTImage1 ToolImageGenerationModel = "gpt-image-1" -
const ToolImageGenerationModelGPTImage1Mini ToolImageGenerationModel = "gpt-image-1-mini" -
const ToolImageGenerationModelGPTImage2 ToolImageGenerationModel = "gpt-image-2" -
const ToolImageGenerationModelGPTImage2_2026_04_21 ToolImageGenerationModel = "gpt-image-2-2026-04-21" -
const ToolImageGenerationModelGPTImage1_5 ToolImageGenerationModel = "gpt-image-1.5" -
const ToolImageGenerationModelChatgptImageLatest ToolImageGenerationModel = "chatgpt-image-latest"
-
-
-
Moderation stringModeration level for the generated image. Default:
auto.-
const ToolImageGenerationModerationAuto ToolImageGenerationModeration = "auto" -
const ToolImageGenerationModerationLow ToolImageGenerationModeration = "low"
-
-
OutputCompression int64Compression level for the output image. Default: 100.
-
OutputFormat stringThe output format of the generated image. One of
png,webp, orjpeg. Default:png.-
const ToolImageGenerationOutputFormatPNG ToolImageGenerationOutputFormat = "png" -
const ToolImageGenerationOutputFormatWebP ToolImageGenerationOutputFormat = "webp" -
const ToolImageGenerationOutputFormatJPEG ToolImageGenerationOutputFormat = "jpeg"
-
-
PartialImages int64Number of partial images to generate in streaming mode, from 0 (default value) to 3.
-
Quality stringThe quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
const ToolImageGenerationQualityLow ToolImageGenerationQuality = "low" -
const ToolImageGenerationQualityMedium ToolImageGenerationQuality = "medium" -
const ToolImageGenerationQualityHigh ToolImageGenerationQuality = "high" -
const ToolImageGenerationQualityAuto ToolImageGenerationQuality = "auto"
-
-
Size stringThe size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
string -
string-
const ToolImageGenerationSize1024x1024 ToolImageGenerationSize = "1024x1024" -
const ToolImageGenerationSize1024x1536 ToolImageGenerationSize = "1024x1536" -
const ToolImageGenerationSize1536x1024 ToolImageGenerationSize = "1536x1024" -
const ToolImageGenerationSizeAuto ToolImageGenerationSize = "auto"
-
-
-
-
type ToolLocalShell struct{…}A tool that allows the model to execute shell commands in a local environment.
-
Type LocalShellThe type of the local shell tool. Always
local_shell.const LocalShellLocalShell LocalShell = "local_shell"
-
-
type FunctionShellTool struct{…}A tool that allows the model to execute shell commands.
-
Type ShellThe type of the shell tool. Always
shell.const ShellShell Shell = "shell"
-
Environment FunctionShellToolEnvironmentUnion-
type ContainerAuto struct{…}-
Type ContainerAutoAutomatically creates a container for this request
const ContainerAutoContainerAuto ContainerAuto = "container_auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit ContainerAutoMemoryLimitThe memory limit for the container.
-
const ContainerAutoMemoryLimit1g ContainerAutoMemoryLimit = "1g" -
const ContainerAutoMemoryLimit4g ContainerAutoMemoryLimit = "4g" -
const ContainerAutoMemoryLimit16g ContainerAutoMemoryLimit = "16g" -
const ContainerAutoMemoryLimit64g ContainerAutoMemoryLimit = "64g"
-
-
NetworkPolicy ContainerAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…} -
type ContainerNetworkPolicyAllowlist struct{…}
-
-
Skills []ContainerAutoSkillUnionAn optional list of skills referenced by id or inline data.
-
type SkillReference struct{…}-
SkillID stringThe ID of the referenced skill.
-
Type SkillReferenceReferences a skill created with the /v1/skills endpoint.
const SkillReferenceSkillReference SkillReference = "skill_reference"
-
Version stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
type InlineSkill struct{…}-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Source InlineSkillSourceInline skill payload
-
Data stringBase64-encoded skill zip bundle.
-
MediaType ApplicationZipThe media type of the inline skill payload. Must be
application/zip.const ApplicationZipApplicationZip ApplicationZip = "application/zip"
-
Type Base64The type of the inline skill source. Must be
base64.const Base64Base64 Base64 = "base64"
-
-
Type InlineDefines an inline skill for this request.
const InlineInline Inline = "inline"
-
-
-
-
type LocalEnvironment struct{…}-
Type LocalUse a local computer environment.
const LocalLocal Local = "local"
-
Skills []LocalSkillAn optional list of skills.
-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Path stringThe path to the directory containing the skill.
-
-
-
type ContainerReference struct{…}-
ContainerID stringThe ID of the referenced container.
-
Type ContainerReferenceReferences a container created with the /v1/containers endpoint
const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
Name stringThe name of the custom tool, used to identify it in tool calls.
-
Type CustomThe type of the custom tool. Always
custom.const CustomCustom Custom = "custom"
-
DeferLoading boolWhether this tool should be deferred and discovered via tool search.
-
Description stringOptional description of the custom tool, used to provide more context.
-
Format CustomToolInputFormatUnionThe input format for the custom tool. Default is unconstrained text.
-
type CustomToolInputFormatText struct{…}Unconstrained free-form text.
-
Type TextUnconstrained text format. Always
text.const TextText Text = "text"
-
-
type CustomToolInputFormatGrammar struct{…}A grammar defined by the user.
-
Definition stringThe grammar definition.
-
Syntax stringThe syntax of the grammar definition. One of
larkorregex.-
const CustomToolInputFormatGrammarSyntaxLark CustomToolInputFormatGrammarSyntax = "lark" -
const CustomToolInputFormatGrammarSyntaxRegex CustomToolInputFormatGrammarSyntax = "regex"
-
-
Type GrammarGrammar format. Always
grammar.const GrammarGrammar Grammar = "grammar"
-
-
-
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
Description stringA description of the namespace shown to the model.
-
Name stringThe namespace name used in tool calls (for example,
crm). -
Tools []NamespaceToolToolUnionThe function/custom tools available inside this namespace.
-
type NamespaceToolToolFunction struct{…}-
Name string -
Type Functionconst FunctionFunction Function = "function"
-
DeferLoading boolWhether this function should be deferred and discovered via tool search.
-
Description string -
Parameters any -
Strict bool
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
-
Type NamespaceThe type of the tool. Always
namespace.const NamespaceNamespace Namespace = "namespace"
-
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
Type ToolSearchThe type of the tool. Always
tool_search.const ToolSearchToolSearch ToolSearch = "tool_search"
-
Description stringDescription shown to the model for a client-executed tool search tool.
-
Execution ToolSearchToolExecutionWhether tool search is executed by the server or by the client.
-
const ToolSearchToolExecutionServer ToolSearchToolExecution = "server" -
const ToolSearchToolExecutionClient ToolSearchToolExecution = "client"
-
-
Parameters anyParameter schema for a client-executed tool search tool.
-
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
Type WebSearchPreviewToolTypeThe type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
const WebSearchPreviewToolTypeWebSearchPreview WebSearchPreviewToolType = "web_search_preview" -
const WebSearchPreviewToolTypeWebSearchPreview2025_03_11 WebSearchPreviewToolType = "web_search_preview_2025_03_11"
-
-
SearchContentTypes []string-
const WebSearchPreviewToolSearchContentTypeText WebSearchPreviewToolSearchContentType = "text" -
const WebSearchPreviewToolSearchContentTypeImage WebSearchPreviewToolSearchContentType = "image"
-
-
SearchContextSize WebSearchPreviewToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchPreviewToolSearchContextSizeLow WebSearchPreviewToolSearchContextSize = "low" -
const WebSearchPreviewToolSearchContextSizeMedium WebSearchPreviewToolSearchContextSize = "medium" -
const WebSearchPreviewToolSearchContextSizeHigh WebSearchPreviewToolSearchContextSize = "high"
-
-
UserLocation WebSearchPreviewToolUserLocationThe user's location.
-
Type ApproximateThe type of location approximation. Always
approximate.const ApproximateApproximate Approximate = "approximate"
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
Type ApplyPatchThe type of the tool. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
-
Type ToolSearchOutputThe item type. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
ID stringThe unique ID of this tool search output.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemParamExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemParamExecutionServer ResponseToolSearchOutputItemParamExecution = "server" -
const ResponseToolSearchOutputItemParamExecutionClient ResponseToolSearchOutputItemParamExecution = "client"
-
-
Status ResponseToolSearchOutputItemParamStatusThe status of the tool search output.
-
const ResponseToolSearchOutputItemParamStatusInProgress ResponseToolSearchOutputItemParamStatus = "in_progress" -
const ResponseToolSearchOutputItemParamStatusCompleted ResponseToolSearchOutputItemParamStatus = "completed" -
const ResponseToolSearchOutputItemParamStatusIncomplete ResponseToolSearchOutputItemParamStatus = "incomplete"
-
-
-
type ResponseInputItemAdditionalTools struct{…}-
Role DeveloperThe role that provided the additional tools. Only
developeris supported.const DeveloperDeveloper Developer = "developer"
-
Tools []ToolUnionA list of additional tools made available at this item.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type AdditionalToolsThe item type. Always
additional_tools.const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"
-
ID stringThe unique ID of this additional tools item.
-
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
ID stringThe unique identifier of the reasoning content.
-
Summary []ResponseReasoningItemSummaryReasoning summary content.
-
Text stringA summary of the reasoning output from the model so far.
-
Type SummaryTextThe type of the object. Always
summary_text.const SummaryTextSummaryText SummaryText = "summary_text"
-
-
Type ReasoningThe type of the object. Always
reasoning.const ReasoningReasoning Reasoning = "reasoning"
-
Content []ResponseReasoningItemContentReasoning text content.
-
Text stringThe reasoning text from the model.
-
Type ReasoningTextThe type of the reasoning text. Always
reasoning_text.const ReasoningTextReasoningText ReasoningText = "reasoning_text"
-
-
EncryptedContent stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
Status ResponseReasoningItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseReasoningItemStatusInProgress ResponseReasoningItemStatus = "in_progress" -
const ResponseReasoningItemStatusCompleted ResponseReasoningItemStatus = "completed" -
const ResponseReasoningItemStatusIncomplete ResponseReasoningItemStatus = "incomplete"
-
-
-
type ResponseCompactionItemParamResp struct{…}A compaction item generated by the
v1/responses/compactAPI.-
EncryptedContent stringThe encrypted content of the compaction summary.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
ID stringThe ID of the compaction item.
-
-
type ResponseInputItemImageGenerationCall struct{…}An image generation request made by the model.
-
ID stringThe unique ID of the image generation call.
-
Result stringThe generated image encoded in base64.
-
Status stringThe status of the image generation call.
-
const ResponseInputItemImageGenerationCallStatusInProgress ResponseInputItemImageGenerationCallStatus = "in_progress" -
const ResponseInputItemImageGenerationCallStatusCompleted ResponseInputItemImageGenerationCallStatus = "completed" -
const ResponseInputItemImageGenerationCallStatusGenerating ResponseInputItemImageGenerationCallStatus = "generating" -
const ResponseInputItemImageGenerationCallStatusFailed ResponseInputItemImageGenerationCallStatus = "failed"
-
-
Type ImageGenerationCallThe type of the image generation call. Always
image_generation_call.const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"
-
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
ID stringThe unique ID of the code interpreter tool call.
-
Code stringThe code to run, or null if not available.
-
ContainerID stringThe ID of the container used to run the code.
-
Outputs []ResponseCodeInterpreterToolCallOutputUnionThe outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
type ResponseCodeInterpreterToolCallOutputLogs struct{…}The logs output from the code interpreter.
-
Logs stringThe logs output from the code interpreter.
-
Type LogsThe type of the output. Always
logs.const LogsLogs Logs = "logs"
-
-
type ResponseCodeInterpreterToolCallOutputImage struct{…}The image output from the code interpreter.
-
Type ImageThe type of the output. Always
image.const ImageImage Image = "image"
-
URL stringThe URL of the image output from the code interpreter.
-
-
-
Status ResponseCodeInterpreterToolCallStatusThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
const ResponseCodeInterpreterToolCallStatusInProgress ResponseCodeInterpreterToolCallStatus = "in_progress" -
const ResponseCodeInterpreterToolCallStatusCompleted ResponseCodeInterpreterToolCallStatus = "completed" -
const ResponseCodeInterpreterToolCallStatusIncomplete ResponseCodeInterpreterToolCallStatus = "incomplete" -
const ResponseCodeInterpreterToolCallStatusInterpreting ResponseCodeInterpreterToolCallStatus = "interpreting" -
const ResponseCodeInterpreterToolCallStatusFailed ResponseCodeInterpreterToolCallStatus = "failed"
-
-
Type CodeInterpreterCallThe type of the code interpreter tool call. Always
code_interpreter_call.const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"
-
-
type ResponseInputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
ID stringThe unique ID of the local shell call.
-
Action ResponseInputItemLocalShellCallActionExecute a shell command on the server.
-
Command []stringThe command to run.
-
Env map[string, string]Environment variables to set for the command.
-
Type ExecThe type of the local shell action. Always
exec.const ExecExec Exec = "exec"
-
TimeoutMs int64Optional timeout in milliseconds for the command.
-
User stringOptional user to run the command as.
-
WorkingDirectory stringOptional working directory to run the command in.
-
-
CallID stringThe unique ID of the local shell tool call generated by the model.
-
Status stringThe status of the local shell call.
-
const ResponseInputItemLocalShellCallStatusInProgress ResponseInputItemLocalShellCallStatus = "in_progress" -
const ResponseInputItemLocalShellCallStatusCompleted ResponseInputItemLocalShellCallStatus = "completed" -
const ResponseInputItemLocalShellCallStatusIncomplete ResponseInputItemLocalShellCallStatus = "incomplete"
-
-
Type LocalShellCallThe type of the local shell call. Always
local_shell_call.const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"
-
-
type ResponseInputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
ID stringThe unique ID of the local shell tool call generated by the model.
-
Output stringA JSON string of the output of the local shell tool call.
-
Type LocalShellCallOutputThe type of the local shell tool call output. Always
local_shell_call_output.const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete.-
const ResponseInputItemLocalShellCallOutputStatusInProgress ResponseInputItemLocalShellCallOutputStatus = "in_progress" -
const ResponseInputItemLocalShellCallOutputStatusCompleted ResponseInputItemLocalShellCallOutputStatus = "completed" -
const ResponseInputItemLocalShellCallOutputStatusIncomplete ResponseInputItemLocalShellCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemShellCall struct{…}A tool representing a request to execute one or more shell commands.
-
Action ResponseInputItemShellCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []stringOrdered shell commands for the execution environment to run.
-
MaxOutputLength int64Maximum number of UTF-8 characters to capture from combined stdout and stderr output.
-
TimeoutMs int64Maximum wall-clock time in milliseconds to allow the shell commands to run.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Environment ResponseInputItemShellCallEnvironmentUnionThe environment to execute the shell commands in.
-
type LocalEnvironment struct{…} -
type ContainerReference struct{…}
-
-
Status stringThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseInputItemShellCallStatusInProgress ResponseInputItemShellCallStatus = "in_progress" -
const ResponseInputItemShellCallStatusCompleted ResponseInputItemShellCallStatus = "completed" -
const ResponseInputItemShellCallStatusIncomplete ResponseInputItemShellCallStatus = "incomplete"
-
-
-
type ResponseInputItemShellCallOutput struct{…}The streamed output items emitted by a shell tool call.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Output []ResponseFunctionShellCallOutputContentCaptured chunks of stdout and stderr output, along with their associated outcomes.
-
Outcome ResponseFunctionShellCallOutputContentOutcomeUnionThe exit or timeout outcome associated with this shell call.
-
type ResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellCallOutputContentOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64The exit code returned by the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringCaptured stderr output for the shell call.
-
Stdout stringCaptured stdout output for the shell call.
-
-
Type ShellCallOutputThe type of the item. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
ID stringThe unique ID of the shell tool call output. Populated when this item is returned via API.
-
MaxOutputLength int64The maximum number of UTF-8 characters captured for this shell call's combined output.
-
Status stringThe status of the shell call output.
-
const ResponseInputItemShellCallOutputStatusInProgress ResponseInputItemShellCallOutputStatus = "in_progress" -
const ResponseInputItemShellCallOutputStatusCompleted ResponseInputItemShellCallOutputStatus = "completed" -
const ResponseInputItemShellCallOutputStatusIncomplete ResponseInputItemShellCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemApplyPatchCall struct{…}A tool call representing a request to create, delete, or update files using diff patches.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseInputItemApplyPatchCallOperationUnionThe specific create, delete, or update instruction for the apply_patch tool call.
-
type ResponseInputItemApplyPatchCallOperationCreateFile struct{…}Instruction for creating a new file via the apply_patch tool.
-
Diff stringUnified diff content to apply when creating the file.
-
Path stringPath of the file to create relative to the workspace root.
-
Type CreateFileThe operation type. Always
create_file.const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseInputItemApplyPatchCallOperationDeleteFile struct{…}Instruction for deleting an existing file via the apply_patch tool.
-
Path stringPath of the file to delete relative to the workspace root.
-
Type DeleteFileThe operation type. Always
delete_file.const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseInputItemApplyPatchCallOperationUpdateFile struct{…}Instruction for updating an existing file via the apply_patch tool.
-
Diff stringUnified diff content to apply to the existing file.
-
Path stringPath of the file to update relative to the workspace root.
-
Type UpdateFileThe operation type. Always
update_file.const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status stringThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseInputItemApplyPatchCallStatusInProgress ResponseInputItemApplyPatchCallStatus = "in_progress" -
const ResponseInputItemApplyPatchCallStatusCompleted ResponseInputItemApplyPatchCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
-
type ResponseInputItemApplyPatchCallOutput struct{…}The streamed output emitted by an apply patch tool call.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status stringThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseInputItemApplyPatchCallOutputStatusCompleted ResponseInputItemApplyPatchCallOutputStatus = "completed" -
const ResponseInputItemApplyPatchCallOutputStatusFailed ResponseInputItemApplyPatchCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
Output stringOptional human-readable log text from the apply patch tool (e.g., patch results or errors).
-
-
type ResponseInputItemMcpListTools struct{…}A list of tools available on an MCP server.
-
ID stringThe unique ID of the list.
-
ServerLabel stringThe label of the MCP server.
-
Tools []ResponseInputItemMcpListToolsToolThe tools available on the server.
-
InputSchema anyThe JSON schema describing the tool's input.
-
Name stringThe name of the tool.
-
Annotations anyAdditional annotations about the tool.
-
Description stringThe description of the tool.
-
-
Type McpListToolsThe type of the item. Always
mcp_list_tools.const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
-
Error stringError message if the server could not list tools.
-
-
type ResponseInputItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
ID stringThe unique ID of the approval request.
-
Arguments stringA JSON string of arguments for the tool.
-
Name stringThe name of the tool to run.
-
ServerLabel stringThe label of the MCP server making the request.
-
Type McpApprovalRequestThe type of the item. Always
mcp_approval_request.const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"
-
-
type ResponseInputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
ApprovalRequestID stringThe ID of the approval request being answered.
-
Approve boolWhether the request was approved.
-
Type McpApprovalResponseThe type of the item. Always
mcp_approval_response.const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
-
ID stringThe unique ID of the approval response
-
Reason stringOptional reason for the decision.
-
-
type ResponseInputItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
ID stringThe unique ID of the tool call.
-
Arguments stringA JSON string of the arguments passed to the tool.
-
Name stringThe name of the tool that was run.
-
ServerLabel stringThe label of the MCP server running the tool.
-
Type McpCallThe type of the item. Always
mcp_call.const McpCallMcpCall McpCall = "mcp_call"
-
ApprovalRequestID stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
Error stringThe error from the tool call, if any.
-
Output stringThe output from the tool call.
-
Status stringThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
const ResponseInputItemMcpCallStatusInProgress ResponseInputItemMcpCallStatus = "in_progress" -
const ResponseInputItemMcpCallStatusCompleted ResponseInputItemMcpCallStatus = "completed" -
const ResponseInputItemMcpCallStatusIncomplete ResponseInputItemMcpCallStatus = "incomplete" -
const ResponseInputItemMcpCallStatusCalling ResponseInputItemMcpCallStatus = "calling" -
const ResponseInputItemMcpCallStatusFailed ResponseInputItemMcpCallStatus = "failed"
-
-
-
type ResponseCustomToolCallOutput struct{…}The output of a custom tool call from your code, being sent back to the model.
-
CallID stringThe call ID, used to map this custom tool call output to a custom tool call.
-
Output ResponseCustomToolCallOutputOutputUnionThe output from the custom tool call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseCustomToolCallOutputOutputOutputContentList []ResponseCustomToolCallOutputOutputOutputContentListItemUnionText, image, or file output of the custom tool call.
-
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
-
Type CustomToolCallOutputThe type of the custom tool call output. Always
custom_tool_call_output.const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"
-
ID stringThe unique ID of the custom tool call output in the OpenAI platform.
-
-
type ResponseCustomToolCall struct{…}A call to a custom tool created by the model.
-
CallID stringAn identifier used to map this custom tool call to a tool call output.
-
Input stringThe input for the custom tool call generated by the model.
-
Name stringThe name of the custom tool being called.
-
Type CustomToolCallThe type of the custom tool call. Always
custom_tool_call.const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"
-
ID stringThe unique ID of the custom tool call in the OpenAI platform.
-
Namespace stringThe namespace of the custom tool being called.
-
-
type ResponseInputItemCompactionTrigger struct{…}Compacts the current context. Must be the final input item.
-
Type CompactionTriggerThe type of the item. Always
compaction_trigger.const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"
-
-
type ResponseInputItemItemReference struct{…}An internal identifier for an item to reference.
-
ID stringThe ID of the item to reference.
-
Type stringThe type of item to reference. Always
item_reference.const ResponseInputItemItemReferenceTypeItemReference ResponseInputItemItemReferenceType = "item_reference"
-
-
-
-
Metadata MetadataSet of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
-
Model ResponsesModelModel ID used to generate the response, like
gpt-4ooro3. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models.-
string -
type ChatModel string-
const ChatModelGPT5_4 ChatModel = "gpt-5.4" -
const ChatModelGPT5_4Mini ChatModel = "gpt-5.4-mini" -
const ChatModelGPT5_4Nano ChatModel = "gpt-5.4-nano" -
const ChatModelGPT5_4Mini2026_03_17 ChatModel = "gpt-5.4-mini-2026-03-17" -
const ChatModelGPT5_4Nano2026_03_17 ChatModel = "gpt-5.4-nano-2026-03-17" -
const ChatModelGPT5_3ChatLatest ChatModel = "gpt-5.3-chat-latest" -
const ChatModelGPT5_2 ChatModel = "gpt-5.2" -
const ChatModelGPT5_2_2025_12_11 ChatModel = "gpt-5.2-2025-12-11" -
const ChatModelGPT5_2ChatLatest ChatModel = "gpt-5.2-chat-latest" -
const ChatModelGPT5_2Pro ChatModel = "gpt-5.2-pro" -
const ChatModelGPT5_2Pro2025_12_11 ChatModel = "gpt-5.2-pro-2025-12-11" -
const ChatModelGPT5_1 ChatModel = "gpt-5.1" -
const ChatModelGPT5_1_2025_11_13 ChatModel = "gpt-5.1-2025-11-13" -
const ChatModelGPT5_1Codex ChatModel = "gpt-5.1-codex" -
const ChatModelGPT5_1Mini ChatModel = "gpt-5.1-mini" -
const ChatModelGPT5_1ChatLatest ChatModel = "gpt-5.1-chat-latest" -
const ChatModelGPT5 ChatModel = "gpt-5" -
const ChatModelGPT5Mini ChatModel = "gpt-5-mini" -
const ChatModelGPT5Nano ChatModel = "gpt-5-nano" -
const ChatModelGPT5_2025_08_07 ChatModel = "gpt-5-2025-08-07" -
const ChatModelGPT5Mini2025_08_07 ChatModel = "gpt-5-mini-2025-08-07" -
const ChatModelGPT5Nano2025_08_07 ChatModel = "gpt-5-nano-2025-08-07" -
const ChatModelGPT5ChatLatest ChatModel = "gpt-5-chat-latest" -
const ChatModelGPT4_1 ChatModel = "gpt-4.1" -
const ChatModelGPT4_1Mini ChatModel = "gpt-4.1-mini" -
const ChatModelGPT4_1Nano ChatModel = "gpt-4.1-nano" -
const ChatModelGPT4_1_2025_04_14 ChatModel = "gpt-4.1-2025-04-14" -
const ChatModelGPT4_1Mini2025_04_14 ChatModel = "gpt-4.1-mini-2025-04-14" -
const ChatModelGPT4_1Nano2025_04_14 ChatModel = "gpt-4.1-nano-2025-04-14" -
const ChatModelO4Mini ChatModel = "o4-mini" -
const ChatModelO4Mini2025_04_16 ChatModel = "o4-mini-2025-04-16" -
const ChatModelO3 ChatModel = "o3" -
const ChatModelO3_2025_04_16 ChatModel = "o3-2025-04-16" -
const ChatModelO3Mini ChatModel = "o3-mini" -
const ChatModelO3Mini2025_01_31 ChatModel = "o3-mini-2025-01-31" -
const ChatModelO1 ChatModel = "o1" -
const ChatModelO1_2024_12_17 ChatModel = "o1-2024-12-17" -
const ChatModelO1Preview ChatModel = "o1-preview" -
const ChatModelO1Preview2024_09_12 ChatModel = "o1-preview-2024-09-12" -
const ChatModelO1Mini ChatModel = "o1-mini" -
const ChatModelO1Mini2024_09_12 ChatModel = "o1-mini-2024-09-12" -
const ChatModelGPT4o ChatModel = "gpt-4o" -
const ChatModelGPT4o2024_11_20 ChatModel = "gpt-4o-2024-11-20" -
const ChatModelGPT4o2024_08_06 ChatModel = "gpt-4o-2024-08-06" -
const ChatModelGPT4o2024_05_13 ChatModel = "gpt-4o-2024-05-13" -
const ChatModelGPT4oAudioPreview ChatModel = "gpt-4o-audio-preview" -
const ChatModelGPT4oAudioPreview2024_10_01 ChatModel = "gpt-4o-audio-preview-2024-10-01" -
const ChatModelGPT4oAudioPreview2024_12_17 ChatModel = "gpt-4o-audio-preview-2024-12-17" -
const ChatModelGPT4oAudioPreview2025_06_03 ChatModel = "gpt-4o-audio-preview-2025-06-03" -
const ChatModelGPT4oMiniAudioPreview ChatModel = "gpt-4o-mini-audio-preview" -
const ChatModelGPT4oMiniAudioPreview2024_12_17 ChatModel = "gpt-4o-mini-audio-preview-2024-12-17" -
const ChatModelGPT4oSearchPreview ChatModel = "gpt-4o-search-preview" -
const ChatModelGPT4oMiniSearchPreview ChatModel = "gpt-4o-mini-search-preview" -
const ChatModelGPT4oSearchPreview2025_03_11 ChatModel = "gpt-4o-search-preview-2025-03-11" -
const ChatModelGPT4oMiniSearchPreview2025_03_11 ChatModel = "gpt-4o-mini-search-preview-2025-03-11" -
const ChatModelChatgpt4oLatest ChatModel = "chatgpt-4o-latest" -
const ChatModelCodexMiniLatest ChatModel = "codex-mini-latest" -
const ChatModelGPT4oMini ChatModel = "gpt-4o-mini" -
const ChatModelGPT4oMini2024_07_18 ChatModel = "gpt-4o-mini-2024-07-18" -
const ChatModelGPT4Turbo ChatModel = "gpt-4-turbo" -
const ChatModelGPT4Turbo2024_04_09 ChatModel = "gpt-4-turbo-2024-04-09" -
const ChatModelGPT4_0125Preview ChatModel = "gpt-4-0125-preview" -
const ChatModelGPT4TurboPreview ChatModel = "gpt-4-turbo-preview" -
const ChatModelGPT4_1106Preview ChatModel = "gpt-4-1106-preview" -
const ChatModelGPT4VisionPreview ChatModel = "gpt-4-vision-preview" -
const ChatModelGPT4 ChatModel = "gpt-4" -
const ChatModelGPT4_0314 ChatModel = "gpt-4-0314" -
const ChatModelGPT4_0613 ChatModel = "gpt-4-0613" -
const ChatModelGPT4_32k ChatModel = "gpt-4-32k" -
const ChatModelGPT4_32k0314 ChatModel = "gpt-4-32k-0314" -
const ChatModelGPT4_32k0613 ChatModel = "gpt-4-32k-0613" -
const ChatModelGPT3_5Turbo ChatModel = "gpt-3.5-turbo" -
const ChatModelGPT3_5Turbo16k ChatModel = "gpt-3.5-turbo-16k" -
const ChatModelGPT3_5Turbo0301 ChatModel = "gpt-3.5-turbo-0301" -
const ChatModelGPT3_5Turbo0613 ChatModel = "gpt-3.5-turbo-0613" -
const ChatModelGPT3_5Turbo1106 ChatModel = "gpt-3.5-turbo-1106" -
const ChatModelGPT3_5Turbo0125 ChatModel = "gpt-3.5-turbo-0125" -
const ChatModelGPT3_5Turbo16k0613 ChatModel = "gpt-3.5-turbo-16k-0613"
-
-
type ResponsesModel string-
const ResponsesModelO1Pro ResponsesModel = "o1-pro" -
const ResponsesModelO1Pro2025_03_19 ResponsesModel = "o1-pro-2025-03-19" -
const ResponsesModelO3Pro ResponsesModel = "o3-pro" -
const ResponsesModelO3Pro2025_06_10 ResponsesModel = "o3-pro-2025-06-10" -
const ResponsesModelO3DeepResearch ResponsesModel = "o3-deep-research" -
const ResponsesModelO3DeepResearch2025_06_26 ResponsesModel = "o3-deep-research-2025-06-26" -
const ResponsesModelO4MiniDeepResearch ResponsesModel = "o4-mini-deep-research" -
const ResponsesModelO4MiniDeepResearch2025_06_26 ResponsesModel = "o4-mini-deep-research-2025-06-26" -
const ResponsesModelComputerUsePreview ResponsesModel = "computer-use-preview" -
const ResponsesModelComputerUsePreview2025_03_11 ResponsesModel = "computer-use-preview-2025-03-11" -
const ResponsesModelGPT5Codex ResponsesModel = "gpt-5-codex" -
const ResponsesModelGPT5Pro ResponsesModel = "gpt-5-pro" -
const ResponsesModelGPT5Pro2025_10_06 ResponsesModel = "gpt-5-pro-2025-10-06" -
const ResponsesModelGPT5_1CodexMax ResponsesModel = "gpt-5.1-codex-max"
-
-
-
Object ResponseThe object type of this resource - always set to
response.const ResponseResponse Response = "response"
-
Output []ResponseOutputItemUnionAn array of content items generated by the model.
-
The length and order of items in the
outputarray is dependent on the model's response. -
Rather than accessing the first item in the
outputarray and assuming it's anassistantmessage with the content generated by the model, you might consider using theoutput_textproperty where supported in SDKs. -
type ResponseOutputMessage struct{…}An output message from the model.
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
type ResponseFunctionToolCall struct{…}A tool call to run a function. See the function calling guide for more information.
-
type ResponseFunctionToolCallOutputItem struct{…}-
ID stringThe unique ID of the function call tool output.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseFunctionToolCallOutputItemOutputUnionThe output from the function call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseFunctionToolCallOutputItemOutputOutputContentList []ResponseFunctionToolCallOutputItemOutputOutputContentListItemUnionText, image, or file output of the function call.
-
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
-
Status ResponseFunctionToolCallOutputItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallOutputItemStatusInProgress ResponseFunctionToolCallOutputItemStatus = "in_progress" -
const ResponseFunctionToolCallOutputItemStatusCompleted ResponseFunctionToolCallOutputItemStatus = "completed" -
const ResponseFunctionToolCallOutputItemStatusIncomplete ResponseFunctionToolCallOutputItemStatus = "incomplete"
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
type ResponseComputerToolCallOutputItem struct{…}-
ID stringThe unique ID of the computer call tool output.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Status ResponseComputerToolCallOutputItemStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseComputerToolCallOutputItemStatusCompleted ResponseComputerToolCallOutputItemStatus = "completed" -
const ResponseComputerToolCallOutputItemStatusIncomplete ResponseComputerToolCallOutputItemStatus = "incomplete" -
const ResponseComputerToolCallOutputItemStatusFailed ResponseComputerToolCallOutputItemStatus = "failed" -
const ResponseComputerToolCallOutputItemStatusInProgress ResponseComputerToolCallOutputItemStatus = "in_progress"
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
AcknowledgedSafetyChecks []ResponseComputerToolCallOutputItemAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context. -
type ResponseToolSearchCall struct{…}-
ID stringThe unique ID of the tool search call item.
-
Arguments anyArguments used for the tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchCallExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchCallExecutionServer ResponseToolSearchCallExecution = "server" -
const ResponseToolSearchCallExecutionClient ResponseToolSearchCallExecution = "client"
-
-
Status ResponseToolSearchCallStatusThe status of the tool search call item that was recorded.
-
const ResponseToolSearchCallStatusInProgress ResponseToolSearchCallStatus = "in_progress" -
const ResponseToolSearchCallStatusCompleted ResponseToolSearchCallStatus = "completed" -
const ResponseToolSearchCallStatusIncomplete ResponseToolSearchCallStatus = "incomplete"
-
-
Type ToolSearchCallThe type of the item. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseToolSearchOutputItem struct{…}-
ID stringThe unique ID of the tool search output item.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemExecutionServer ResponseToolSearchOutputItemExecution = "server" -
const ResponseToolSearchOutputItemExecutionClient ResponseToolSearchOutputItemExecution = "client"
-
-
Status ResponseToolSearchOutputItemStatusThe status of the tool search output item that was recorded.
-
const ResponseToolSearchOutputItemStatusInProgress ResponseToolSearchOutputItemStatus = "in_progress" -
const ResponseToolSearchOutputItemStatusCompleted ResponseToolSearchOutputItemStatus = "completed" -
const ResponseToolSearchOutputItemStatusIncomplete ResponseToolSearchOutputItemStatus = "incomplete"
-
-
Tools []ToolUnionThe loaded tool definitions returned by tool search.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type ToolSearchOutputThe type of the item. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseOutputItemAdditionalTools struct{…}-
ID stringThe unique ID of the additional tools item.
-
Role stringThe role that provided the additional tools.
-
const ResponseOutputItemAdditionalToolsRoleUnknown ResponseOutputItemAdditionalToolsRole = "unknown" -
const ResponseOutputItemAdditionalToolsRoleUser ResponseOutputItemAdditionalToolsRole = "user" -
const ResponseOutputItemAdditionalToolsRoleAssistant ResponseOutputItemAdditionalToolsRole = "assistant" -
const ResponseOutputItemAdditionalToolsRoleSystem ResponseOutputItemAdditionalToolsRole = "system" -
const ResponseOutputItemAdditionalToolsRoleCritic ResponseOutputItemAdditionalToolsRole = "critic" -
const ResponseOutputItemAdditionalToolsRoleDiscriminator ResponseOutputItemAdditionalToolsRole = "discriminator" -
const ResponseOutputItemAdditionalToolsRoleDeveloper ResponseOutputItemAdditionalToolsRole = "developer" -
const ResponseOutputItemAdditionalToolsRoleTool ResponseOutputItemAdditionalToolsRole = "tool"
-
-
Tools []ToolUnionThe additional tool definitions made available at this item.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type AdditionalToolsThe type of the item. Always
additional_tools.const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"
-
-
type ResponseCompactionItem struct{…}A compaction item generated by the
v1/responses/compactAPI.-
ID stringThe unique ID of the compaction item.
-
EncryptedContent stringThe encrypted content that was produced by compaction.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseOutputItemImageGenerationCall struct{…}An image generation request made by the model.
-
ID stringThe unique ID of the image generation call.
-
Result stringThe generated image encoded in base64.
-
Status stringThe status of the image generation call.
-
const ResponseOutputItemImageGenerationCallStatusInProgress ResponseOutputItemImageGenerationCallStatus = "in_progress" -
const ResponseOutputItemImageGenerationCallStatusCompleted ResponseOutputItemImageGenerationCallStatus = "completed" -
const ResponseOutputItemImageGenerationCallStatusGenerating ResponseOutputItemImageGenerationCallStatus = "generating" -
const ResponseOutputItemImageGenerationCallStatusFailed ResponseOutputItemImageGenerationCallStatus = "failed"
-
-
Type ImageGenerationCallThe type of the image generation call. Always
image_generation_call.const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"
-
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
type ResponseOutputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
ID stringThe unique ID of the local shell call.
-
Action ResponseOutputItemLocalShellCallActionExecute a shell command on the server.
-
Command []stringThe command to run.
-
Env map[string, string]Environment variables to set for the command.
-
Type ExecThe type of the local shell action. Always
exec.const ExecExec Exec = "exec"
-
TimeoutMs int64Optional timeout in milliseconds for the command.
-
User stringOptional user to run the command as.
-
WorkingDirectory stringOptional working directory to run the command in.
-
-
CallID stringThe unique ID of the local shell tool call generated by the model.
-
Status stringThe status of the local shell call.
-
const ResponseOutputItemLocalShellCallStatusInProgress ResponseOutputItemLocalShellCallStatus = "in_progress" -
const ResponseOutputItemLocalShellCallStatusCompleted ResponseOutputItemLocalShellCallStatus = "completed" -
const ResponseOutputItemLocalShellCallStatusIncomplete ResponseOutputItemLocalShellCallStatus = "incomplete"
-
-
Type LocalShellCallThe type of the local shell call. Always
local_shell_call.const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"
-
-
type ResponseOutputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
ID stringThe unique ID of the local shell tool call generated by the model.
-
Output stringA JSON string of the output of the local shell tool call.
-
Type LocalShellCallOutputThe type of the local shell tool call output. Always
local_shell_call_output.const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete.-
const ResponseOutputItemLocalShellCallOutputStatusInProgress ResponseOutputItemLocalShellCallOutputStatus = "in_progress" -
const ResponseOutputItemLocalShellCallOutputStatusCompleted ResponseOutputItemLocalShellCallOutputStatus = "completed" -
const ResponseOutputItemLocalShellCallOutputStatusIncomplete ResponseOutputItemLocalShellCallOutputStatus = "incomplete"
-
-
-
type ResponseFunctionShellToolCall struct{…}A tool call that executes one or more shell commands in a managed environment.
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Action ResponseFunctionShellToolCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []string -
MaxOutputLength int64Optional maximum number of characters to return from each command.
-
TimeoutMs int64Optional timeout in milliseconds for the commands.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Environment ResponseFunctionShellToolCallEnvironmentUnionRepresents the use of a local environment to perform shell actions.
-
type ResponseLocalEnvironment struct{…}Represents the use of a local environment to perform shell actions.
-
Type LocalThe environment type. Always
local.const LocalLocal Local = "local"
-
-
type ResponseContainerReference struct{…}Represents a container created with /v1/containers.
-
ContainerID string -
Type ContainerReferenceThe environment type. Always
container_reference.const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
Status ResponseFunctionShellToolCallStatusThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallStatusInProgress ResponseFunctionShellToolCallStatus = "in_progress" -
const ResponseFunctionShellToolCallStatusCompleted ResponseFunctionShellToolCallStatus = "completed" -
const ResponseFunctionShellToolCallStatusIncomplete ResponseFunctionShellToolCallStatus = "incomplete"
-
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseFunctionShellToolCallOutput struct{…}The output of a shell tool call that was emitted.
-
ID stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
MaxOutputLength int64The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
Output []ResponseFunctionShellToolCallOutputOutputAn array of shell call output contents
-
Outcome ResponseFunctionShellToolCallOutputOutputOutcomeUnionRepresents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
type ResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64Exit code from the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringThe standard error output that was captured.
-
Stdout stringThe standard output that was captured.
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
Status ResponseFunctionShellToolCallOutputStatusThe status of the shell call output. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallOutputStatusInProgress ResponseFunctionShellToolCallOutputStatus = "in_progress" -
const ResponseFunctionShellToolCallOutputStatusCompleted ResponseFunctionShellToolCallOutputStatus = "completed" -
const ResponseFunctionShellToolCallOutputStatusIncomplete ResponseFunctionShellToolCallOutputStatus = "incomplete"
-
-
Type ShellCallOutputThe type of the shell call output. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseApplyPatchToolCall struct{…}A tool call that applies file diffs by creating, deleting, or updating files.
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseApplyPatchToolCallOperationUnionOne of the create_file, delete_file, or update_file operations applied via apply_patch.
-
type ResponseApplyPatchToolCallOperationCreateFile struct{…}Instruction describing how to create a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to create.
-
Type CreateFileCreate a new file with the provided diff.
const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseApplyPatchToolCallOperationDeleteFile struct{…}Instruction describing how to delete a file via the apply_patch tool.
-
Path stringPath of the file to delete.
-
Type DeleteFileDelete the specified file.
const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseApplyPatchToolCallOperationUpdateFile struct{…}Instruction describing how to update a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to update.
-
Type UpdateFileUpdate an existing file with the provided diff.
const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status ResponseApplyPatchToolCallStatusThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseApplyPatchToolCallStatusInProgress ResponseApplyPatchToolCallStatus = "in_progress" -
const ResponseApplyPatchToolCallStatusCompleted ResponseApplyPatchToolCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseApplyPatchToolCallOutput struct{…}The output emitted by an apply patch tool call.
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status ResponseApplyPatchToolCallOutputStatusThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseApplyPatchToolCallOutputStatusCompleted ResponseApplyPatchToolCallOutputStatus = "completed" -
const ResponseApplyPatchToolCallOutputStatusFailed ResponseApplyPatchToolCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
CreatedBy stringThe ID of the entity that created this tool call output.
-
Output stringOptional textual output returned by the apply patch tool.
-
-
type ResponseOutputItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
ID stringThe unique ID of the tool call.
-
Arguments stringA JSON string of the arguments passed to the tool.
-
Name stringThe name of the tool that was run.
-
ServerLabel stringThe label of the MCP server running the tool.
-
Type McpCallThe type of the item. Always
mcp_call.const McpCallMcpCall McpCall = "mcp_call"
-
ApprovalRequestID stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
Error stringThe error from the tool call, if any.
-
Output stringThe output from the tool call.
-
Status stringThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
const ResponseOutputItemMcpCallStatusInProgress ResponseOutputItemMcpCallStatus = "in_progress" -
const ResponseOutputItemMcpCallStatusCompleted ResponseOutputItemMcpCallStatus = "completed" -
const ResponseOutputItemMcpCallStatusIncomplete ResponseOutputItemMcpCallStatus = "incomplete" -
const ResponseOutputItemMcpCallStatusCalling ResponseOutputItemMcpCallStatus = "calling" -
const ResponseOutputItemMcpCallStatusFailed ResponseOutputItemMcpCallStatus = "failed"
-
-
-
type ResponseOutputItemMcpListTools struct{…}A list of tools available on an MCP server.
-
ID stringThe unique ID of the list.
-
ServerLabel stringThe label of the MCP server.
-
Tools []ResponseOutputItemMcpListToolsToolThe tools available on the server.
-
InputSchema anyThe JSON schema describing the tool's input.
-
Name stringThe name of the tool.
-
Annotations anyAdditional annotations about the tool.
-
Description stringThe description of the tool.
-
-
Type McpListToolsThe type of the item. Always
mcp_list_tools.const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
-
Error stringError message if the server could not list tools.
-
-
type ResponseOutputItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
ID stringThe unique ID of the approval request.
-
Arguments stringA JSON string of arguments for the tool.
-
Name stringThe name of the tool to run.
-
ServerLabel stringThe label of the MCP server making the request.
-
Type McpApprovalRequestThe type of the item. Always
mcp_approval_request.const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"
-
-
type ResponseOutputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
ID stringThe unique ID of the approval response
-
ApprovalRequestID stringThe ID of the approval request being answered.
-
Approve boolWhether the request was approved.
-
Type McpApprovalResponseThe type of the item. Always
mcp_approval_response.const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
-
Reason stringOptional reason for the decision.
-
-
type ResponseCustomToolCall struct{…}A call to a custom tool created by the model.
-
type ResponseCustomToolCallOutputItem struct{…}The output of a custom tool call from your code, being sent back to the model.
-
ID stringThe unique ID of the custom tool call output item.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseCustomToolCallOutputItemStatusInProgress ResponseCustomToolCallOutputItemStatus = "in_progress" -
const ResponseCustomToolCallOutputItemStatusCompleted ResponseCustomToolCallOutputItemStatus = "completed" -
const ResponseCustomToolCallOutputItemStatusIncomplete ResponseCustomToolCallOutputItemStatus = "incomplete"
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
-
ParallelToolCalls boolWhether to allow the model to run tool calls in parallel.
-
Temperature float64What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or
top_pbut not both. -
ToolChoice ResponseToolChoiceUnionHow the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call.-
type ToolChoiceOptions stringControls which (if any) tool is called by the model.
nonemeans the model will not call any tool and instead generates a message.automeans the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools.-
const ToolChoiceOptionsNone ToolChoiceOptions = "none" -
const ToolChoiceOptionsAuto ToolChoiceOptions = "auto" -
const ToolChoiceOptionsRequired ToolChoiceOptions = "required"
-
-
type ToolChoiceAllowed struct{…}Constrains the tools available to the model to a pre-defined set.
-
Mode ToolChoiceAllowedModeConstrains the tools available to the model to a pre-defined set.
autoallows the model to pick from among the allowed tools and generate a message.requiredrequires the model to call one or more of the allowed tools.-
const ToolChoiceAllowedModeAuto ToolChoiceAllowedMode = "auto" -
const ToolChoiceAllowedModeRequired ToolChoiceAllowedMode = "required"
-
-
Tools []map[string, any]A list of tool definitions that the model should be allowed to call.
For the Responses API, the list of tool definitions might look like:
[ { "type": "function", "name": "get_weather" }, { "type": "mcp", "server_label": "deepwiki" }, { "type": "image_generation" } ] -
Type AllowedToolsAllowed tool configuration type. Always
allowed_tools.const AllowedToolsAllowedTools AllowedTools = "allowed_tools"
-
-
type ToolChoiceTypes struct{…}Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
-
Type ToolChoiceTypesTypeThe type of hosted tool the model should to use. Learn more about built-in tools.
Allowed values are:
-
file_search -
web_search_preview -
computer -
computer_use_preview -
computer_use -
code_interpreter -
image_generation -
const ToolChoiceTypesTypeFileSearch ToolChoiceTypesType = "file_search" -
const ToolChoiceTypesTypeWebSearchPreview ToolChoiceTypesType = "web_search_preview" -
const ToolChoiceTypesTypeComputer ToolChoiceTypesType = "computer" -
const ToolChoiceTypesTypeComputerUsePreview ToolChoiceTypesType = "computer_use_preview" -
const ToolChoiceTypesTypeComputerUse ToolChoiceTypesType = "computer_use" -
const ToolChoiceTypesTypeWebSearchPreview2025_03_11 ToolChoiceTypesType = "web_search_preview_2025_03_11" -
const ToolChoiceTypesTypeImageGeneration ToolChoiceTypesType = "image_generation" -
const ToolChoiceTypesTypeCodeInterpreter ToolChoiceTypesType = "code_interpreter"
-
-
-
type ToolChoiceFunction struct{…}Use this option to force the model to call a specific function.
-
Name stringThe name of the function to call.
-
Type FunctionFor function calling, the type is always
function.const FunctionFunction Function = "function"
-
-
type ToolChoiceMcp struct{…}Use this option to force the model to call a specific tool on a remote MCP server.
-
ServerLabel stringThe label of the MCP server to use.
-
Type McpFor MCP tools, the type is always
mcp.const McpMcp Mcp = "mcp"
-
Name stringThe name of the tool to call on the server.
-
-
type ToolChoiceCustom struct{…}Use this option to force the model to call a specific custom tool.
-
Name stringThe name of the custom tool to call.
-
Type CustomFor custom tool calling, the type is always
custom.const CustomCustom Custom = "custom"
-
-
type ToolChoiceApplyPatch struct{…}Forces the model to call the apply_patch tool when executing a tool call.
-
Type ApplyPatchThe tool to call. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
type ToolChoiceShell struct{…}Forces the model to call the shell tool when a tool call is required.
-
Type ShellThe tool to call. Always
shell.const ShellShell Shell = "shell"
-
-
-
Tools []ToolUnionAn array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.We support the following categories of tools:
-
Built-in tools: Tools that are provided by OpenAI that extend the model's capabilities, like web search or file search. Learn more about built-in tools.
-
MCP Tools: Integrations with third-party systems via custom MCP servers or predefined connectors such as Google Drive and SharePoint. Learn more about MCP Tools.
-
Function calls (custom tools): Functions that are defined by you, enabling the model to call your own code with strongly typed arguments and outputs. Learn more about function calling. You can also use custom tools to call your own code.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
TopP float64An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
We generally recommend altering this or
temperaturebut not both. -
Background boolWhether to run the model response in the background. Learn more.
-
CompletedAt float64Unix timestamp (in seconds) of when this Response was completed. Only present when the status is
completed. -
Conversation ResponseConversationThe conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
-
ID stringThe unique ID of the conversation that this response was associated with.
-
-
MaxOutputTokens int64An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
MaxToolCalls int64The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored.
-
Moderation ResponseModerationModeration results for the response input and output, if moderated completions were requested.
-
Input ResponseModerationInputUnionModeration for the response input.
-
type ResponseModerationInputModerationResult struct{…}A moderation result produced for the response input or output.
-
Categories map[string, bool]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
CategoryAppliedInputTypes map[string, []string]Which modalities of input are reflected by the score for each category.
-
const ResponseModerationInputModerationResultCategoryAppliedInputTypeText ResponseModerationInputModerationResultCategoryAppliedInputType = "text" -
const ResponseModerationInputModerationResultCategoryAppliedInputTypeImage ResponseModerationInputModerationResultCategoryAppliedInputType = "image"
-
-
CategoryScores map[string, float64]A dictionary of moderation categories to scores.
-
Flagged boolA boolean indicating whether the content was flagged by any category.
-
Model stringThe moderation model that produced this result.
-
Type ModerationResultThe object type, which was always
moderation_resultfor successful moderation results.const ModerationResultModerationResult ModerationResult = "moderation_result"
-
-
type ResponseModerationInputError struct{…}An error produced while attempting moderation for the response input or output.
-
Code stringThe error code.
-
Message stringThe error message.
-
Type ErrorThe object type, which was always
errorfor moderation failures.const ErrorError Error = "error"
-
-
-
Output ResponseModerationOutputUnionModeration for the response output.
-
type ResponseModerationOutputModerationResult struct{…}A moderation result produced for the response input or output.
-
Categories map[string, bool]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
CategoryAppliedInputTypes map[string, []string]Which modalities of input are reflected by the score for each category.
-
const ResponseModerationOutputModerationResultCategoryAppliedInputTypeText ResponseModerationOutputModerationResultCategoryAppliedInputType = "text" -
const ResponseModerationOutputModerationResultCategoryAppliedInputTypeImage ResponseModerationOutputModerationResultCategoryAppliedInputType = "image"
-
-
CategoryScores map[string, float64]A dictionary of moderation categories to scores.
-
Flagged boolA boolean indicating whether the content was flagged by any category.
-
Model stringThe moderation model that produced this result.
-
Type ModerationResultThe object type, which was always
moderation_resultfor successful moderation results.const ModerationResultModerationResult ModerationResult = "moderation_result"
-
-
type ResponseModerationOutputError struct{…}An error produced while attempting moderation for the response input or output.
-
Code stringThe error code.
-
Message stringThe error message.
-
Type ErrorThe object type, which was always
errorfor moderation failures.const ErrorError Error = "error"
-
-
-
-
PreviousResponseID stringThe unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about conversation state. Cannot be used in conjunction with
conversation. -
Prompt ResponsePromptReference to a prompt template and its variables. Learn more.
-
ID stringThe unique identifier of the prompt template to use.
-
Variables map[string, ResponsePromptVariableUnion]Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files.
-
string -
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
Version stringOptional version of the prompt template.
-
-
PromptCacheKey stringUsed by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more. -
PromptCacheRetention ResponsePromptCacheRetentionThe retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. Forgpt-5.5,gpt-5.5-pro, and future models, only24his supported.For older models that support both
in_memoryand24h, the default depends on your organization's data retention policy:-
Organizations without ZDR enabled default to
24h. -
Organizations with ZDR enabled default to
in_memorywhenprompt_cache_retentionis not specified. -
const ResponsePromptCacheRetentionInMemory ResponsePromptCacheRetention = "in_memory" -
const ResponsePromptCacheRetention24h ResponsePromptCacheRetention = "24h"
-
-
Reasoning Reasoninggpt-5 and o-series models only
Configuration options for reasoning models.
-
Context ReasoningContextControls which reasoning items are rendered back to the model on later turns. When returned on a response, this is the effective reasoning context mode used for the response.
-
const ReasoningContextAuto ReasoningContext = "auto" -
const ReasoningContextCurrentTurn ReasoningContext = "current_turn" -
const ReasoningContextAllTurns ReasoningContext = "all_turns"
-
-
Effort ReasoningEffortConstrains effort on reasoning for reasoning models. Currently supported values are
none,minimal,low,medium,high, andxhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.-
gpt-5.1defaults tonone, which does not perform reasoning. The supported reasoning values forgpt-5.1arenone,low,medium, andhigh. Tool calls are supported for all reasoning values in gpt-5.1. -
All models before
gpt-5.1default tomediumreasoning effort, and do not supportnone. -
The
gpt-5-promodel defaults to (and only supports)highreasoning effort. -
xhighis supported for all models aftergpt-5.1-codex-max. -
const ReasoningEffortNone ReasoningEffort = "none" -
const ReasoningEffortMinimal ReasoningEffort = "minimal" -
const ReasoningEffortLow ReasoningEffort = "low" -
const ReasoningEffortMedium ReasoningEffort = "medium" -
const ReasoningEffortHigh ReasoningEffort = "high" -
const ReasoningEffortXhigh ReasoningEffort = "xhigh"
-
-
GenerateSummary ReasoningGenerateSummaryDeprecated: use
summaryinstead.A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.-
const ReasoningGenerateSummaryAuto ReasoningGenerateSummary = "auto" -
const ReasoningGenerateSummaryConcise ReasoningGenerateSummary = "concise" -
const ReasoningGenerateSummaryDetailed ReasoningGenerateSummary = "detailed"
-
-
Summary ReasoningSummaryA summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.conciseis supported forcomputer-use-previewmodels and all reasoning models aftergpt-5.-
const ReasoningSummaryAuto ReasoningSummary = "auto" -
const ReasoningSummaryConcise ReasoningSummary = "concise" -
const ReasoningSummaryDetailed ReasoningSummary = "detailed"
-
-
-
SafetyIdentifier stringA stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
ServiceTier ResponseServiceTierSpecifies the processing type used for serving the request.
- If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'.
- If set to 'default', then the request will be processed with the standard pricing and performance for the selected model.
- If set to 'flex' or 'priority', then the request will be processed with the corresponding service tier.
- When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.-
const ResponseServiceTierAuto ResponseServiceTier = "auto" -
const ResponseServiceTierDefault ResponseServiceTier = "default" -
const ResponseServiceTierFlex ResponseServiceTier = "flex" -
const ResponseServiceTierScale ResponseServiceTier = "scale" -
const ResponseServiceTierPriority ResponseServiceTier = "priority"
-
Status ResponseStatusThe status of the response generation. One of
completed,failed,in_progress,cancelled,queued, orincomplete.-
const ResponseStatusCompleted ResponseStatus = "completed" -
const ResponseStatusFailed ResponseStatus = "failed" -
const ResponseStatusInProgress ResponseStatus = "in_progress" -
const ResponseStatusCancelled ResponseStatus = "cancelled" -
const ResponseStatusQueued ResponseStatus = "queued" -
const ResponseStatusIncomplete ResponseStatus = "incomplete"
-
-
Text ResponseTextConfigConfiguration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
Format ResponseFormatTextConfigUnionAn object specifying the format that the model must output.
Configuring
{ "type": "json_schema" }enables Structured Outputs, which ensures the model will match your supplied JSON schema. Learn more in the Structured Outputs guide.The default format is
{ "type": "text" }with no additional options.Not recommended for gpt-4o and newer models:
Setting to
{ "type": "json_object" }enables the older JSON mode, which ensures the message the model generates is valid JSON. Usingjson_schemais preferred for models that support it.-
type ResponseFormatText struct{…}Default response format. Used to generate text responses.
-
Type TextThe type of response format being defined. Always
text.const TextText Text = "text"
-
-
type ResponseFormatTextJSONSchemaConfig struct{…}JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
Name stringThe name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
-
Schema map[string, any]The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
-
Type JSONSchemaThe type of response format being defined. Always
json_schema.const JSONSchemaJSONSchema JSONSchema = "json_schema"
-
Description stringA description of what the response format is for, used by the model to determine how to respond in the format.
-
Strict boolWhether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the
schemafield. Only a subset of JSON Schema is supported whenstrictistrue. To learn more, read the Structured Outputs guide.
-
-
type ResponseFormatJSONObject struct{…}JSON object response format. An older method of generating JSON responses. Using
json_schemais 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 JSONObjectThe type of response format being defined. Always
json_object.const JSONObjectJSONObject JSONObject = "json_object"
-
-
-
Verbosity ResponseTextConfigVerbosityConstrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses. Currently supported values are
low,medium, andhigh.-
const ResponseTextConfigVerbosityLow ResponseTextConfigVerbosity = "low" -
const ResponseTextConfigVerbosityMedium ResponseTextConfigVerbosity = "medium" -
const ResponseTextConfigVerbosityHigh ResponseTextConfigVerbosity = "high"
-
-
TopLogprobs int64An integer between 0 and 20 specifying the maximum number of most likely tokens to return at each token position, each with an associated log probability. In some cases, the number of returned tokens may be fewer than requested.
-
Truncation ResponseTruncationThe truncation strategy to use for the model response.
-
auto: If the input to this Response exceeds the model's context window size, the model will truncate the response to fit the context window by dropping items from the beginning of the conversation. -
disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error. -
const ResponseTruncationAuto ResponseTruncation = "auto" -
const ResponseTruncationDisabled ResponseTruncation = "disabled"
-
-
Usage ResponseUsageRepresents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
-
InputTokens int64The number of input tokens.
-
InputTokensDetails ResponseUsageInputTokensDetailsA detailed breakdown of the input tokens.
-
CachedTokens int64The number of tokens that were retrieved from the cache. More on prompt caching.
-
-
OutputTokens int64The number of output tokens.
-
OutputTokensDetails ResponseUsageOutputTokensDetailsA detailed breakdown of the output tokens.
-
ReasoningTokens int64The number of reasoning tokens.
-
-
TotalTokens int64The total number of tokens used.
-
-
User stringThis field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead to maintain caching optimizations. A stable identifier for your end-users. Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. Learn more.
-
Example
package main
import (
"context"
"fmt"
"github.com/openai/openai-go"
"github.com/openai/openai-go/option"
"github.com/openai/openai-go/responses"
)
func main() {
client := openai.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.Responses.Get(
context.TODO(),
"resp_677efb5139a88190b512bc3fef8e535d",
responses.ResponseGetParams{
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.ID)
}
Response
{
"id": "id",
"created_at": 0,
"error": {
"code": "server_error",
"message": "message"
},
"incomplete_details": {
"reason": "max_output_tokens"
},
"instructions": "string",
"metadata": {
"foo": "string"
},
"model": "gpt-5.1",
"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,
"temperature": 1,
"tool_choice": "none",
"tools": [
{
"name": "name",
"parameters": {
"foo": "bar"
},
"strict": true,
"type": "function",
"defer_loading": true,
"description": "description"
}
],
"top_p": 1,
"background": true,
"completed_at": 0,
"conversation": {
"id": "id"
},
"max_output_tokens": 0,
"max_tool_calls": 0,
"moderation": {
"input": {
"categories": {
"foo": true
},
"category_applied_input_types": {
"foo": [
"text"
]
},
"category_scores": {
"foo": 0
},
"flagged": true,
"model": "model",
"type": "moderation_result"
},
"output": {
"categories": {
"foo": true
},
"category_applied_input_types": {
"foo": [
"text"
]
},
"category_scores": {
"foo": 0
},
"flagged": true,
"model": "model",
"type": "moderation_result"
}
},
"output_text": "output_text",
"previous_response_id": "previous_response_id",
"prompt": {
"id": "id",
"variables": {
"foo": "string"
},
"version": "version"
},
"prompt_cache_key": "prompt-cache-key-1234",
"prompt_cache_retention": "in_memory",
"reasoning": {
"context": "auto",
"effort": "none",
"generate_summary": "auto",
"summary": "auto"
},
"safety_identifier": "safety-identifier-1234",
"service_tier": "auto",
"status": "completed",
"text": {
"format": {
"type": "text"
},
"verbosity": "low"
},
"top_logprobs": 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-1234"
}
Delete a model response
client.Responses.Delete(ctx, responseID) error
delete /responses/{response_id}
Deletes a model response with the given ID.
Parameters
responseID string
Example
package main
import (
"context"
"github.com/openai/openai-go"
"github.com/openai/openai-go/option"
)
func main() {
client := openai.NewClient(
option.WithAPIKey("My API Key"),
)
err := client.Responses.Delete(context.TODO(), "resp_677efb5139a88190b512bc3fef8e535d")
if err != nil {
panic(err.Error())
}
}
Cancel a response
client.Responses.Cancel(ctx, responseID) (*Response, error)
post /responses/{response_id}/cancel
Cancels a model response with the given ID. Only responses created with
the background parameter set to true can be cancelled.
Learn more.
Parameters
responseID string
Returns
-
type Response struct{…}-
ID stringUnique identifier for this Response.
-
CreatedAt float64Unix timestamp (in seconds) of when this Response was created.
-
Error ResponseErrorAn error object returned when the model fails to generate a Response.
-
Code ResponseErrorCodeThe error code for the response.
-
const ResponseErrorCodeServerError ResponseErrorCode = "server_error" -
const ResponseErrorCodeRateLimitExceeded ResponseErrorCode = "rate_limit_exceeded" -
const ResponseErrorCodeInvalidPrompt ResponseErrorCode = "invalid_prompt" -
const ResponseErrorCodeVectorStoreTimeout ResponseErrorCode = "vector_store_timeout" -
const ResponseErrorCodeInvalidImage ResponseErrorCode = "invalid_image" -
const ResponseErrorCodeInvalidImageFormat ResponseErrorCode = "invalid_image_format" -
const ResponseErrorCodeInvalidBase64Image ResponseErrorCode = "invalid_base64_image" -
const ResponseErrorCodeInvalidImageURL ResponseErrorCode = "invalid_image_url" -
const ResponseErrorCodeImageTooLarge ResponseErrorCode = "image_too_large" -
const ResponseErrorCodeImageTooSmall ResponseErrorCode = "image_too_small" -
const ResponseErrorCodeImageParseError ResponseErrorCode = "image_parse_error" -
const ResponseErrorCodeImageContentPolicyViolation ResponseErrorCode = "image_content_policy_violation" -
const ResponseErrorCodeInvalidImageMode ResponseErrorCode = "invalid_image_mode" -
const ResponseErrorCodeImageFileTooLarge ResponseErrorCode = "image_file_too_large" -
const ResponseErrorCodeUnsupportedImageMediaType ResponseErrorCode = "unsupported_image_media_type" -
const ResponseErrorCodeEmptyImageFile ResponseErrorCode = "empty_image_file" -
const ResponseErrorCodeFailedToDownloadImage ResponseErrorCode = "failed_to_download_image" -
const ResponseErrorCodeImageFileNotFound ResponseErrorCode = "image_file_not_found"
-
-
Message stringA human-readable description of the error.
-
-
IncompleteDetails ResponseIncompleteDetailsDetails about why the response is incomplete.
-
Reason stringThe reason why the response is incomplete.
-
const ResponseIncompleteDetailsReasonMaxOutputTokens ResponseIncompleteDetailsReason = "max_output_tokens" -
const ResponseIncompleteDetailsReasonContentFilter ResponseIncompleteDetailsReason = "content_filter"
-
-
-
Instructions ResponseInstructionsUnionA system (or developer) message inserted into the model's context.
When using along with
previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses.-
string -
type ResponseInstructionsInputItemList []ResponseInputItemUnionA list of one or many input items to the model, containing different content types.
-
type EasyInputMessage struct{…}A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.-
Content EasyInputMessageContentUnionText, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
-
string -
type ResponseInputMessageContentList []ResponseInputContentUnionA list of one or many input items to the model, containing different content types.
-
type ResponseInputText struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
Detail ResponseInputImageDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageDetailLow ResponseInputImageDetail = "low" -
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high" -
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto" -
const ResponseInputImageDetailOriginal ResponseInputImageDetail = "original"
-
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFile struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileDetailLow ResponseInputFileDetail = "low" -
const ResponseInputFileDetailHigh ResponseInputFileDetail = "high"
-
-
FileData stringThe content of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Role EasyInputMessageRoleThe role of the message input. One of
user,assistant,system, ordeveloper.-
const EasyInputMessageRoleUser EasyInputMessageRole = "user" -
const EasyInputMessageRoleAssistant EasyInputMessageRole = "assistant" -
const EasyInputMessageRoleSystem EasyInputMessageRole = "system" -
const EasyInputMessageRoleDeveloper EasyInputMessageRole = "developer"
-
-
Phase EasyInputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const EasyInputMessagePhaseCommentary EasyInputMessagePhase = "commentary" -
const EasyInputMessagePhaseFinalAnswer EasyInputMessagePhase = "final_answer"
-
-
Type EasyInputMessageTypeThe type of the message input. Always
message.const EasyInputMessageTypeMessage EasyInputMessageType = "message"
-
-
type ResponseInputItemMessage struct{…}A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole.-
Content ResponseInputMessageContentListA list of one or many input items to the model, containing different content types.
-
Role stringThe role of the message input. One of
user,system, ordeveloper.-
const ResponseInputItemMessageRoleUser ResponseInputItemMessageRole = "user" -
const ResponseInputItemMessageRoleSystem ResponseInputItemMessageRole = "system" -
const ResponseInputItemMessageRoleDeveloper ResponseInputItemMessageRole = "developer"
-
-
Status stringThe status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputItemMessageStatusInProgress ResponseInputItemMessageStatus = "in_progress" -
const ResponseInputItemMessageStatusCompleted ResponseInputItemMessageStatus = "completed" -
const ResponseInputItemMessageStatusIncomplete ResponseInputItemMessageStatus = "incomplete"
-
-
Type stringThe type of the message input. Always set to
message.const ResponseInputItemMessageTypeMessage ResponseInputItemMessageType = "message"
-
-
type ResponseOutputMessage struct{…}An output message from the model.
-
ID stringThe unique ID of the output message.
-
Content []ResponseOutputMessageContentUnionThe content of the output message.
-
type ResponseOutputText struct{…}A text output from the model.
-
Annotations []ResponseOutputTextAnnotationUnionThe annotations of the text output.
-
type ResponseOutputTextAnnotationFileCitation struct{…}A citation to a file.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the file cited.
-
Index int64The index of the file in the list of files.
-
Type FileCitationThe type of the file citation. Always
file_citation.const FileCitationFileCitation FileCitation = "file_citation"
-
-
type ResponseOutputTextAnnotationURLCitation struct{…}A citation for a web resource used to generate a model response.
-
EndIndex int64The index of the last character of the URL citation in the message.
-
StartIndex int64The index of the first character of the URL citation in the message.
-
Title stringThe title of the web resource.
-
Type URLCitationThe type of the URL citation. Always
url_citation.const URLCitationURLCitation URLCitation = "url_citation"
-
URL stringThe URL of the web resource.
-
-
type ResponseOutputTextAnnotationContainerFileCitation struct{…}A citation for a container file used to generate a model response.
-
ContainerID stringThe ID of the container file.
-
EndIndex int64The index of the last character of the container file citation in the message.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the container file cited.
-
StartIndex int64The index of the first character of the container file citation in the message.
-
Type ContainerFileCitationThe type of the container file citation. Always
container_file_citation.const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"
-
-
type ResponseOutputTextAnnotationFilePath struct{…}A path to a file.
-
FileID stringThe ID of the file.
-
Index int64The index of the file in the list of files.
-
Type FilePathThe type of the file path. Always
file_path.const FilePathFilePath FilePath = "file_path"
-
-
-
Text stringThe text output from the model.
-
Type OutputTextThe type of the output text. Always
output_text.const OutputTextOutputText OutputText = "output_text"
-
Logprobs []ResponseOutputTextLogprob-
Token string -
Bytes []int64 -
Logprob float64 -
TopLogprobs []ResponseOutputTextLogprobTopLogprob-
Token string -
Bytes []int64 -
Logprob float64
-
-
-
-
type ResponseOutputRefusal struct{…}A refusal from the model.
-
Refusal stringThe refusal explanation from the model.
-
Type RefusalThe type of the refusal. Always
refusal.const RefusalRefusal Refusal = "refusal"
-
-
-
Role AssistantThe role of the output message. Always
assistant.const AssistantAssistant Assistant = "assistant"
-
Status ResponseOutputMessageStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseOutputMessageStatusInProgress ResponseOutputMessageStatus = "in_progress" -
const ResponseOutputMessageStatusCompleted ResponseOutputMessageStatus = "completed" -
const ResponseOutputMessageStatusIncomplete ResponseOutputMessageStatus = "incomplete"
-
-
Type MessageThe type of the output message. Always
message.const MessageMessage Message = "message"
-
Phase ResponseOutputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const ResponseOutputMessagePhaseCommentary ResponseOutputMessagePhase = "commentary" -
const ResponseOutputMessagePhaseFinalAnswer ResponseOutputMessagePhase = "final_answer"
-
-
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
ID stringThe unique ID of the file search tool call.
-
Queries []stringThe queries used to search for files.
-
Status ResponseFileSearchToolCallStatusThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
const ResponseFileSearchToolCallStatusInProgress ResponseFileSearchToolCallStatus = "in_progress" -
const ResponseFileSearchToolCallStatusSearching ResponseFileSearchToolCallStatus = "searching" -
const ResponseFileSearchToolCallStatusCompleted ResponseFileSearchToolCallStatus = "completed" -
const ResponseFileSearchToolCallStatusIncomplete ResponseFileSearchToolCallStatus = "incomplete" -
const ResponseFileSearchToolCallStatusFailed ResponseFileSearchToolCallStatus = "failed"
-
-
Type FileSearchCallThe type of the file search tool call. Always
file_search_call.const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"
-
Results []ResponseFileSearchToolCallResultThe results of the file search tool call.
-
Attributes map[string, ResponseFileSearchToolCallResultAttributeUnion]Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.
-
string -
float64 -
bool
-
-
FileID stringThe unique ID of the file.
-
Filename stringThe name of the file.
-
Score float64The relevance score of the file - a value between 0 and 1.
-
Text stringThe text that was retrieved from the file.
-
-
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
ID stringThe unique ID of the computer call.
-
CallID stringAn identifier used when responding to the tool call with output.
-
PendingSafetyChecks []ResponseComputerToolCallPendingSafetyCheckThe pending safety checks for the computer call.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status ResponseComputerToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseComputerToolCallStatusInProgress ResponseComputerToolCallStatus = "in_progress" -
const ResponseComputerToolCallStatusCompleted ResponseComputerToolCallStatus = "completed" -
const ResponseComputerToolCallStatusIncomplete ResponseComputerToolCallStatus = "incomplete"
-
-
Type ResponseComputerToolCallTypeThe type of the computer call. Always
computer_call.const ResponseComputerToolCallTypeComputerCall ResponseComputerToolCallType = "computer_call"
-
Action ResponseComputerToolCallActionUnionA click action.
-
type ResponseComputerToolCallActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ResponseComputerToolCallActionClickButtonLeft ResponseComputerToolCallActionClickButton = "left" -
const ResponseComputerToolCallActionClickButtonRight ResponseComputerToolCallActionClickButton = "right" -
const ResponseComputerToolCallActionClickButtonWheel ResponseComputerToolCallActionClickButton = "wheel" -
const ResponseComputerToolCallActionClickButtonBack ResponseComputerToolCallActionClickButton = "back" -
const ResponseComputerToolCallActionClickButtonForward ResponseComputerToolCallActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ResponseComputerToolCallActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ResponseComputerToolCallActionDrag struct{…}A drag action.
-
Path []ResponseComputerToolCallActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ResponseComputerToolCallActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ResponseComputerToolCallActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ResponseComputerToolCallActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ResponseComputerToolCallActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ResponseComputerToolCallActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ResponseComputerToolCallActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
Actions ComputerActionListFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
type ComputerActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ComputerActionClickButtonLeft ComputerActionClickButton = "left" -
const ComputerActionClickButtonRight ComputerActionClickButton = "right" -
const ComputerActionClickButtonWheel ComputerActionClickButton = "wheel" -
const ComputerActionClickButtonBack ComputerActionClickButton = "back" -
const ComputerActionClickButtonForward ComputerActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ComputerActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ComputerActionDrag struct{…}A drag action.
-
Path []ComputerActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ComputerActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ComputerActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ComputerActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ComputerActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ComputerActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ComputerActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
-
type ResponseInputItemComputerCallOutput struct{…}The output of a computer tool call.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Type ComputerScreenshotSpecifies the event type. For a computer screenshot, this property is always set to
computer_screenshot.const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"
-
FileID stringThe identifier of an uploaded file that contains the screenshot.
-
ImageURL stringThe URL of the screenshot image.
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
ID stringThe ID of the computer tool call output.
-
AcknowledgedSafetyChecks []ResponseInputItemComputerCallOutputAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status stringThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseInputItemComputerCallOutputStatusInProgress ResponseInputItemComputerCallOutputStatus = "in_progress" -
const ResponseInputItemComputerCallOutputStatusCompleted ResponseInputItemComputerCallOutputStatus = "completed" -
const ResponseInputItemComputerCallOutputStatusIncomplete ResponseInputItemComputerCallOutputStatus = "incomplete"
-
-
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
ID stringThe unique ID of the web search tool call.
-
Action ResponseFunctionWebSearchActionUnionAn object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
type ResponseFunctionWebSearchActionSearch struct{…}Action type "search" - Performs a web search query.
-
Type SearchThe action type.
const SearchSearch Search = "search"
-
Queries []stringThe search queries.
-
Query stringThe search query.
-
Sources []ResponseFunctionWebSearchActionSearchSourceThe sources used in the search.
-
Type URLThe type of source. Always
url.const URLURL URL = "url"
-
URL stringThe URL of the source.
-
-
-
type ResponseFunctionWebSearchActionOpenPage struct{…}Action type "open_page" - Opens a specific URL from search results.
-
Type OpenPageThe action type.
const OpenPageOpenPage OpenPage = "open_page"
-
URL stringThe URL opened by the model.
-
-
type ResponseFunctionWebSearchActionFindInPage struct{…}Action type "find_in_page": Searches for a pattern within a loaded page.
-
Pattern stringThe pattern or text to search for within the page.
-
Type FindInPageThe action type.
const FindInPageFindInPage FindInPage = "find_in_page"
-
URL stringThe URL of the page searched for the pattern.
-
-
-
Status ResponseFunctionWebSearchStatusThe status of the web search tool call.
-
const ResponseFunctionWebSearchStatusInProgress ResponseFunctionWebSearchStatus = "in_progress" -
const ResponseFunctionWebSearchStatusSearching ResponseFunctionWebSearchStatus = "searching" -
const ResponseFunctionWebSearchStatusCompleted ResponseFunctionWebSearchStatus = "completed" -
const ResponseFunctionWebSearchStatusFailed ResponseFunctionWebSearchStatus = "failed"
-
-
Type WebSearchCallThe type of the web search tool call. Always
web_search_call.const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"
-
-
type ResponseFunctionToolCall struct{…}A tool call to run a function. See the function calling guide for more information.
-
Arguments stringA JSON string of the arguments to pass to the function.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Name stringThe name of the function to run.
-
Type FunctionCallThe type of the function tool call. Always
function_call.const FunctionCallFunctionCall FunctionCall = "function_call"
-
ID stringThe unique ID of the function tool call.
-
Namespace stringThe namespace of the function to run.
-
Status ResponseFunctionToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallStatusInProgress ResponseFunctionToolCallStatus = "in_progress" -
const ResponseFunctionToolCallStatusCompleted ResponseFunctionToolCallStatus = "completed" -
const ResponseFunctionToolCallStatusIncomplete ResponseFunctionToolCallStatus = "incomplete"
-
-
-
type ResponseInputItemFunctionCallOutput struct{…}The output of a function tool call.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseInputItemFunctionCallOutputOutputUnionText, image, or file output of the function tool call.
-
string -
type ResponseFunctionCallOutputItemList []ResponseFunctionCallOutputItemUnionAn array of content outputs (text, image, file) for the function tool call.
-
type ResponseInputTextContent struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImageContent struct{…}An image input to the model. Learn about image inputs
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
Detail ResponseInputImageContentDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageContentDetailLow ResponseInputImageContentDetail = "low" -
const ResponseInputImageContentDetailHigh ResponseInputImageContentDetail = "high" -
const ResponseInputImageContentDetailAuto ResponseInputImageContentDetail = "auto" -
const ResponseInputImageContentDetailOriginal ResponseInputImageContentDetail = "original"
-
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFileContent struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileContentDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileContentDetailLow ResponseInputFileContentDetail = "low" -
const ResponseInputFileContentDetailHigh ResponseInputFileContentDetail = "high"
-
-
FileData stringThe base64-encoded data of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
ID stringThe unique ID of the function tool call output. Populated when this item is returned via API.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputItemFunctionCallOutputStatusInProgress ResponseInputItemFunctionCallOutputStatus = "in_progress" -
const ResponseInputItemFunctionCallOutputStatusCompleted ResponseInputItemFunctionCallOutputStatus = "completed" -
const ResponseInputItemFunctionCallOutputStatusIncomplete ResponseInputItemFunctionCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemToolSearchCall struct{…}-
Arguments anyThe arguments supplied to the tool search call.
-
Type ToolSearchCallThe item type. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
ID stringThe unique ID of this tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution stringWhether tool search was executed by the server or by the client.
-
const ResponseInputItemToolSearchCallExecutionServer ResponseInputItemToolSearchCallExecution = "server" -
const ResponseInputItemToolSearchCallExecutionClient ResponseInputItemToolSearchCallExecution = "client"
-
-
Status stringThe status of the tool search call.
-
const ResponseInputItemToolSearchCallStatusInProgress ResponseInputItemToolSearchCallStatus = "in_progress" -
const ResponseInputItemToolSearchCallStatusCompleted ResponseInputItemToolSearchCallStatus = "completed" -
const ResponseInputItemToolSearchCallStatusIncomplete ResponseInputItemToolSearchCallStatus = "incomplete"
-
-
-
type ResponseToolSearchOutputItemParamResp struct{…}-
Tools []ToolUnionThe loaded tool definitions returned by the tool search output.
-
type FunctionTool struct{…}Defines a function in your own code the model can choose to call. Learn more about function calling.
-
Name stringThe name of the function to call.
-
Parameters map[string, any]A JSON schema object describing the parameters of the function.
-
Strict boolWhether to enforce strict parameter validation. Default
true. -
Type FunctionThe type of the function tool. Always
function.const FunctionFunction Function = "function"
-
DeferLoading boolWhether this function is deferred and loaded via tool search.
-
Description stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
type FileSearchTool struct{…}A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
Type FileSearchThe type of the file search tool. Always
file_search.const FileSearchFileSearch FileSearch = "file_search"
-
VectorStoreIDs []stringThe IDs of the vector stores to search.
-
Filters FileSearchToolFiltersUnionA filter to apply.
-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
Key stringThe key to compare against the value.
-
Type ComparisonFilterTypeSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
const ComparisonFilterTypeEq ComparisonFilterType = "eq" -
const ComparisonFilterTypeNe ComparisonFilterType = "ne" -
const ComparisonFilterTypeGt ComparisonFilterType = "gt" -
const ComparisonFilterTypeGte ComparisonFilterType = "gte" -
const ComparisonFilterTypeLt ComparisonFilterType = "lt" -
const ComparisonFilterTypeLte ComparisonFilterType = "lte" -
const ComparisonFilterTypeIn ComparisonFilterType = "in" -
const ComparisonFilterTypeNin ComparisonFilterType = "nin"
-
-
Value ComparisonFilterValueUnionThe value to compare against the attribute key; supports string, number, or boolean types.
-
string -
float64 -
bool -
type ComparisonFilterValueArray []ComparisonFilterValueArrayItemUnion-
string -
float64
-
-
-
-
type CompoundFilter struct{…}Combine multiple filters using
andoror.-
Filters []ComparisonFilterArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
-
Type CompoundFilterTypeType of operation:
andoror.-
const CompoundFilterTypeAnd CompoundFilterType = "and" -
const CompoundFilterTypeOr CompoundFilterType = "or"
-
-
-
-
MaxNumResults int64The maximum number of results to return. This number should be between 1 and 50 inclusive.
-
RankingOptions FileSearchToolRankingOptionsRanking options for search.
-
HybridSearch FileSearchToolRankingOptionsHybridSearchWeights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
EmbeddingWeight float64The weight of the embedding in the reciprocal ranking fusion.
-
TextWeight float64The weight of the text in the reciprocal ranking fusion.
-
-
Ranker stringThe ranker to use for the file search.
-
const FileSearchToolRankingOptionsRankerAuto FileSearchToolRankingOptionsRanker = "auto" -
const FileSearchToolRankingOptionsRankerDefault2024_11_15 FileSearchToolRankingOptionsRanker = "default-2024-11-15"
-
-
ScoreThreshold float64The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
Type ComputerThe type of the computer tool. Always
computer.const ComputerComputer Computer = "computer"
-
-
type ComputerUsePreviewTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
DisplayHeight int64The height of the computer display.
-
DisplayWidth int64The width of the computer display.
-
Environment ComputerUsePreviewToolEnvironmentThe type of computer environment to control.
-
const ComputerUsePreviewToolEnvironmentWindows ComputerUsePreviewToolEnvironment = "windows" -
const ComputerUsePreviewToolEnvironmentMac ComputerUsePreviewToolEnvironment = "mac" -
const ComputerUsePreviewToolEnvironmentLinux ComputerUsePreviewToolEnvironment = "linux" -
const ComputerUsePreviewToolEnvironmentUbuntu ComputerUsePreviewToolEnvironment = "ubuntu" -
const ComputerUsePreviewToolEnvironmentBrowser ComputerUsePreviewToolEnvironment = "browser"
-
-
Type ComputerUsePreviewThe type of the computer use tool. Always
computer_use_preview.const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"
-
-
type WebSearchTool struct{…}Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
Type WebSearchToolTypeThe type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
const WebSearchToolTypeWebSearch WebSearchToolType = "web_search" -
const WebSearchToolTypeWebSearch2025_08_26 WebSearchToolType = "web_search_2025_08_26"
-
-
Filters WebSearchToolFiltersFilters for the search.
-
AllowedDomains []stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
SearchContextSize WebSearchToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchToolSearchContextSizeLow WebSearchToolSearchContextSize = "low" -
const WebSearchToolSearchContextSizeMedium WebSearchToolSearchContextSize = "medium" -
const WebSearchToolSearchContextSizeHigh WebSearchToolSearchContextSize = "high"
-
-
UserLocation WebSearchToolUserLocationThe approximate location of the user.
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
Type stringThe type of location approximation. Always
approximate.const WebSearchToolUserLocationTypeApproximate WebSearchToolUserLocationType = "approximate"
-
-
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
ServerLabel stringA label for this MCP server, used to identify it in tool calls.
-
Type McpThe type of the MCP tool. Always
mcp.const McpMcp Mcp = "mcp"
-
AllowedTools ToolMcpAllowedToolsUnionList of allowed tool names or a filter object.
-
type ToolMcpAllowedToolsMcpAllowedTools []stringA string array of allowed tool names
-
type ToolMcpAllowedToolsMcpToolFilter struct{…}A filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
Authorization stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
ConnectorID stringIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
const ToolMcpConnectorIDConnectorDropbox ToolMcpConnectorID = "connector_dropbox" -
const ToolMcpConnectorIDConnectorGmail ToolMcpConnectorID = "connector_gmail" -
const ToolMcpConnectorIDConnectorGooglecalendar ToolMcpConnectorID = "connector_googlecalendar" -
const ToolMcpConnectorIDConnectorGoogledrive ToolMcpConnectorID = "connector_googledrive" -
const ToolMcpConnectorIDConnectorMicrosoftteams ToolMcpConnectorID = "connector_microsoftteams" -
const ToolMcpConnectorIDConnectorOutlookcalendar ToolMcpConnectorID = "connector_outlookcalendar" -
const ToolMcpConnectorIDConnectorOutlookemail ToolMcpConnectorID = "connector_outlookemail" -
const ToolMcpConnectorIDConnectorSharepoint ToolMcpConnectorID = "connector_sharepoint"
-
-
DeferLoading boolWhether this MCP tool is deferred and discovered via tool search.
-
Headers map[string, string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
RequireApproval ToolMcpRequireApprovalUnionSpecify which of the MCP server's tools require approval.
-
type ToolMcpRequireApprovalMcpToolApprovalFilter 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.-
Always ToolMcpRequireApprovalMcpToolApprovalFilterAlwaysA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
Never ToolMcpRequireApprovalMcpToolApprovalFilterNeverA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
type ToolMcpRequireApprovalMcpToolApprovalSetting stringSpecify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
const ToolMcpRequireApprovalMcpToolApprovalSettingAlways ToolMcpRequireApprovalMcpToolApprovalSetting = "always" -
const ToolMcpRequireApprovalMcpToolApprovalSettingNever ToolMcpRequireApprovalMcpToolApprovalSetting = "never"
-
-
-
ServerDescription stringOptional description of the MCP server, used to provide more context.
-
ServerURL stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
TunnelID stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
Container ToolCodeInterpreterContainerUnionThe code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
string -
type ToolCodeInterpreterContainerCodeInterpreterContainerAuto struct{…}Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
Type AutoAlways
auto.const AutoAuto Auto = "auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit stringThe memory limit for the code interpreter container.
-
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"
-
-
NetworkPolicy ToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…}-
Type DisabledDisable outbound network access. Always
disabled.const DisabledDisabled Disabled = "disabled"
-
-
type ContainerNetworkPolicyAllowlist struct{…}-
AllowedDomains []stringA list of allowed domains when type is
allowlist. -
Type AllowlistAllow outbound network access only to specified domains. Always
allowlist.const AllowlistAllowlist Allowlist = "allowlist"
-
DomainSecrets []ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
Domain stringThe domain associated with the secret.
-
Name stringThe name of the secret to inject for the domain.
-
Value stringThe secret value to inject for the domain.
-
-
-
-
-
-
Type CodeInterpreterThe type of the code interpreter tool. Always
code_interpreter.const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"
-
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
Type ImageGenerationThe type of the image generation tool. Always
image_generation.const ImageGenerationImageGeneration ImageGeneration = "image_generation"
-
Action stringWhether to generate a new image or edit an existing image. Default:
auto.-
const ToolImageGenerationActionGenerate ToolImageGenerationAction = "generate" -
const ToolImageGenerationActionEdit ToolImageGenerationAction = "edit" -
const ToolImageGenerationActionAuto ToolImageGenerationAction = "auto"
-
-
Background stringAllows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
const ToolImageGenerationBackgroundTransparent ToolImageGenerationBackground = "transparent" -
const ToolImageGenerationBackgroundOpaque ToolImageGenerationBackground = "opaque" -
const ToolImageGenerationBackgroundAuto ToolImageGenerationBackground = "auto"
-
-
InputFidelity stringControl how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
const ToolImageGenerationInputFidelityHigh ToolImageGenerationInputFidelity = "high" -
const ToolImageGenerationInputFidelityLow ToolImageGenerationInputFidelity = "low"
-
-
InputImageMask ToolImageGenerationInputImageMaskOptional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
FileID stringFile ID for the mask image.
-
ImageURL stringBase64-encoded mask image.
-
-
Model stringThe image generation model to use. Default:
gpt-image-1.-
string -
string-
const ToolImageGenerationModelGPTImage1 ToolImageGenerationModel = "gpt-image-1" -
const ToolImageGenerationModelGPTImage1Mini ToolImageGenerationModel = "gpt-image-1-mini" -
const ToolImageGenerationModelGPTImage2 ToolImageGenerationModel = "gpt-image-2" -
const ToolImageGenerationModelGPTImage2_2026_04_21 ToolImageGenerationModel = "gpt-image-2-2026-04-21" -
const ToolImageGenerationModelGPTImage1_5 ToolImageGenerationModel = "gpt-image-1.5" -
const ToolImageGenerationModelChatgptImageLatest ToolImageGenerationModel = "chatgpt-image-latest"
-
-
-
Moderation stringModeration level for the generated image. Default:
auto.-
const ToolImageGenerationModerationAuto ToolImageGenerationModeration = "auto" -
const ToolImageGenerationModerationLow ToolImageGenerationModeration = "low"
-
-
OutputCompression int64Compression level for the output image. Default: 100.
-
OutputFormat stringThe output format of the generated image. One of
png,webp, orjpeg. Default:png.-
const ToolImageGenerationOutputFormatPNG ToolImageGenerationOutputFormat = "png" -
const ToolImageGenerationOutputFormatWebP ToolImageGenerationOutputFormat = "webp" -
const ToolImageGenerationOutputFormatJPEG ToolImageGenerationOutputFormat = "jpeg"
-
-
PartialImages int64Number of partial images to generate in streaming mode, from 0 (default value) to 3.
-
Quality stringThe quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
const ToolImageGenerationQualityLow ToolImageGenerationQuality = "low" -
const ToolImageGenerationQualityMedium ToolImageGenerationQuality = "medium" -
const ToolImageGenerationQualityHigh ToolImageGenerationQuality = "high" -
const ToolImageGenerationQualityAuto ToolImageGenerationQuality = "auto"
-
-
Size stringThe size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
string -
string-
const ToolImageGenerationSize1024x1024 ToolImageGenerationSize = "1024x1024" -
const ToolImageGenerationSize1024x1536 ToolImageGenerationSize = "1024x1536" -
const ToolImageGenerationSize1536x1024 ToolImageGenerationSize = "1536x1024" -
const ToolImageGenerationSizeAuto ToolImageGenerationSize = "auto"
-
-
-
-
type ToolLocalShell struct{…}A tool that allows the model to execute shell commands in a local environment.
-
Type LocalShellThe type of the local shell tool. Always
local_shell.const LocalShellLocalShell LocalShell = "local_shell"
-
-
type FunctionShellTool struct{…}A tool that allows the model to execute shell commands.
-
Type ShellThe type of the shell tool. Always
shell.const ShellShell Shell = "shell"
-
Environment FunctionShellToolEnvironmentUnion-
type ContainerAuto struct{…}-
Type ContainerAutoAutomatically creates a container for this request
const ContainerAutoContainerAuto ContainerAuto = "container_auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit ContainerAutoMemoryLimitThe memory limit for the container.
-
const ContainerAutoMemoryLimit1g ContainerAutoMemoryLimit = "1g" -
const ContainerAutoMemoryLimit4g ContainerAutoMemoryLimit = "4g" -
const ContainerAutoMemoryLimit16g ContainerAutoMemoryLimit = "16g" -
const ContainerAutoMemoryLimit64g ContainerAutoMemoryLimit = "64g"
-
-
NetworkPolicy ContainerAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…} -
type ContainerNetworkPolicyAllowlist struct{…}
-
-
Skills []ContainerAutoSkillUnionAn optional list of skills referenced by id or inline data.
-
type SkillReference struct{…}-
SkillID stringThe ID of the referenced skill.
-
Type SkillReferenceReferences a skill created with the /v1/skills endpoint.
const SkillReferenceSkillReference SkillReference = "skill_reference"
-
Version stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
type InlineSkill struct{…}-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Source InlineSkillSourceInline skill payload
-
Data stringBase64-encoded skill zip bundle.
-
MediaType ApplicationZipThe media type of the inline skill payload. Must be
application/zip.const ApplicationZipApplicationZip ApplicationZip = "application/zip"
-
Type Base64The type of the inline skill source. Must be
base64.const Base64Base64 Base64 = "base64"
-
-
Type InlineDefines an inline skill for this request.
const InlineInline Inline = "inline"
-
-
-
-
type LocalEnvironment struct{…}-
Type LocalUse a local computer environment.
const LocalLocal Local = "local"
-
Skills []LocalSkillAn optional list of skills.
-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Path stringThe path to the directory containing the skill.
-
-
-
type ContainerReference struct{…}-
ContainerID stringThe ID of the referenced container.
-
Type ContainerReferenceReferences a container created with the /v1/containers endpoint
const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
Name stringThe name of the custom tool, used to identify it in tool calls.
-
Type CustomThe type of the custom tool. Always
custom.const CustomCustom Custom = "custom"
-
DeferLoading boolWhether this tool should be deferred and discovered via tool search.
-
Description stringOptional description of the custom tool, used to provide more context.
-
Format CustomToolInputFormatUnionThe input format for the custom tool. Default is unconstrained text.
-
type CustomToolInputFormatText struct{…}Unconstrained free-form text.
-
Type TextUnconstrained text format. Always
text.const TextText Text = "text"
-
-
type CustomToolInputFormatGrammar struct{…}A grammar defined by the user.
-
Definition stringThe grammar definition.
-
Syntax stringThe syntax of the grammar definition. One of
larkorregex.-
const CustomToolInputFormatGrammarSyntaxLark CustomToolInputFormatGrammarSyntax = "lark" -
const CustomToolInputFormatGrammarSyntaxRegex CustomToolInputFormatGrammarSyntax = "regex"
-
-
Type GrammarGrammar format. Always
grammar.const GrammarGrammar Grammar = "grammar"
-
-
-
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
Description stringA description of the namespace shown to the model.
-
Name stringThe namespace name used in tool calls (for example,
crm). -
Tools []NamespaceToolToolUnionThe function/custom tools available inside this namespace.
-
type NamespaceToolToolFunction struct{…}-
Name string -
Type Functionconst FunctionFunction Function = "function"
-
DeferLoading boolWhether this function should be deferred and discovered via tool search.
-
Description string -
Parameters any -
Strict bool
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
-
Type NamespaceThe type of the tool. Always
namespace.const NamespaceNamespace Namespace = "namespace"
-
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
Type ToolSearchThe type of the tool. Always
tool_search.const ToolSearchToolSearch ToolSearch = "tool_search"
-
Description stringDescription shown to the model for a client-executed tool search tool.
-
Execution ToolSearchToolExecutionWhether tool search is executed by the server or by the client.
-
const ToolSearchToolExecutionServer ToolSearchToolExecution = "server" -
const ToolSearchToolExecutionClient ToolSearchToolExecution = "client"
-
-
Parameters anyParameter schema for a client-executed tool search tool.
-
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
Type WebSearchPreviewToolTypeThe type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
const WebSearchPreviewToolTypeWebSearchPreview WebSearchPreviewToolType = "web_search_preview" -
const WebSearchPreviewToolTypeWebSearchPreview2025_03_11 WebSearchPreviewToolType = "web_search_preview_2025_03_11"
-
-
SearchContentTypes []string-
const WebSearchPreviewToolSearchContentTypeText WebSearchPreviewToolSearchContentType = "text" -
const WebSearchPreviewToolSearchContentTypeImage WebSearchPreviewToolSearchContentType = "image"
-
-
SearchContextSize WebSearchPreviewToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchPreviewToolSearchContextSizeLow WebSearchPreviewToolSearchContextSize = "low" -
const WebSearchPreviewToolSearchContextSizeMedium WebSearchPreviewToolSearchContextSize = "medium" -
const WebSearchPreviewToolSearchContextSizeHigh WebSearchPreviewToolSearchContextSize = "high"
-
-
UserLocation WebSearchPreviewToolUserLocationThe user's location.
-
Type ApproximateThe type of location approximation. Always
approximate.const ApproximateApproximate Approximate = "approximate"
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
Type ApplyPatchThe type of the tool. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
-
Type ToolSearchOutputThe item type. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
ID stringThe unique ID of this tool search output.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemParamExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemParamExecutionServer ResponseToolSearchOutputItemParamExecution = "server" -
const ResponseToolSearchOutputItemParamExecutionClient ResponseToolSearchOutputItemParamExecution = "client"
-
-
Status ResponseToolSearchOutputItemParamStatusThe status of the tool search output.
-
const ResponseToolSearchOutputItemParamStatusInProgress ResponseToolSearchOutputItemParamStatus = "in_progress" -
const ResponseToolSearchOutputItemParamStatusCompleted ResponseToolSearchOutputItemParamStatus = "completed" -
const ResponseToolSearchOutputItemParamStatusIncomplete ResponseToolSearchOutputItemParamStatus = "incomplete"
-
-
-
type ResponseInputItemAdditionalTools struct{…}-
Role DeveloperThe role that provided the additional tools. Only
developeris supported.const DeveloperDeveloper Developer = "developer"
-
Tools []ToolUnionA list of additional tools made available at this item.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type AdditionalToolsThe item type. Always
additional_tools.const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"
-
ID stringThe unique ID of this additional tools item.
-
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
ID stringThe unique identifier of the reasoning content.
-
Summary []ResponseReasoningItemSummaryReasoning summary content.
-
Text stringA summary of the reasoning output from the model so far.
-
Type SummaryTextThe type of the object. Always
summary_text.const SummaryTextSummaryText SummaryText = "summary_text"
-
-
Type ReasoningThe type of the object. Always
reasoning.const ReasoningReasoning Reasoning = "reasoning"
-
Content []ResponseReasoningItemContentReasoning text content.
-
Text stringThe reasoning text from the model.
-
Type ReasoningTextThe type of the reasoning text. Always
reasoning_text.const ReasoningTextReasoningText ReasoningText = "reasoning_text"
-
-
EncryptedContent stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
Status ResponseReasoningItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseReasoningItemStatusInProgress ResponseReasoningItemStatus = "in_progress" -
const ResponseReasoningItemStatusCompleted ResponseReasoningItemStatus = "completed" -
const ResponseReasoningItemStatusIncomplete ResponseReasoningItemStatus = "incomplete"
-
-
-
type ResponseCompactionItemParamResp struct{…}A compaction item generated by the
v1/responses/compactAPI.-
EncryptedContent stringThe encrypted content of the compaction summary.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
ID stringThe ID of the compaction item.
-
-
type ResponseInputItemImageGenerationCall struct{…}An image generation request made by the model.
-
ID stringThe unique ID of the image generation call.
-
Result stringThe generated image encoded in base64.
-
Status stringThe status of the image generation call.
-
const ResponseInputItemImageGenerationCallStatusInProgress ResponseInputItemImageGenerationCallStatus = "in_progress" -
const ResponseInputItemImageGenerationCallStatusCompleted ResponseInputItemImageGenerationCallStatus = "completed" -
const ResponseInputItemImageGenerationCallStatusGenerating ResponseInputItemImageGenerationCallStatus = "generating" -
const ResponseInputItemImageGenerationCallStatusFailed ResponseInputItemImageGenerationCallStatus = "failed"
-
-
Type ImageGenerationCallThe type of the image generation call. Always
image_generation_call.const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"
-
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
ID stringThe unique ID of the code interpreter tool call.
-
Code stringThe code to run, or null if not available.
-
ContainerID stringThe ID of the container used to run the code.
-
Outputs []ResponseCodeInterpreterToolCallOutputUnionThe outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
type ResponseCodeInterpreterToolCallOutputLogs struct{…}The logs output from the code interpreter.
-
Logs stringThe logs output from the code interpreter.
-
Type LogsThe type of the output. Always
logs.const LogsLogs Logs = "logs"
-
-
type ResponseCodeInterpreterToolCallOutputImage struct{…}The image output from the code interpreter.
-
Type ImageThe type of the output. Always
image.const ImageImage Image = "image"
-
URL stringThe URL of the image output from the code interpreter.
-
-
-
Status ResponseCodeInterpreterToolCallStatusThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
const ResponseCodeInterpreterToolCallStatusInProgress ResponseCodeInterpreterToolCallStatus = "in_progress" -
const ResponseCodeInterpreterToolCallStatusCompleted ResponseCodeInterpreterToolCallStatus = "completed" -
const ResponseCodeInterpreterToolCallStatusIncomplete ResponseCodeInterpreterToolCallStatus = "incomplete" -
const ResponseCodeInterpreterToolCallStatusInterpreting ResponseCodeInterpreterToolCallStatus = "interpreting" -
const ResponseCodeInterpreterToolCallStatusFailed ResponseCodeInterpreterToolCallStatus = "failed"
-
-
Type CodeInterpreterCallThe type of the code interpreter tool call. Always
code_interpreter_call.const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"
-
-
type ResponseInputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
ID stringThe unique ID of the local shell call.
-
Action ResponseInputItemLocalShellCallActionExecute a shell command on the server.
-
Command []stringThe command to run.
-
Env map[string, string]Environment variables to set for the command.
-
Type ExecThe type of the local shell action. Always
exec.const ExecExec Exec = "exec"
-
TimeoutMs int64Optional timeout in milliseconds for the command.
-
User stringOptional user to run the command as.
-
WorkingDirectory stringOptional working directory to run the command in.
-
-
CallID stringThe unique ID of the local shell tool call generated by the model.
-
Status stringThe status of the local shell call.
-
const ResponseInputItemLocalShellCallStatusInProgress ResponseInputItemLocalShellCallStatus = "in_progress" -
const ResponseInputItemLocalShellCallStatusCompleted ResponseInputItemLocalShellCallStatus = "completed" -
const ResponseInputItemLocalShellCallStatusIncomplete ResponseInputItemLocalShellCallStatus = "incomplete"
-
-
Type LocalShellCallThe type of the local shell call. Always
local_shell_call.const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"
-
-
type ResponseInputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
ID stringThe unique ID of the local shell tool call generated by the model.
-
Output stringA JSON string of the output of the local shell tool call.
-
Type LocalShellCallOutputThe type of the local shell tool call output. Always
local_shell_call_output.const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete.-
const ResponseInputItemLocalShellCallOutputStatusInProgress ResponseInputItemLocalShellCallOutputStatus = "in_progress" -
const ResponseInputItemLocalShellCallOutputStatusCompleted ResponseInputItemLocalShellCallOutputStatus = "completed" -
const ResponseInputItemLocalShellCallOutputStatusIncomplete ResponseInputItemLocalShellCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemShellCall struct{…}A tool representing a request to execute one or more shell commands.
-
Action ResponseInputItemShellCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []stringOrdered shell commands for the execution environment to run.
-
MaxOutputLength int64Maximum number of UTF-8 characters to capture from combined stdout and stderr output.
-
TimeoutMs int64Maximum wall-clock time in milliseconds to allow the shell commands to run.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Environment ResponseInputItemShellCallEnvironmentUnionThe environment to execute the shell commands in.
-
type LocalEnvironment struct{…} -
type ContainerReference struct{…}
-
-
Status stringThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseInputItemShellCallStatusInProgress ResponseInputItemShellCallStatus = "in_progress" -
const ResponseInputItemShellCallStatusCompleted ResponseInputItemShellCallStatus = "completed" -
const ResponseInputItemShellCallStatusIncomplete ResponseInputItemShellCallStatus = "incomplete"
-
-
-
type ResponseInputItemShellCallOutput struct{…}The streamed output items emitted by a shell tool call.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Output []ResponseFunctionShellCallOutputContentCaptured chunks of stdout and stderr output, along with their associated outcomes.
-
Outcome ResponseFunctionShellCallOutputContentOutcomeUnionThe exit or timeout outcome associated with this shell call.
-
type ResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellCallOutputContentOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64The exit code returned by the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringCaptured stderr output for the shell call.
-
Stdout stringCaptured stdout output for the shell call.
-
-
Type ShellCallOutputThe type of the item. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
ID stringThe unique ID of the shell tool call output. Populated when this item is returned via API.
-
MaxOutputLength int64The maximum number of UTF-8 characters captured for this shell call's combined output.
-
Status stringThe status of the shell call output.
-
const ResponseInputItemShellCallOutputStatusInProgress ResponseInputItemShellCallOutputStatus = "in_progress" -
const ResponseInputItemShellCallOutputStatusCompleted ResponseInputItemShellCallOutputStatus = "completed" -
const ResponseInputItemShellCallOutputStatusIncomplete ResponseInputItemShellCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemApplyPatchCall struct{…}A tool call representing a request to create, delete, or update files using diff patches.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseInputItemApplyPatchCallOperationUnionThe specific create, delete, or update instruction for the apply_patch tool call.
-
type ResponseInputItemApplyPatchCallOperationCreateFile struct{…}Instruction for creating a new file via the apply_patch tool.
-
Diff stringUnified diff content to apply when creating the file.
-
Path stringPath of the file to create relative to the workspace root.
-
Type CreateFileThe operation type. Always
create_file.const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseInputItemApplyPatchCallOperationDeleteFile struct{…}Instruction for deleting an existing file via the apply_patch tool.
-
Path stringPath of the file to delete relative to the workspace root.
-
Type DeleteFileThe operation type. Always
delete_file.const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseInputItemApplyPatchCallOperationUpdateFile struct{…}Instruction for updating an existing file via the apply_patch tool.
-
Diff stringUnified diff content to apply to the existing file.
-
Path stringPath of the file to update relative to the workspace root.
-
Type UpdateFileThe operation type. Always
update_file.const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status stringThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseInputItemApplyPatchCallStatusInProgress ResponseInputItemApplyPatchCallStatus = "in_progress" -
const ResponseInputItemApplyPatchCallStatusCompleted ResponseInputItemApplyPatchCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
-
type ResponseInputItemApplyPatchCallOutput struct{…}The streamed output emitted by an apply patch tool call.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status stringThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseInputItemApplyPatchCallOutputStatusCompleted ResponseInputItemApplyPatchCallOutputStatus = "completed" -
const ResponseInputItemApplyPatchCallOutputStatusFailed ResponseInputItemApplyPatchCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
Output stringOptional human-readable log text from the apply patch tool (e.g., patch results or errors).
-
-
type ResponseInputItemMcpListTools struct{…}A list of tools available on an MCP server.
-
ID stringThe unique ID of the list.
-
ServerLabel stringThe label of the MCP server.
-
Tools []ResponseInputItemMcpListToolsToolThe tools available on the server.
-
InputSchema anyThe JSON schema describing the tool's input.
-
Name stringThe name of the tool.
-
Annotations anyAdditional annotations about the tool.
-
Description stringThe description of the tool.
-
-
Type McpListToolsThe type of the item. Always
mcp_list_tools.const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
-
Error stringError message if the server could not list tools.
-
-
type ResponseInputItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
ID stringThe unique ID of the approval request.
-
Arguments stringA JSON string of arguments for the tool.
-
Name stringThe name of the tool to run.
-
ServerLabel stringThe label of the MCP server making the request.
-
Type McpApprovalRequestThe type of the item. Always
mcp_approval_request.const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"
-
-
type ResponseInputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
ApprovalRequestID stringThe ID of the approval request being answered.
-
Approve boolWhether the request was approved.
-
Type McpApprovalResponseThe type of the item. Always
mcp_approval_response.const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
-
ID stringThe unique ID of the approval response
-
Reason stringOptional reason for the decision.
-
-
type ResponseInputItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
ID stringThe unique ID of the tool call.
-
Arguments stringA JSON string of the arguments passed to the tool.
-
Name stringThe name of the tool that was run.
-
ServerLabel stringThe label of the MCP server running the tool.
-
Type McpCallThe type of the item. Always
mcp_call.const McpCallMcpCall McpCall = "mcp_call"
-
ApprovalRequestID stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
Error stringThe error from the tool call, if any.
-
Output stringThe output from the tool call.
-
Status stringThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
const ResponseInputItemMcpCallStatusInProgress ResponseInputItemMcpCallStatus = "in_progress" -
const ResponseInputItemMcpCallStatusCompleted ResponseInputItemMcpCallStatus = "completed" -
const ResponseInputItemMcpCallStatusIncomplete ResponseInputItemMcpCallStatus = "incomplete" -
const ResponseInputItemMcpCallStatusCalling ResponseInputItemMcpCallStatus = "calling" -
const ResponseInputItemMcpCallStatusFailed ResponseInputItemMcpCallStatus = "failed"
-
-
-
type ResponseCustomToolCallOutput struct{…}The output of a custom tool call from your code, being sent back to the model.
-
CallID stringThe call ID, used to map this custom tool call output to a custom tool call.
-
Output ResponseCustomToolCallOutputOutputUnionThe output from the custom tool call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseCustomToolCallOutputOutputOutputContentList []ResponseCustomToolCallOutputOutputOutputContentListItemUnionText, image, or file output of the custom tool call.
-
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
-
Type CustomToolCallOutputThe type of the custom tool call output. Always
custom_tool_call_output.const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"
-
ID stringThe unique ID of the custom tool call output in the OpenAI platform.
-
-
type ResponseCustomToolCall struct{…}A call to a custom tool created by the model.
-
CallID stringAn identifier used to map this custom tool call to a tool call output.
-
Input stringThe input for the custom tool call generated by the model.
-
Name stringThe name of the custom tool being called.
-
Type CustomToolCallThe type of the custom tool call. Always
custom_tool_call.const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"
-
ID stringThe unique ID of the custom tool call in the OpenAI platform.
-
Namespace stringThe namespace of the custom tool being called.
-
-
type ResponseInputItemCompactionTrigger struct{…}Compacts the current context. Must be the final input item.
-
Type CompactionTriggerThe type of the item. Always
compaction_trigger.const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"
-
-
type ResponseInputItemItemReference struct{…}An internal identifier for an item to reference.
-
ID stringThe ID of the item to reference.
-
Type stringThe type of item to reference. Always
item_reference.const ResponseInputItemItemReferenceTypeItemReference ResponseInputItemItemReferenceType = "item_reference"
-
-
-
-
Metadata MetadataSet of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
-
Model ResponsesModelModel ID used to generate the response, like
gpt-4ooro3. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models.-
string -
type ChatModel string-
const ChatModelGPT5_4 ChatModel = "gpt-5.4" -
const ChatModelGPT5_4Mini ChatModel = "gpt-5.4-mini" -
const ChatModelGPT5_4Nano ChatModel = "gpt-5.4-nano" -
const ChatModelGPT5_4Mini2026_03_17 ChatModel = "gpt-5.4-mini-2026-03-17" -
const ChatModelGPT5_4Nano2026_03_17 ChatModel = "gpt-5.4-nano-2026-03-17" -
const ChatModelGPT5_3ChatLatest ChatModel = "gpt-5.3-chat-latest" -
const ChatModelGPT5_2 ChatModel = "gpt-5.2" -
const ChatModelGPT5_2_2025_12_11 ChatModel = "gpt-5.2-2025-12-11" -
const ChatModelGPT5_2ChatLatest ChatModel = "gpt-5.2-chat-latest" -
const ChatModelGPT5_2Pro ChatModel = "gpt-5.2-pro" -
const ChatModelGPT5_2Pro2025_12_11 ChatModel = "gpt-5.2-pro-2025-12-11" -
const ChatModelGPT5_1 ChatModel = "gpt-5.1" -
const ChatModelGPT5_1_2025_11_13 ChatModel = "gpt-5.1-2025-11-13" -
const ChatModelGPT5_1Codex ChatModel = "gpt-5.1-codex" -
const ChatModelGPT5_1Mini ChatModel = "gpt-5.1-mini" -
const ChatModelGPT5_1ChatLatest ChatModel = "gpt-5.1-chat-latest" -
const ChatModelGPT5 ChatModel = "gpt-5" -
const ChatModelGPT5Mini ChatModel = "gpt-5-mini" -
const ChatModelGPT5Nano ChatModel = "gpt-5-nano" -
const ChatModelGPT5_2025_08_07 ChatModel = "gpt-5-2025-08-07" -
const ChatModelGPT5Mini2025_08_07 ChatModel = "gpt-5-mini-2025-08-07" -
const ChatModelGPT5Nano2025_08_07 ChatModel = "gpt-5-nano-2025-08-07" -
const ChatModelGPT5ChatLatest ChatModel = "gpt-5-chat-latest" -
const ChatModelGPT4_1 ChatModel = "gpt-4.1" -
const ChatModelGPT4_1Mini ChatModel = "gpt-4.1-mini" -
const ChatModelGPT4_1Nano ChatModel = "gpt-4.1-nano" -
const ChatModelGPT4_1_2025_04_14 ChatModel = "gpt-4.1-2025-04-14" -
const ChatModelGPT4_1Mini2025_04_14 ChatModel = "gpt-4.1-mini-2025-04-14" -
const ChatModelGPT4_1Nano2025_04_14 ChatModel = "gpt-4.1-nano-2025-04-14" -
const ChatModelO4Mini ChatModel = "o4-mini" -
const ChatModelO4Mini2025_04_16 ChatModel = "o4-mini-2025-04-16" -
const ChatModelO3 ChatModel = "o3" -
const ChatModelO3_2025_04_16 ChatModel = "o3-2025-04-16" -
const ChatModelO3Mini ChatModel = "o3-mini" -
const ChatModelO3Mini2025_01_31 ChatModel = "o3-mini-2025-01-31" -
const ChatModelO1 ChatModel = "o1" -
const ChatModelO1_2024_12_17 ChatModel = "o1-2024-12-17" -
const ChatModelO1Preview ChatModel = "o1-preview" -
const ChatModelO1Preview2024_09_12 ChatModel = "o1-preview-2024-09-12" -
const ChatModelO1Mini ChatModel = "o1-mini" -
const ChatModelO1Mini2024_09_12 ChatModel = "o1-mini-2024-09-12" -
const ChatModelGPT4o ChatModel = "gpt-4o" -
const ChatModelGPT4o2024_11_20 ChatModel = "gpt-4o-2024-11-20" -
const ChatModelGPT4o2024_08_06 ChatModel = "gpt-4o-2024-08-06" -
const ChatModelGPT4o2024_05_13 ChatModel = "gpt-4o-2024-05-13" -
const ChatModelGPT4oAudioPreview ChatModel = "gpt-4o-audio-preview" -
const ChatModelGPT4oAudioPreview2024_10_01 ChatModel = "gpt-4o-audio-preview-2024-10-01" -
const ChatModelGPT4oAudioPreview2024_12_17 ChatModel = "gpt-4o-audio-preview-2024-12-17" -
const ChatModelGPT4oAudioPreview2025_06_03 ChatModel = "gpt-4o-audio-preview-2025-06-03" -
const ChatModelGPT4oMiniAudioPreview ChatModel = "gpt-4o-mini-audio-preview" -
const ChatModelGPT4oMiniAudioPreview2024_12_17 ChatModel = "gpt-4o-mini-audio-preview-2024-12-17" -
const ChatModelGPT4oSearchPreview ChatModel = "gpt-4o-search-preview" -
const ChatModelGPT4oMiniSearchPreview ChatModel = "gpt-4o-mini-search-preview" -
const ChatModelGPT4oSearchPreview2025_03_11 ChatModel = "gpt-4o-search-preview-2025-03-11" -
const ChatModelGPT4oMiniSearchPreview2025_03_11 ChatModel = "gpt-4o-mini-search-preview-2025-03-11" -
const ChatModelChatgpt4oLatest ChatModel = "chatgpt-4o-latest" -
const ChatModelCodexMiniLatest ChatModel = "codex-mini-latest" -
const ChatModelGPT4oMini ChatModel = "gpt-4o-mini" -
const ChatModelGPT4oMini2024_07_18 ChatModel = "gpt-4o-mini-2024-07-18" -
const ChatModelGPT4Turbo ChatModel = "gpt-4-turbo" -
const ChatModelGPT4Turbo2024_04_09 ChatModel = "gpt-4-turbo-2024-04-09" -
const ChatModelGPT4_0125Preview ChatModel = "gpt-4-0125-preview" -
const ChatModelGPT4TurboPreview ChatModel = "gpt-4-turbo-preview" -
const ChatModelGPT4_1106Preview ChatModel = "gpt-4-1106-preview" -
const ChatModelGPT4VisionPreview ChatModel = "gpt-4-vision-preview" -
const ChatModelGPT4 ChatModel = "gpt-4" -
const ChatModelGPT4_0314 ChatModel = "gpt-4-0314" -
const ChatModelGPT4_0613 ChatModel = "gpt-4-0613" -
const ChatModelGPT4_32k ChatModel = "gpt-4-32k" -
const ChatModelGPT4_32k0314 ChatModel = "gpt-4-32k-0314" -
const ChatModelGPT4_32k0613 ChatModel = "gpt-4-32k-0613" -
const ChatModelGPT3_5Turbo ChatModel = "gpt-3.5-turbo" -
const ChatModelGPT3_5Turbo16k ChatModel = "gpt-3.5-turbo-16k" -
const ChatModelGPT3_5Turbo0301 ChatModel = "gpt-3.5-turbo-0301" -
const ChatModelGPT3_5Turbo0613 ChatModel = "gpt-3.5-turbo-0613" -
const ChatModelGPT3_5Turbo1106 ChatModel = "gpt-3.5-turbo-1106" -
const ChatModelGPT3_5Turbo0125 ChatModel = "gpt-3.5-turbo-0125" -
const ChatModelGPT3_5Turbo16k0613 ChatModel = "gpt-3.5-turbo-16k-0613"
-
-
type ResponsesModel string-
const ResponsesModelO1Pro ResponsesModel = "o1-pro" -
const ResponsesModelO1Pro2025_03_19 ResponsesModel = "o1-pro-2025-03-19" -
const ResponsesModelO3Pro ResponsesModel = "o3-pro" -
const ResponsesModelO3Pro2025_06_10 ResponsesModel = "o3-pro-2025-06-10" -
const ResponsesModelO3DeepResearch ResponsesModel = "o3-deep-research" -
const ResponsesModelO3DeepResearch2025_06_26 ResponsesModel = "o3-deep-research-2025-06-26" -
const ResponsesModelO4MiniDeepResearch ResponsesModel = "o4-mini-deep-research" -
const ResponsesModelO4MiniDeepResearch2025_06_26 ResponsesModel = "o4-mini-deep-research-2025-06-26" -
const ResponsesModelComputerUsePreview ResponsesModel = "computer-use-preview" -
const ResponsesModelComputerUsePreview2025_03_11 ResponsesModel = "computer-use-preview-2025-03-11" -
const ResponsesModelGPT5Codex ResponsesModel = "gpt-5-codex" -
const ResponsesModelGPT5Pro ResponsesModel = "gpt-5-pro" -
const ResponsesModelGPT5Pro2025_10_06 ResponsesModel = "gpt-5-pro-2025-10-06" -
const ResponsesModelGPT5_1CodexMax ResponsesModel = "gpt-5.1-codex-max"
-
-
-
Object ResponseThe object type of this resource - always set to
response.const ResponseResponse Response = "response"
-
Output []ResponseOutputItemUnionAn array of content items generated by the model.
-
The length and order of items in the
outputarray is dependent on the model's response. -
Rather than accessing the first item in the
outputarray and assuming it's anassistantmessage with the content generated by the model, you might consider using theoutput_textproperty where supported in SDKs. -
type ResponseOutputMessage struct{…}An output message from the model.
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
type ResponseFunctionToolCall struct{…}A tool call to run a function. See the function calling guide for more information.
-
type ResponseFunctionToolCallOutputItem struct{…}-
ID stringThe unique ID of the function call tool output.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseFunctionToolCallOutputItemOutputUnionThe output from the function call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseFunctionToolCallOutputItemOutputOutputContentList []ResponseFunctionToolCallOutputItemOutputOutputContentListItemUnionText, image, or file output of the function call.
-
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
-
Status ResponseFunctionToolCallOutputItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallOutputItemStatusInProgress ResponseFunctionToolCallOutputItemStatus = "in_progress" -
const ResponseFunctionToolCallOutputItemStatusCompleted ResponseFunctionToolCallOutputItemStatus = "completed" -
const ResponseFunctionToolCallOutputItemStatusIncomplete ResponseFunctionToolCallOutputItemStatus = "incomplete"
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
type ResponseComputerToolCallOutputItem struct{…}-
ID stringThe unique ID of the computer call tool output.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Status ResponseComputerToolCallOutputItemStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseComputerToolCallOutputItemStatusCompleted ResponseComputerToolCallOutputItemStatus = "completed" -
const ResponseComputerToolCallOutputItemStatusIncomplete ResponseComputerToolCallOutputItemStatus = "incomplete" -
const ResponseComputerToolCallOutputItemStatusFailed ResponseComputerToolCallOutputItemStatus = "failed" -
const ResponseComputerToolCallOutputItemStatusInProgress ResponseComputerToolCallOutputItemStatus = "in_progress"
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
AcknowledgedSafetyChecks []ResponseComputerToolCallOutputItemAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context. -
type ResponseToolSearchCall struct{…}-
ID stringThe unique ID of the tool search call item.
-
Arguments anyArguments used for the tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchCallExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchCallExecutionServer ResponseToolSearchCallExecution = "server" -
const ResponseToolSearchCallExecutionClient ResponseToolSearchCallExecution = "client"
-
-
Status ResponseToolSearchCallStatusThe status of the tool search call item that was recorded.
-
const ResponseToolSearchCallStatusInProgress ResponseToolSearchCallStatus = "in_progress" -
const ResponseToolSearchCallStatusCompleted ResponseToolSearchCallStatus = "completed" -
const ResponseToolSearchCallStatusIncomplete ResponseToolSearchCallStatus = "incomplete"
-
-
Type ToolSearchCallThe type of the item. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseToolSearchOutputItem struct{…}-
ID stringThe unique ID of the tool search output item.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemExecutionServer ResponseToolSearchOutputItemExecution = "server" -
const ResponseToolSearchOutputItemExecutionClient ResponseToolSearchOutputItemExecution = "client"
-
-
Status ResponseToolSearchOutputItemStatusThe status of the tool search output item that was recorded.
-
const ResponseToolSearchOutputItemStatusInProgress ResponseToolSearchOutputItemStatus = "in_progress" -
const ResponseToolSearchOutputItemStatusCompleted ResponseToolSearchOutputItemStatus = "completed" -
const ResponseToolSearchOutputItemStatusIncomplete ResponseToolSearchOutputItemStatus = "incomplete"
-
-
Tools []ToolUnionThe loaded tool definitions returned by tool search.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type ToolSearchOutputThe type of the item. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseOutputItemAdditionalTools struct{…}-
ID stringThe unique ID of the additional tools item.
-
Role stringThe role that provided the additional tools.
-
const ResponseOutputItemAdditionalToolsRoleUnknown ResponseOutputItemAdditionalToolsRole = "unknown" -
const ResponseOutputItemAdditionalToolsRoleUser ResponseOutputItemAdditionalToolsRole = "user" -
const ResponseOutputItemAdditionalToolsRoleAssistant ResponseOutputItemAdditionalToolsRole = "assistant" -
const ResponseOutputItemAdditionalToolsRoleSystem ResponseOutputItemAdditionalToolsRole = "system" -
const ResponseOutputItemAdditionalToolsRoleCritic ResponseOutputItemAdditionalToolsRole = "critic" -
const ResponseOutputItemAdditionalToolsRoleDiscriminator ResponseOutputItemAdditionalToolsRole = "discriminator" -
const ResponseOutputItemAdditionalToolsRoleDeveloper ResponseOutputItemAdditionalToolsRole = "developer" -
const ResponseOutputItemAdditionalToolsRoleTool ResponseOutputItemAdditionalToolsRole = "tool"
-
-
Tools []ToolUnionThe additional tool definitions made available at this item.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type AdditionalToolsThe type of the item. Always
additional_tools.const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"
-
-
type ResponseCompactionItem struct{…}A compaction item generated by the
v1/responses/compactAPI.-
ID stringThe unique ID of the compaction item.
-
EncryptedContent stringThe encrypted content that was produced by compaction.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseOutputItemImageGenerationCall struct{…}An image generation request made by the model.
-
ID stringThe unique ID of the image generation call.
-
Result stringThe generated image encoded in base64.
-
Status stringThe status of the image generation call.
-
const ResponseOutputItemImageGenerationCallStatusInProgress ResponseOutputItemImageGenerationCallStatus = "in_progress" -
const ResponseOutputItemImageGenerationCallStatusCompleted ResponseOutputItemImageGenerationCallStatus = "completed" -
const ResponseOutputItemImageGenerationCallStatusGenerating ResponseOutputItemImageGenerationCallStatus = "generating" -
const ResponseOutputItemImageGenerationCallStatusFailed ResponseOutputItemImageGenerationCallStatus = "failed"
-
-
Type ImageGenerationCallThe type of the image generation call. Always
image_generation_call.const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"
-
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
type ResponseOutputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
ID stringThe unique ID of the local shell call.
-
Action ResponseOutputItemLocalShellCallActionExecute a shell command on the server.
-
Command []stringThe command to run.
-
Env map[string, string]Environment variables to set for the command.
-
Type ExecThe type of the local shell action. Always
exec.const ExecExec Exec = "exec"
-
TimeoutMs int64Optional timeout in milliseconds for the command.
-
User stringOptional user to run the command as.
-
WorkingDirectory stringOptional working directory to run the command in.
-
-
CallID stringThe unique ID of the local shell tool call generated by the model.
-
Status stringThe status of the local shell call.
-
const ResponseOutputItemLocalShellCallStatusInProgress ResponseOutputItemLocalShellCallStatus = "in_progress" -
const ResponseOutputItemLocalShellCallStatusCompleted ResponseOutputItemLocalShellCallStatus = "completed" -
const ResponseOutputItemLocalShellCallStatusIncomplete ResponseOutputItemLocalShellCallStatus = "incomplete"
-
-
Type LocalShellCallThe type of the local shell call. Always
local_shell_call.const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"
-
-
type ResponseOutputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
ID stringThe unique ID of the local shell tool call generated by the model.
-
Output stringA JSON string of the output of the local shell tool call.
-
Type LocalShellCallOutputThe type of the local shell tool call output. Always
local_shell_call_output.const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete.-
const ResponseOutputItemLocalShellCallOutputStatusInProgress ResponseOutputItemLocalShellCallOutputStatus = "in_progress" -
const ResponseOutputItemLocalShellCallOutputStatusCompleted ResponseOutputItemLocalShellCallOutputStatus = "completed" -
const ResponseOutputItemLocalShellCallOutputStatusIncomplete ResponseOutputItemLocalShellCallOutputStatus = "incomplete"
-
-
-
type ResponseFunctionShellToolCall struct{…}A tool call that executes one or more shell commands in a managed environment.
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Action ResponseFunctionShellToolCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []string -
MaxOutputLength int64Optional maximum number of characters to return from each command.
-
TimeoutMs int64Optional timeout in milliseconds for the commands.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Environment ResponseFunctionShellToolCallEnvironmentUnionRepresents the use of a local environment to perform shell actions.
-
type ResponseLocalEnvironment struct{…}Represents the use of a local environment to perform shell actions.
-
Type LocalThe environment type. Always
local.const LocalLocal Local = "local"
-
-
type ResponseContainerReference struct{…}Represents a container created with /v1/containers.
-
ContainerID string -
Type ContainerReferenceThe environment type. Always
container_reference.const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
Status ResponseFunctionShellToolCallStatusThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallStatusInProgress ResponseFunctionShellToolCallStatus = "in_progress" -
const ResponseFunctionShellToolCallStatusCompleted ResponseFunctionShellToolCallStatus = "completed" -
const ResponseFunctionShellToolCallStatusIncomplete ResponseFunctionShellToolCallStatus = "incomplete"
-
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseFunctionShellToolCallOutput struct{…}The output of a shell tool call that was emitted.
-
ID stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
MaxOutputLength int64The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
Output []ResponseFunctionShellToolCallOutputOutputAn array of shell call output contents
-
Outcome ResponseFunctionShellToolCallOutputOutputOutcomeUnionRepresents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
type ResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64Exit code from the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringThe standard error output that was captured.
-
Stdout stringThe standard output that was captured.
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
Status ResponseFunctionShellToolCallOutputStatusThe status of the shell call output. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallOutputStatusInProgress ResponseFunctionShellToolCallOutputStatus = "in_progress" -
const ResponseFunctionShellToolCallOutputStatusCompleted ResponseFunctionShellToolCallOutputStatus = "completed" -
const ResponseFunctionShellToolCallOutputStatusIncomplete ResponseFunctionShellToolCallOutputStatus = "incomplete"
-
-
Type ShellCallOutputThe type of the shell call output. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseApplyPatchToolCall struct{…}A tool call that applies file diffs by creating, deleting, or updating files.
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseApplyPatchToolCallOperationUnionOne of the create_file, delete_file, or update_file operations applied via apply_patch.
-
type ResponseApplyPatchToolCallOperationCreateFile struct{…}Instruction describing how to create a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to create.
-
Type CreateFileCreate a new file with the provided diff.
const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseApplyPatchToolCallOperationDeleteFile struct{…}Instruction describing how to delete a file via the apply_patch tool.
-
Path stringPath of the file to delete.
-
Type DeleteFileDelete the specified file.
const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseApplyPatchToolCallOperationUpdateFile struct{…}Instruction describing how to update a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to update.
-
Type UpdateFileUpdate an existing file with the provided diff.
const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status ResponseApplyPatchToolCallStatusThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseApplyPatchToolCallStatusInProgress ResponseApplyPatchToolCallStatus = "in_progress" -
const ResponseApplyPatchToolCallStatusCompleted ResponseApplyPatchToolCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseApplyPatchToolCallOutput struct{…}The output emitted by an apply patch tool call.
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status ResponseApplyPatchToolCallOutputStatusThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseApplyPatchToolCallOutputStatusCompleted ResponseApplyPatchToolCallOutputStatus = "completed" -
const ResponseApplyPatchToolCallOutputStatusFailed ResponseApplyPatchToolCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
CreatedBy stringThe ID of the entity that created this tool call output.
-
Output stringOptional textual output returned by the apply patch tool.
-
-
type ResponseOutputItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
ID stringThe unique ID of the tool call.
-
Arguments stringA JSON string of the arguments passed to the tool.
-
Name stringThe name of the tool that was run.
-
ServerLabel stringThe label of the MCP server running the tool.
-
Type McpCallThe type of the item. Always
mcp_call.const McpCallMcpCall McpCall = "mcp_call"
-
ApprovalRequestID stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
Error stringThe error from the tool call, if any.
-
Output stringThe output from the tool call.
-
Status stringThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
const ResponseOutputItemMcpCallStatusInProgress ResponseOutputItemMcpCallStatus = "in_progress" -
const ResponseOutputItemMcpCallStatusCompleted ResponseOutputItemMcpCallStatus = "completed" -
const ResponseOutputItemMcpCallStatusIncomplete ResponseOutputItemMcpCallStatus = "incomplete" -
const ResponseOutputItemMcpCallStatusCalling ResponseOutputItemMcpCallStatus = "calling" -
const ResponseOutputItemMcpCallStatusFailed ResponseOutputItemMcpCallStatus = "failed"
-
-
-
type ResponseOutputItemMcpListTools struct{…}A list of tools available on an MCP server.
-
ID stringThe unique ID of the list.
-
ServerLabel stringThe label of the MCP server.
-
Tools []ResponseOutputItemMcpListToolsToolThe tools available on the server.
-
InputSchema anyThe JSON schema describing the tool's input.
-
Name stringThe name of the tool.
-
Annotations anyAdditional annotations about the tool.
-
Description stringThe description of the tool.
-
-
Type McpListToolsThe type of the item. Always
mcp_list_tools.const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
-
Error stringError message if the server could not list tools.
-
-
type ResponseOutputItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
ID stringThe unique ID of the approval request.
-
Arguments stringA JSON string of arguments for the tool.
-
Name stringThe name of the tool to run.
-
ServerLabel stringThe label of the MCP server making the request.
-
Type McpApprovalRequestThe type of the item. Always
mcp_approval_request.const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"
-
-
type ResponseOutputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
ID stringThe unique ID of the approval response
-
ApprovalRequestID stringThe ID of the approval request being answered.
-
Approve boolWhether the request was approved.
-
Type McpApprovalResponseThe type of the item. Always
mcp_approval_response.const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
-
Reason stringOptional reason for the decision.
-
-
type ResponseCustomToolCall struct{…}A call to a custom tool created by the model.
-
type ResponseCustomToolCallOutputItem struct{…}The output of a custom tool call from your code, being sent back to the model.
-
ID stringThe unique ID of the custom tool call output item.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseCustomToolCallOutputItemStatusInProgress ResponseCustomToolCallOutputItemStatus = "in_progress" -
const ResponseCustomToolCallOutputItemStatusCompleted ResponseCustomToolCallOutputItemStatus = "completed" -
const ResponseCustomToolCallOutputItemStatusIncomplete ResponseCustomToolCallOutputItemStatus = "incomplete"
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
-
ParallelToolCalls boolWhether to allow the model to run tool calls in parallel.
-
Temperature float64What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or
top_pbut not both. -
ToolChoice ResponseToolChoiceUnionHow the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call.-
type ToolChoiceOptions stringControls which (if any) tool is called by the model.
nonemeans the model will not call any tool and instead generates a message.automeans the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools.-
const ToolChoiceOptionsNone ToolChoiceOptions = "none" -
const ToolChoiceOptionsAuto ToolChoiceOptions = "auto" -
const ToolChoiceOptionsRequired ToolChoiceOptions = "required"
-
-
type ToolChoiceAllowed struct{…}Constrains the tools available to the model to a pre-defined set.
-
Mode ToolChoiceAllowedModeConstrains the tools available to the model to a pre-defined set.
autoallows the model to pick from among the allowed tools and generate a message.requiredrequires the model to call one or more of the allowed tools.-
const ToolChoiceAllowedModeAuto ToolChoiceAllowedMode = "auto" -
const ToolChoiceAllowedModeRequired ToolChoiceAllowedMode = "required"
-
-
Tools []map[string, any]A list of tool definitions that the model should be allowed to call.
For the Responses API, the list of tool definitions might look like:
[ { "type": "function", "name": "get_weather" }, { "type": "mcp", "server_label": "deepwiki" }, { "type": "image_generation" } ] -
Type AllowedToolsAllowed tool configuration type. Always
allowed_tools.const AllowedToolsAllowedTools AllowedTools = "allowed_tools"
-
-
type ToolChoiceTypes struct{…}Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
-
Type ToolChoiceTypesTypeThe type of hosted tool the model should to use. Learn more about built-in tools.
Allowed values are:
-
file_search -
web_search_preview -
computer -
computer_use_preview -
computer_use -
code_interpreter -
image_generation -
const ToolChoiceTypesTypeFileSearch ToolChoiceTypesType = "file_search" -
const ToolChoiceTypesTypeWebSearchPreview ToolChoiceTypesType = "web_search_preview" -
const ToolChoiceTypesTypeComputer ToolChoiceTypesType = "computer" -
const ToolChoiceTypesTypeComputerUsePreview ToolChoiceTypesType = "computer_use_preview" -
const ToolChoiceTypesTypeComputerUse ToolChoiceTypesType = "computer_use" -
const ToolChoiceTypesTypeWebSearchPreview2025_03_11 ToolChoiceTypesType = "web_search_preview_2025_03_11" -
const ToolChoiceTypesTypeImageGeneration ToolChoiceTypesType = "image_generation" -
const ToolChoiceTypesTypeCodeInterpreter ToolChoiceTypesType = "code_interpreter"
-
-
-
type ToolChoiceFunction struct{…}Use this option to force the model to call a specific function.
-
Name stringThe name of the function to call.
-
Type FunctionFor function calling, the type is always
function.const FunctionFunction Function = "function"
-
-
type ToolChoiceMcp struct{…}Use this option to force the model to call a specific tool on a remote MCP server.
-
ServerLabel stringThe label of the MCP server to use.
-
Type McpFor MCP tools, the type is always
mcp.const McpMcp Mcp = "mcp"
-
Name stringThe name of the tool to call on the server.
-
-
type ToolChoiceCustom struct{…}Use this option to force the model to call a specific custom tool.
-
Name stringThe name of the custom tool to call.
-
Type CustomFor custom tool calling, the type is always
custom.const CustomCustom Custom = "custom"
-
-
type ToolChoiceApplyPatch struct{…}Forces the model to call the apply_patch tool when executing a tool call.
-
Type ApplyPatchThe tool to call. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
type ToolChoiceShell struct{…}Forces the model to call the shell tool when a tool call is required.
-
Type ShellThe tool to call. Always
shell.const ShellShell Shell = "shell"
-
-
-
Tools []ToolUnionAn array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.We support the following categories of tools:
-
Built-in tools: Tools that are provided by OpenAI that extend the model's capabilities, like web search or file search. Learn more about built-in tools.
-
MCP Tools: Integrations with third-party systems via custom MCP servers or predefined connectors such as Google Drive and SharePoint. Learn more about MCP Tools.
-
Function calls (custom tools): Functions that are defined by you, enabling the model to call your own code with strongly typed arguments and outputs. Learn more about function calling. You can also use custom tools to call your own code.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
TopP float64An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
We generally recommend altering this or
temperaturebut not both. -
Background boolWhether to run the model response in the background. Learn more.
-
CompletedAt float64Unix timestamp (in seconds) of when this Response was completed. Only present when the status is
completed. -
Conversation ResponseConversationThe conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
-
ID stringThe unique ID of the conversation that this response was associated with.
-
-
MaxOutputTokens int64An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
MaxToolCalls int64The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored.
-
Moderation ResponseModerationModeration results for the response input and output, if moderated completions were requested.
-
Input ResponseModerationInputUnionModeration for the response input.
-
type ResponseModerationInputModerationResult struct{…}A moderation result produced for the response input or output.
-
Categories map[string, bool]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
CategoryAppliedInputTypes map[string, []string]Which modalities of input are reflected by the score for each category.
-
const ResponseModerationInputModerationResultCategoryAppliedInputTypeText ResponseModerationInputModerationResultCategoryAppliedInputType = "text" -
const ResponseModerationInputModerationResultCategoryAppliedInputTypeImage ResponseModerationInputModerationResultCategoryAppliedInputType = "image"
-
-
CategoryScores map[string, float64]A dictionary of moderation categories to scores.
-
Flagged boolA boolean indicating whether the content was flagged by any category.
-
Model stringThe moderation model that produced this result.
-
Type ModerationResultThe object type, which was always
moderation_resultfor successful moderation results.const ModerationResultModerationResult ModerationResult = "moderation_result"
-
-
type ResponseModerationInputError struct{…}An error produced while attempting moderation for the response input or output.
-
Code stringThe error code.
-
Message stringThe error message.
-
Type ErrorThe object type, which was always
errorfor moderation failures.const ErrorError Error = "error"
-
-
-
Output ResponseModerationOutputUnionModeration for the response output.
-
type ResponseModerationOutputModerationResult struct{…}A moderation result produced for the response input or output.
-
Categories map[string, bool]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
CategoryAppliedInputTypes map[string, []string]Which modalities of input are reflected by the score for each category.
-
const ResponseModerationOutputModerationResultCategoryAppliedInputTypeText ResponseModerationOutputModerationResultCategoryAppliedInputType = "text" -
const ResponseModerationOutputModerationResultCategoryAppliedInputTypeImage ResponseModerationOutputModerationResultCategoryAppliedInputType = "image"
-
-
CategoryScores map[string, float64]A dictionary of moderation categories to scores.
-
Flagged boolA boolean indicating whether the content was flagged by any category.
-
Model stringThe moderation model that produced this result.
-
Type ModerationResultThe object type, which was always
moderation_resultfor successful moderation results.const ModerationResultModerationResult ModerationResult = "moderation_result"
-
-
type ResponseModerationOutputError struct{…}An error produced while attempting moderation for the response input or output.
-
Code stringThe error code.
-
Message stringThe error message.
-
Type ErrorThe object type, which was always
errorfor moderation failures.const ErrorError Error = "error"
-
-
-
-
PreviousResponseID stringThe unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about conversation state. Cannot be used in conjunction with
conversation. -
Prompt ResponsePromptReference to a prompt template and its variables. Learn more.
-
ID stringThe unique identifier of the prompt template to use.
-
Variables map[string, ResponsePromptVariableUnion]Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files.
-
string -
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
Version stringOptional version of the prompt template.
-
-
PromptCacheKey stringUsed by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more. -
PromptCacheRetention ResponsePromptCacheRetentionThe retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. Forgpt-5.5,gpt-5.5-pro, and future models, only24his supported.For older models that support both
in_memoryand24h, the default depends on your organization's data retention policy:-
Organizations without ZDR enabled default to
24h. -
Organizations with ZDR enabled default to
in_memorywhenprompt_cache_retentionis not specified. -
const ResponsePromptCacheRetentionInMemory ResponsePromptCacheRetention = "in_memory" -
const ResponsePromptCacheRetention24h ResponsePromptCacheRetention = "24h"
-
-
Reasoning Reasoninggpt-5 and o-series models only
Configuration options for reasoning models.
-
Context ReasoningContextControls which reasoning items are rendered back to the model on later turns. When returned on a response, this is the effective reasoning context mode used for the response.
-
const ReasoningContextAuto ReasoningContext = "auto" -
const ReasoningContextCurrentTurn ReasoningContext = "current_turn" -
const ReasoningContextAllTurns ReasoningContext = "all_turns"
-
-
Effort ReasoningEffortConstrains effort on reasoning for reasoning models. Currently supported values are
none,minimal,low,medium,high, andxhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.-
gpt-5.1defaults tonone, which does not perform reasoning. The supported reasoning values forgpt-5.1arenone,low,medium, andhigh. Tool calls are supported for all reasoning values in gpt-5.1. -
All models before
gpt-5.1default tomediumreasoning effort, and do not supportnone. -
The
gpt-5-promodel defaults to (and only supports)highreasoning effort. -
xhighis supported for all models aftergpt-5.1-codex-max. -
const ReasoningEffortNone ReasoningEffort = "none" -
const ReasoningEffortMinimal ReasoningEffort = "minimal" -
const ReasoningEffortLow ReasoningEffort = "low" -
const ReasoningEffortMedium ReasoningEffort = "medium" -
const ReasoningEffortHigh ReasoningEffort = "high" -
const ReasoningEffortXhigh ReasoningEffort = "xhigh"
-
-
GenerateSummary ReasoningGenerateSummaryDeprecated: use
summaryinstead.A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.-
const ReasoningGenerateSummaryAuto ReasoningGenerateSummary = "auto" -
const ReasoningGenerateSummaryConcise ReasoningGenerateSummary = "concise" -
const ReasoningGenerateSummaryDetailed ReasoningGenerateSummary = "detailed"
-
-
Summary ReasoningSummaryA summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.conciseis supported forcomputer-use-previewmodels and all reasoning models aftergpt-5.-
const ReasoningSummaryAuto ReasoningSummary = "auto" -
const ReasoningSummaryConcise ReasoningSummary = "concise" -
const ReasoningSummaryDetailed ReasoningSummary = "detailed"
-
-
-
SafetyIdentifier stringA stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
ServiceTier ResponseServiceTierSpecifies the processing type used for serving the request.
- If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'.
- If set to 'default', then the request will be processed with the standard pricing and performance for the selected model.
- If set to 'flex' or 'priority', then the request will be processed with the corresponding service tier.
- When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.-
const ResponseServiceTierAuto ResponseServiceTier = "auto" -
const ResponseServiceTierDefault ResponseServiceTier = "default" -
const ResponseServiceTierFlex ResponseServiceTier = "flex" -
const ResponseServiceTierScale ResponseServiceTier = "scale" -
const ResponseServiceTierPriority ResponseServiceTier = "priority"
-
Status ResponseStatusThe status of the response generation. One of
completed,failed,in_progress,cancelled,queued, orincomplete.-
const ResponseStatusCompleted ResponseStatus = "completed" -
const ResponseStatusFailed ResponseStatus = "failed" -
const ResponseStatusInProgress ResponseStatus = "in_progress" -
const ResponseStatusCancelled ResponseStatus = "cancelled" -
const ResponseStatusQueued ResponseStatus = "queued" -
const ResponseStatusIncomplete ResponseStatus = "incomplete"
-
-
Text ResponseTextConfigConfiguration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
Format ResponseFormatTextConfigUnionAn object specifying the format that the model must output.
Configuring
{ "type": "json_schema" }enables Structured Outputs, which ensures the model will match your supplied JSON schema. Learn more in the Structured Outputs guide.The default format is
{ "type": "text" }with no additional options.Not recommended for gpt-4o and newer models:
Setting to
{ "type": "json_object" }enables the older JSON mode, which ensures the message the model generates is valid JSON. Usingjson_schemais preferred for models that support it.-
type ResponseFormatText struct{…}Default response format. Used to generate text responses.
-
Type TextThe type of response format being defined. Always
text.const TextText Text = "text"
-
-
type ResponseFormatTextJSONSchemaConfig struct{…}JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
Name stringThe name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
-
Schema map[string, any]The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
-
Type JSONSchemaThe type of response format being defined. Always
json_schema.const JSONSchemaJSONSchema JSONSchema = "json_schema"
-
Description stringA description of what the response format is for, used by the model to determine how to respond in the format.
-
Strict boolWhether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the
schemafield. Only a subset of JSON Schema is supported whenstrictistrue. To learn more, read the Structured Outputs guide.
-
-
type ResponseFormatJSONObject struct{…}JSON object response format. An older method of generating JSON responses. Using
json_schemais 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 JSONObjectThe type of response format being defined. Always
json_object.const JSONObjectJSONObject JSONObject = "json_object"
-
-
-
Verbosity ResponseTextConfigVerbosityConstrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses. Currently supported values are
low,medium, andhigh.-
const ResponseTextConfigVerbosityLow ResponseTextConfigVerbosity = "low" -
const ResponseTextConfigVerbosityMedium ResponseTextConfigVerbosity = "medium" -
const ResponseTextConfigVerbosityHigh ResponseTextConfigVerbosity = "high"
-
-
TopLogprobs int64An integer between 0 and 20 specifying the maximum number of most likely tokens to return at each token position, each with an associated log probability. In some cases, the number of returned tokens may be fewer than requested.
-
Truncation ResponseTruncationThe truncation strategy to use for the model response.
-
auto: If the input to this Response exceeds the model's context window size, the model will truncate the response to fit the context window by dropping items from the beginning of the conversation. -
disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error. -
const ResponseTruncationAuto ResponseTruncation = "auto" -
const ResponseTruncationDisabled ResponseTruncation = "disabled"
-
-
Usage ResponseUsageRepresents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
-
InputTokens int64The number of input tokens.
-
InputTokensDetails ResponseUsageInputTokensDetailsA detailed breakdown of the input tokens.
-
CachedTokens int64The number of tokens that were retrieved from the cache. More on prompt caching.
-
-
OutputTokens int64The number of output tokens.
-
OutputTokensDetails ResponseUsageOutputTokensDetailsA detailed breakdown of the output tokens.
-
ReasoningTokens int64The number of reasoning tokens.
-
-
TotalTokens int64The total number of tokens used.
-
-
User stringThis field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead to maintain caching optimizations. A stable identifier for your end-users. Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. Learn more.
-
Example
package main
import (
"context"
"fmt"
"github.com/openai/openai-go"
"github.com/openai/openai-go/option"
)
func main() {
client := openai.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.Responses.Cancel(context.TODO(), "resp_677efb5139a88190b512bc3fef8e535d")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.ID)
}
Response
{
"id": "id",
"created_at": 0,
"error": {
"code": "server_error",
"message": "message"
},
"incomplete_details": {
"reason": "max_output_tokens"
},
"instructions": "string",
"metadata": {
"foo": "string"
},
"model": "gpt-5.1",
"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,
"temperature": 1,
"tool_choice": "none",
"tools": [
{
"name": "name",
"parameters": {
"foo": "bar"
},
"strict": true,
"type": "function",
"defer_loading": true,
"description": "description"
}
],
"top_p": 1,
"background": true,
"completed_at": 0,
"conversation": {
"id": "id"
},
"max_output_tokens": 0,
"max_tool_calls": 0,
"moderation": {
"input": {
"categories": {
"foo": true
},
"category_applied_input_types": {
"foo": [
"text"
]
},
"category_scores": {
"foo": 0
},
"flagged": true,
"model": "model",
"type": "moderation_result"
},
"output": {
"categories": {
"foo": true
},
"category_applied_input_types": {
"foo": [
"text"
]
},
"category_scores": {
"foo": 0
},
"flagged": true,
"model": "model",
"type": "moderation_result"
}
},
"output_text": "output_text",
"previous_response_id": "previous_response_id",
"prompt": {
"id": "id",
"variables": {
"foo": "string"
},
"version": "version"
},
"prompt_cache_key": "prompt-cache-key-1234",
"prompt_cache_retention": "in_memory",
"reasoning": {
"context": "auto",
"effort": "none",
"generate_summary": "auto",
"summary": "auto"
},
"safety_identifier": "safety-identifier-1234",
"service_tier": "auto",
"status": "completed",
"text": {
"format": {
"type": "text"
},
"verbosity": "low"
},
"top_logprobs": 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-1234"
}
Compact a response
client.Responses.Compact(ctx, body) (*CompactedResponse, error)
post /responses/compact
Compact a conversation. Returns a compacted response object.
Learn when and how to compact long-running conversations in the conversation state guide. For ZDR-compatible compaction details, see Compaction (advanced).
Parameters
-
body ResponseCompactParams-
Model param.Field[ResponseCompactParamsModel]Model ID used to generate the response, like
gpt-5oro3. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models.-
type ResponseCompactParamsModel stringModel ID used to generate the response, like
gpt-5oro3. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models.-
const ResponseCompactParamsModelGPT5_4 ResponseCompactParamsModel = "gpt-5.4" -
const ResponseCompactParamsModelGPT5_4Mini ResponseCompactParamsModel = "gpt-5.4-mini" -
const ResponseCompactParamsModelGPT5_4Nano ResponseCompactParamsModel = "gpt-5.4-nano" -
const ResponseCompactParamsModelGPT5_4Mini2026_03_17 ResponseCompactParamsModel = "gpt-5.4-mini-2026-03-17" -
const ResponseCompactParamsModelGPT5_4Nano2026_03_17 ResponseCompactParamsModel = "gpt-5.4-nano-2026-03-17" -
const ResponseCompactParamsModelGPT5_3ChatLatest ResponseCompactParamsModel = "gpt-5.3-chat-latest" -
const ResponseCompactParamsModelGPT5_2 ResponseCompactParamsModel = "gpt-5.2" -
const ResponseCompactParamsModelGPT5_2_2025_12_11 ResponseCompactParamsModel = "gpt-5.2-2025-12-11" -
const ResponseCompactParamsModelGPT5_2ChatLatest ResponseCompactParamsModel = "gpt-5.2-chat-latest" -
const ResponseCompactParamsModelGPT5_2Pro ResponseCompactParamsModel = "gpt-5.2-pro" -
const ResponseCompactParamsModelGPT5_2Pro2025_12_11 ResponseCompactParamsModel = "gpt-5.2-pro-2025-12-11" -
const ResponseCompactParamsModelGPT5_1 ResponseCompactParamsModel = "gpt-5.1" -
const ResponseCompactParamsModelGPT5_1_2025_11_13 ResponseCompactParamsModel = "gpt-5.1-2025-11-13" -
const ResponseCompactParamsModelGPT5_1Codex ResponseCompactParamsModel = "gpt-5.1-codex" -
const ResponseCompactParamsModelGPT5_1Mini ResponseCompactParamsModel = "gpt-5.1-mini" -
const ResponseCompactParamsModelGPT5_1ChatLatest ResponseCompactParamsModel = "gpt-5.1-chat-latest" -
const ResponseCompactParamsModelGPT5 ResponseCompactParamsModel = "gpt-5" -
const ResponseCompactParamsModelGPT5Mini ResponseCompactParamsModel = "gpt-5-mini" -
const ResponseCompactParamsModelGPT5Nano ResponseCompactParamsModel = "gpt-5-nano" -
const ResponseCompactParamsModelGPT5_2025_08_07 ResponseCompactParamsModel = "gpt-5-2025-08-07" -
const ResponseCompactParamsModelGPT5Mini2025_08_07 ResponseCompactParamsModel = "gpt-5-mini-2025-08-07" -
const ResponseCompactParamsModelGPT5Nano2025_08_07 ResponseCompactParamsModel = "gpt-5-nano-2025-08-07" -
const ResponseCompactParamsModelGPT5ChatLatest ResponseCompactParamsModel = "gpt-5-chat-latest" -
const ResponseCompactParamsModelGPT4_1 ResponseCompactParamsModel = "gpt-4.1" -
const ResponseCompactParamsModelGPT4_1Mini ResponseCompactParamsModel = "gpt-4.1-mini" -
const ResponseCompactParamsModelGPT4_1Nano ResponseCompactParamsModel = "gpt-4.1-nano" -
const ResponseCompactParamsModelGPT4_1_2025_04_14 ResponseCompactParamsModel = "gpt-4.1-2025-04-14" -
const ResponseCompactParamsModelGPT4_1Mini2025_04_14 ResponseCompactParamsModel = "gpt-4.1-mini-2025-04-14" -
const ResponseCompactParamsModelGPT4_1Nano2025_04_14 ResponseCompactParamsModel = "gpt-4.1-nano-2025-04-14" -
const ResponseCompactParamsModelO4Mini ResponseCompactParamsModel = "o4-mini" -
const ResponseCompactParamsModelO4Mini2025_04_16 ResponseCompactParamsModel = "o4-mini-2025-04-16" -
const ResponseCompactParamsModelO3 ResponseCompactParamsModel = "o3" -
const ResponseCompactParamsModelO3_2025_04_16 ResponseCompactParamsModel = "o3-2025-04-16" -
const ResponseCompactParamsModelO3Mini ResponseCompactParamsModel = "o3-mini" -
const ResponseCompactParamsModelO3Mini2025_01_31 ResponseCompactParamsModel = "o3-mini-2025-01-31" -
const ResponseCompactParamsModelO1 ResponseCompactParamsModel = "o1" -
const ResponseCompactParamsModelO1_2024_12_17 ResponseCompactParamsModel = "o1-2024-12-17" -
const ResponseCompactParamsModelO1Preview ResponseCompactParamsModel = "o1-preview" -
const ResponseCompactParamsModelO1Preview2024_09_12 ResponseCompactParamsModel = "o1-preview-2024-09-12" -
const ResponseCompactParamsModelO1Mini ResponseCompactParamsModel = "o1-mini" -
const ResponseCompactParamsModelO1Mini2024_09_12 ResponseCompactParamsModel = "o1-mini-2024-09-12" -
const ResponseCompactParamsModelGPT4o ResponseCompactParamsModel = "gpt-4o" -
const ResponseCompactParamsModelGPT4o2024_11_20 ResponseCompactParamsModel = "gpt-4o-2024-11-20" -
const ResponseCompactParamsModelGPT4o2024_08_06 ResponseCompactParamsModel = "gpt-4o-2024-08-06" -
const ResponseCompactParamsModelGPT4o2024_05_13 ResponseCompactParamsModel = "gpt-4o-2024-05-13" -
const ResponseCompactParamsModelGPT4oAudioPreview ResponseCompactParamsModel = "gpt-4o-audio-preview" -
const ResponseCompactParamsModelGPT4oAudioPreview2024_10_01 ResponseCompactParamsModel = "gpt-4o-audio-preview-2024-10-01" -
const ResponseCompactParamsModelGPT4oAudioPreview2024_12_17 ResponseCompactParamsModel = "gpt-4o-audio-preview-2024-12-17" -
const ResponseCompactParamsModelGPT4oAudioPreview2025_06_03 ResponseCompactParamsModel = "gpt-4o-audio-preview-2025-06-03" -
const ResponseCompactParamsModelGPT4oMiniAudioPreview ResponseCompactParamsModel = "gpt-4o-mini-audio-preview" -
const ResponseCompactParamsModelGPT4oMiniAudioPreview2024_12_17 ResponseCompactParamsModel = "gpt-4o-mini-audio-preview-2024-12-17" -
const ResponseCompactParamsModelGPT4oSearchPreview ResponseCompactParamsModel = "gpt-4o-search-preview" -
const ResponseCompactParamsModelGPT4oMiniSearchPreview ResponseCompactParamsModel = "gpt-4o-mini-search-preview" -
const ResponseCompactParamsModelGPT4oSearchPreview2025_03_11 ResponseCompactParamsModel = "gpt-4o-search-preview-2025-03-11" -
const ResponseCompactParamsModelGPT4oMiniSearchPreview2025_03_11 ResponseCompactParamsModel = "gpt-4o-mini-search-preview-2025-03-11" -
const ResponseCompactParamsModelChatgpt4oLatest ResponseCompactParamsModel = "chatgpt-4o-latest" -
const ResponseCompactParamsModelCodexMiniLatest ResponseCompactParamsModel = "codex-mini-latest" -
const ResponseCompactParamsModelGPT4oMini ResponseCompactParamsModel = "gpt-4o-mini" -
const ResponseCompactParamsModelGPT4oMini2024_07_18 ResponseCompactParamsModel = "gpt-4o-mini-2024-07-18" -
const ResponseCompactParamsModelGPT4Turbo ResponseCompactParamsModel = "gpt-4-turbo" -
const ResponseCompactParamsModelGPT4Turbo2024_04_09 ResponseCompactParamsModel = "gpt-4-turbo-2024-04-09" -
const ResponseCompactParamsModelGPT4_0125Preview ResponseCompactParamsModel = "gpt-4-0125-preview" -
const ResponseCompactParamsModelGPT4TurboPreview ResponseCompactParamsModel = "gpt-4-turbo-preview" -
const ResponseCompactParamsModelGPT4_1106Preview ResponseCompactParamsModel = "gpt-4-1106-preview" -
const ResponseCompactParamsModelGPT4VisionPreview ResponseCompactParamsModel = "gpt-4-vision-preview" -
const ResponseCompactParamsModelGPT4 ResponseCompactParamsModel = "gpt-4" -
const ResponseCompactParamsModelGPT4_0314 ResponseCompactParamsModel = "gpt-4-0314" -
const ResponseCompactParamsModelGPT4_0613 ResponseCompactParamsModel = "gpt-4-0613" -
const ResponseCompactParamsModelGPT4_32k ResponseCompactParamsModel = "gpt-4-32k" -
const ResponseCompactParamsModelGPT4_32k0314 ResponseCompactParamsModel = "gpt-4-32k-0314" -
const ResponseCompactParamsModelGPT4_32k0613 ResponseCompactParamsModel = "gpt-4-32k-0613" -
const ResponseCompactParamsModelGPT3_5Turbo ResponseCompactParamsModel = "gpt-3.5-turbo" -
const ResponseCompactParamsModelGPT3_5Turbo16k ResponseCompactParamsModel = "gpt-3.5-turbo-16k" -
const ResponseCompactParamsModelGPT3_5Turbo0301 ResponseCompactParamsModel = "gpt-3.5-turbo-0301" -
const ResponseCompactParamsModelGPT3_5Turbo0613 ResponseCompactParamsModel = "gpt-3.5-turbo-0613" -
const ResponseCompactParamsModelGPT3_5Turbo1106 ResponseCompactParamsModel = "gpt-3.5-turbo-1106" -
const ResponseCompactParamsModelGPT3_5Turbo0125 ResponseCompactParamsModel = "gpt-3.5-turbo-0125" -
const ResponseCompactParamsModelGPT3_5Turbo16k0613 ResponseCompactParamsModel = "gpt-3.5-turbo-16k-0613" -
const ResponseCompactParamsModelO1Pro ResponseCompactParamsModel = "o1-pro" -
const ResponseCompactParamsModelO1Pro2025_03_19 ResponseCompactParamsModel = "o1-pro-2025-03-19" -
const ResponseCompactParamsModelO3Pro ResponseCompactParamsModel = "o3-pro" -
const ResponseCompactParamsModelO3Pro2025_06_10 ResponseCompactParamsModel = "o3-pro-2025-06-10" -
const ResponseCompactParamsModelO3DeepResearch ResponseCompactParamsModel = "o3-deep-research" -
const ResponseCompactParamsModelO3DeepResearch2025_06_26 ResponseCompactParamsModel = "o3-deep-research-2025-06-26" -
const ResponseCompactParamsModelO4MiniDeepResearch ResponseCompactParamsModel = "o4-mini-deep-research" -
const ResponseCompactParamsModelO4MiniDeepResearch2025_06_26 ResponseCompactParamsModel = "o4-mini-deep-research-2025-06-26" -
const ResponseCompactParamsModelComputerUsePreview ResponseCompactParamsModel = "computer-use-preview" -
const ResponseCompactParamsModelComputerUsePreview2025_03_11 ResponseCompactParamsModel = "computer-use-preview-2025-03-11" -
const ResponseCompactParamsModelGPT5Codex ResponseCompactParamsModel = "gpt-5-codex" -
const ResponseCompactParamsModelGPT5Pro ResponseCompactParamsModel = "gpt-5-pro" -
const ResponseCompactParamsModelGPT5Pro2025_10_06 ResponseCompactParamsModel = "gpt-5-pro-2025-10-06" -
const ResponseCompactParamsModelGPT5_1CodexMax ResponseCompactParamsModel = "gpt-5.1-codex-max"
-
-
string
-
-
Input param.Field[ResponseCompactParamsInputUnion]Text, image, or file inputs to the model, used to generate a response
-
string -
type ResponseCompactParamsInputArray []ResponseInputItemUnionA list of one or many input items to the model, containing different content types.
-
type EasyInputMessage struct{…}A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.-
Content EasyInputMessageContentUnionText, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
-
string -
type ResponseInputMessageContentList []ResponseInputContentUnionA list of one or many input items to the model, containing different content types.
-
type ResponseInputText struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
Detail ResponseInputImageDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageDetailLow ResponseInputImageDetail = "low" -
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high" -
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto" -
const ResponseInputImageDetailOriginal ResponseInputImageDetail = "original"
-
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFile struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileDetailLow ResponseInputFileDetail = "low" -
const ResponseInputFileDetailHigh ResponseInputFileDetail = "high"
-
-
FileData stringThe content of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Role EasyInputMessageRoleThe role of the message input. One of
user,assistant,system, ordeveloper.-
const EasyInputMessageRoleUser EasyInputMessageRole = "user" -
const EasyInputMessageRoleAssistant EasyInputMessageRole = "assistant" -
const EasyInputMessageRoleSystem EasyInputMessageRole = "system" -
const EasyInputMessageRoleDeveloper EasyInputMessageRole = "developer"
-
-
Phase EasyInputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const EasyInputMessagePhaseCommentary EasyInputMessagePhase = "commentary" -
const EasyInputMessagePhaseFinalAnswer EasyInputMessagePhase = "final_answer"
-
-
Type EasyInputMessageTypeThe type of the message input. Always
message.const EasyInputMessageTypeMessage EasyInputMessageType = "message"
-
-
type ResponseInputItemMessage struct{…}A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole.-
Content ResponseInputMessageContentListA list of one or many input items to the model, containing different content types.
-
Role stringThe role of the message input. One of
user,system, ordeveloper.-
const ResponseInputItemMessageRoleUser ResponseInputItemMessageRole = "user" -
const ResponseInputItemMessageRoleSystem ResponseInputItemMessageRole = "system" -
const ResponseInputItemMessageRoleDeveloper ResponseInputItemMessageRole = "developer"
-
-
Status stringThe status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputItemMessageStatusInProgress ResponseInputItemMessageStatus = "in_progress" -
const ResponseInputItemMessageStatusCompleted ResponseInputItemMessageStatus = "completed" -
const ResponseInputItemMessageStatusIncomplete ResponseInputItemMessageStatus = "incomplete"
-
-
Type stringThe type of the message input. Always set to
message.const ResponseInputItemMessageTypeMessage ResponseInputItemMessageType = "message"
-
-
type ResponseOutputMessage struct{…}An output message from the model.
-
ID stringThe unique ID of the output message.
-
Content []ResponseOutputMessageContentUnionThe content of the output message.
-
type ResponseOutputText struct{…}A text output from the model.
-
Annotations []ResponseOutputTextAnnotationUnionThe annotations of the text output.
-
type ResponseOutputTextAnnotationFileCitation struct{…}A citation to a file.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the file cited.
-
Index int64The index of the file in the list of files.
-
Type FileCitationThe type of the file citation. Always
file_citation.const FileCitationFileCitation FileCitation = "file_citation"
-
-
type ResponseOutputTextAnnotationURLCitation struct{…}A citation for a web resource used to generate a model response.
-
EndIndex int64The index of the last character of the URL citation in the message.
-
StartIndex int64The index of the first character of the URL citation in the message.
-
Title stringThe title of the web resource.
-
Type URLCitationThe type of the URL citation. Always
url_citation.const URLCitationURLCitation URLCitation = "url_citation"
-
URL stringThe URL of the web resource.
-
-
type ResponseOutputTextAnnotationContainerFileCitation struct{…}A citation for a container file used to generate a model response.
-
ContainerID stringThe ID of the container file.
-
EndIndex int64The index of the last character of the container file citation in the message.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the container file cited.
-
StartIndex int64The index of the first character of the container file citation in the message.
-
Type ContainerFileCitationThe type of the container file citation. Always
container_file_citation.const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"
-
-
type ResponseOutputTextAnnotationFilePath struct{…}A path to a file.
-
FileID stringThe ID of the file.
-
Index int64The index of the file in the list of files.
-
Type FilePathThe type of the file path. Always
file_path.const FilePathFilePath FilePath = "file_path"
-
-
-
Text stringThe text output from the model.
-
Type OutputTextThe type of the output text. Always
output_text.const OutputTextOutputText OutputText = "output_text"
-
Logprobs []ResponseOutputTextLogprob-
Token string -
Bytes []int64 -
Logprob float64 -
TopLogprobs []ResponseOutputTextLogprobTopLogprob-
Token string -
Bytes []int64 -
Logprob float64
-
-
-
-
type ResponseOutputRefusal struct{…}A refusal from the model.
-
Refusal stringThe refusal explanation from the model.
-
Type RefusalThe type of the refusal. Always
refusal.const RefusalRefusal Refusal = "refusal"
-
-
-
Role AssistantThe role of the output message. Always
assistant.const AssistantAssistant Assistant = "assistant"
-
Status ResponseOutputMessageStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseOutputMessageStatusInProgress ResponseOutputMessageStatus = "in_progress" -
const ResponseOutputMessageStatusCompleted ResponseOutputMessageStatus = "completed" -
const ResponseOutputMessageStatusIncomplete ResponseOutputMessageStatus = "incomplete"
-
-
Type MessageThe type of the output message. Always
message.const MessageMessage Message = "message"
-
Phase ResponseOutputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const ResponseOutputMessagePhaseCommentary ResponseOutputMessagePhase = "commentary" -
const ResponseOutputMessagePhaseFinalAnswer ResponseOutputMessagePhase = "final_answer"
-
-
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
ID stringThe unique ID of the file search tool call.
-
Queries []stringThe queries used to search for files.
-
Status ResponseFileSearchToolCallStatusThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
const ResponseFileSearchToolCallStatusInProgress ResponseFileSearchToolCallStatus = "in_progress" -
const ResponseFileSearchToolCallStatusSearching ResponseFileSearchToolCallStatus = "searching" -
const ResponseFileSearchToolCallStatusCompleted ResponseFileSearchToolCallStatus = "completed" -
const ResponseFileSearchToolCallStatusIncomplete ResponseFileSearchToolCallStatus = "incomplete" -
const ResponseFileSearchToolCallStatusFailed ResponseFileSearchToolCallStatus = "failed"
-
-
Type FileSearchCallThe type of the file search tool call. Always
file_search_call.const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"
-
Results []ResponseFileSearchToolCallResultThe results of the file search tool call.
-
Attributes map[string, ResponseFileSearchToolCallResultAttributeUnion]Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.
-
string -
float64 -
bool
-
-
FileID stringThe unique ID of the file.
-
Filename stringThe name of the file.
-
Score float64The relevance score of the file - a value between 0 and 1.
-
Text stringThe text that was retrieved from the file.
-
-
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
ID stringThe unique ID of the computer call.
-
CallID stringAn identifier used when responding to the tool call with output.
-
PendingSafetyChecks []ResponseComputerToolCallPendingSafetyCheckThe pending safety checks for the computer call.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status ResponseComputerToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseComputerToolCallStatusInProgress ResponseComputerToolCallStatus = "in_progress" -
const ResponseComputerToolCallStatusCompleted ResponseComputerToolCallStatus = "completed" -
const ResponseComputerToolCallStatusIncomplete ResponseComputerToolCallStatus = "incomplete"
-
-
Type ResponseComputerToolCallTypeThe type of the computer call. Always
computer_call.const ResponseComputerToolCallTypeComputerCall ResponseComputerToolCallType = "computer_call"
-
Action ResponseComputerToolCallActionUnionA click action.
-
type ResponseComputerToolCallActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ResponseComputerToolCallActionClickButtonLeft ResponseComputerToolCallActionClickButton = "left" -
const ResponseComputerToolCallActionClickButtonRight ResponseComputerToolCallActionClickButton = "right" -
const ResponseComputerToolCallActionClickButtonWheel ResponseComputerToolCallActionClickButton = "wheel" -
const ResponseComputerToolCallActionClickButtonBack ResponseComputerToolCallActionClickButton = "back" -
const ResponseComputerToolCallActionClickButtonForward ResponseComputerToolCallActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ResponseComputerToolCallActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ResponseComputerToolCallActionDrag struct{…}A drag action.
-
Path []ResponseComputerToolCallActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ResponseComputerToolCallActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ResponseComputerToolCallActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ResponseComputerToolCallActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ResponseComputerToolCallActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ResponseComputerToolCallActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ResponseComputerToolCallActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
Actions ComputerActionListFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
type ComputerActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ComputerActionClickButtonLeft ComputerActionClickButton = "left" -
const ComputerActionClickButtonRight ComputerActionClickButton = "right" -
const ComputerActionClickButtonWheel ComputerActionClickButton = "wheel" -
const ComputerActionClickButtonBack ComputerActionClickButton = "back" -
const ComputerActionClickButtonForward ComputerActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ComputerActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ComputerActionDrag struct{…}A drag action.
-
Path []ComputerActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ComputerActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ComputerActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ComputerActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ComputerActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ComputerActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ComputerActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
-
type ResponseInputItemComputerCallOutput struct{…}The output of a computer tool call.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Type ComputerScreenshotSpecifies the event type. For a computer screenshot, this property is always set to
computer_screenshot.const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"
-
FileID stringThe identifier of an uploaded file that contains the screenshot.
-
ImageURL stringThe URL of the screenshot image.
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
ID stringThe ID of the computer tool call output.
-
AcknowledgedSafetyChecks []ResponseInputItemComputerCallOutputAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status stringThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseInputItemComputerCallOutputStatusInProgress ResponseInputItemComputerCallOutputStatus = "in_progress" -
const ResponseInputItemComputerCallOutputStatusCompleted ResponseInputItemComputerCallOutputStatus = "completed" -
const ResponseInputItemComputerCallOutputStatusIncomplete ResponseInputItemComputerCallOutputStatus = "incomplete"
-
-
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
ID stringThe unique ID of the web search tool call.
-
Action ResponseFunctionWebSearchActionUnionAn object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
type ResponseFunctionWebSearchActionSearch struct{…}Action type "search" - Performs a web search query.
-
Type SearchThe action type.
const SearchSearch Search = "search"
-
Queries []stringThe search queries.
-
Query stringThe search query.
-
Sources []ResponseFunctionWebSearchActionSearchSourceThe sources used in the search.
-
Type URLThe type of source. Always
url.const URLURL URL = "url"
-
URL stringThe URL of the source.
-
-
-
type ResponseFunctionWebSearchActionOpenPage struct{…}Action type "open_page" - Opens a specific URL from search results.
-
Type OpenPageThe action type.
const OpenPageOpenPage OpenPage = "open_page"
-
URL stringThe URL opened by the model.
-
-
type ResponseFunctionWebSearchActionFindInPage struct{…}Action type "find_in_page": Searches for a pattern within a loaded page.
-
Pattern stringThe pattern or text to search for within the page.
-
Type FindInPageThe action type.
const FindInPageFindInPage FindInPage = "find_in_page"
-
URL stringThe URL of the page searched for the pattern.
-
-
-
Status ResponseFunctionWebSearchStatusThe status of the web search tool call.
-
const ResponseFunctionWebSearchStatusInProgress ResponseFunctionWebSearchStatus = "in_progress" -
const ResponseFunctionWebSearchStatusSearching ResponseFunctionWebSearchStatus = "searching" -
const ResponseFunctionWebSearchStatusCompleted ResponseFunctionWebSearchStatus = "completed" -
const ResponseFunctionWebSearchStatusFailed ResponseFunctionWebSearchStatus = "failed"
-
-
Type WebSearchCallThe type of the web search tool call. Always
web_search_call.const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"
-
-
type ResponseFunctionToolCall struct{…}A tool call to run a function. See the function calling guide for more information.
-
Arguments stringA JSON string of the arguments to pass to the function.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Name stringThe name of the function to run.
-
Type FunctionCallThe type of the function tool call. Always
function_call.const FunctionCallFunctionCall FunctionCall = "function_call"
-
ID stringThe unique ID of the function tool call.
-
Namespace stringThe namespace of the function to run.
-
Status ResponseFunctionToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallStatusInProgress ResponseFunctionToolCallStatus = "in_progress" -
const ResponseFunctionToolCallStatusCompleted ResponseFunctionToolCallStatus = "completed" -
const ResponseFunctionToolCallStatusIncomplete ResponseFunctionToolCallStatus = "incomplete"
-
-
-
type ResponseInputItemFunctionCallOutput struct{…}The output of a function tool call.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseInputItemFunctionCallOutputOutputUnionText, image, or file output of the function tool call.
-
string -
type ResponseFunctionCallOutputItemList []ResponseFunctionCallOutputItemUnionAn array of content outputs (text, image, file) for the function tool call.
-
type ResponseInputTextContent struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImageContent struct{…}An image input to the model. Learn about image inputs
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
Detail ResponseInputImageContentDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageContentDetailLow ResponseInputImageContentDetail = "low" -
const ResponseInputImageContentDetailHigh ResponseInputImageContentDetail = "high" -
const ResponseInputImageContentDetailAuto ResponseInputImageContentDetail = "auto" -
const ResponseInputImageContentDetailOriginal ResponseInputImageContentDetail = "original"
-
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFileContent struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileContentDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileContentDetailLow ResponseInputFileContentDetail = "low" -
const ResponseInputFileContentDetailHigh ResponseInputFileContentDetail = "high"
-
-
FileData stringThe base64-encoded data of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
ID stringThe unique ID of the function tool call output. Populated when this item is returned via API.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputItemFunctionCallOutputStatusInProgress ResponseInputItemFunctionCallOutputStatus = "in_progress" -
const ResponseInputItemFunctionCallOutputStatusCompleted ResponseInputItemFunctionCallOutputStatus = "completed" -
const ResponseInputItemFunctionCallOutputStatusIncomplete ResponseInputItemFunctionCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemToolSearchCall struct{…}-
Arguments anyThe arguments supplied to the tool search call.
-
Type ToolSearchCallThe item type. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
ID stringThe unique ID of this tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution stringWhether tool search was executed by the server or by the client.
-
const ResponseInputItemToolSearchCallExecutionServer ResponseInputItemToolSearchCallExecution = "server" -
const ResponseInputItemToolSearchCallExecutionClient ResponseInputItemToolSearchCallExecution = "client"
-
-
Status stringThe status of the tool search call.
-
const ResponseInputItemToolSearchCallStatusInProgress ResponseInputItemToolSearchCallStatus = "in_progress" -
const ResponseInputItemToolSearchCallStatusCompleted ResponseInputItemToolSearchCallStatus = "completed" -
const ResponseInputItemToolSearchCallStatusIncomplete ResponseInputItemToolSearchCallStatus = "incomplete"
-
-
-
type ResponseToolSearchOutputItemParamResp struct{…}-
Tools []ToolUnionThe loaded tool definitions returned by the tool search output.
-
type FunctionTool struct{…}Defines a function in your own code the model can choose to call. Learn more about function calling.
-
Name stringThe name of the function to call.
-
Parameters map[string, any]A JSON schema object describing the parameters of the function.
-
Strict boolWhether to enforce strict parameter validation. Default
true. -
Type FunctionThe type of the function tool. Always
function.const FunctionFunction Function = "function"
-
DeferLoading boolWhether this function is deferred and loaded via tool search.
-
Description stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
type FileSearchTool struct{…}A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
Type FileSearchThe type of the file search tool. Always
file_search.const FileSearchFileSearch FileSearch = "file_search"
-
VectorStoreIDs []stringThe IDs of the vector stores to search.
-
Filters FileSearchToolFiltersUnionA filter to apply.
-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
Key stringThe key to compare against the value.
-
Type ComparisonFilterTypeSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
const ComparisonFilterTypeEq ComparisonFilterType = "eq" -
const ComparisonFilterTypeNe ComparisonFilterType = "ne" -
const ComparisonFilterTypeGt ComparisonFilterType = "gt" -
const ComparisonFilterTypeGte ComparisonFilterType = "gte" -
const ComparisonFilterTypeLt ComparisonFilterType = "lt" -
const ComparisonFilterTypeLte ComparisonFilterType = "lte" -
const ComparisonFilterTypeIn ComparisonFilterType = "in" -
const ComparisonFilterTypeNin ComparisonFilterType = "nin"
-
-
Value ComparisonFilterValueUnionThe value to compare against the attribute key; supports string, number, or boolean types.
-
string -
float64 -
bool -
type ComparisonFilterValueArray []ComparisonFilterValueArrayItemUnion-
string -
float64
-
-
-
-
type CompoundFilter struct{…}Combine multiple filters using
andoror.-
Filters []ComparisonFilterArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
-
Type CompoundFilterTypeType of operation:
andoror.-
const CompoundFilterTypeAnd CompoundFilterType = "and" -
const CompoundFilterTypeOr CompoundFilterType = "or"
-
-
-
-
MaxNumResults int64The maximum number of results to return. This number should be between 1 and 50 inclusive.
-
RankingOptions FileSearchToolRankingOptionsRanking options for search.
-
HybridSearch FileSearchToolRankingOptionsHybridSearchWeights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
EmbeddingWeight float64The weight of the embedding in the reciprocal ranking fusion.
-
TextWeight float64The weight of the text in the reciprocal ranking fusion.
-
-
Ranker stringThe ranker to use for the file search.
-
const FileSearchToolRankingOptionsRankerAuto FileSearchToolRankingOptionsRanker = "auto" -
const FileSearchToolRankingOptionsRankerDefault2024_11_15 FileSearchToolRankingOptionsRanker = "default-2024-11-15"
-
-
ScoreThreshold float64The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
Type ComputerThe type of the computer tool. Always
computer.const ComputerComputer Computer = "computer"
-
-
type ComputerUsePreviewTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
DisplayHeight int64The height of the computer display.
-
DisplayWidth int64The width of the computer display.
-
Environment ComputerUsePreviewToolEnvironmentThe type of computer environment to control.
-
const ComputerUsePreviewToolEnvironmentWindows ComputerUsePreviewToolEnvironment = "windows" -
const ComputerUsePreviewToolEnvironmentMac ComputerUsePreviewToolEnvironment = "mac" -
const ComputerUsePreviewToolEnvironmentLinux ComputerUsePreviewToolEnvironment = "linux" -
const ComputerUsePreviewToolEnvironmentUbuntu ComputerUsePreviewToolEnvironment = "ubuntu" -
const ComputerUsePreviewToolEnvironmentBrowser ComputerUsePreviewToolEnvironment = "browser"
-
-
Type ComputerUsePreviewThe type of the computer use tool. Always
computer_use_preview.const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"
-
-
type WebSearchTool struct{…}Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
Type WebSearchToolTypeThe type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
const WebSearchToolTypeWebSearch WebSearchToolType = "web_search" -
const WebSearchToolTypeWebSearch2025_08_26 WebSearchToolType = "web_search_2025_08_26"
-
-
Filters WebSearchToolFiltersFilters for the search.
-
AllowedDomains []stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
SearchContextSize WebSearchToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchToolSearchContextSizeLow WebSearchToolSearchContextSize = "low" -
const WebSearchToolSearchContextSizeMedium WebSearchToolSearchContextSize = "medium" -
const WebSearchToolSearchContextSizeHigh WebSearchToolSearchContextSize = "high"
-
-
UserLocation WebSearchToolUserLocationThe approximate location of the user.
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
Type stringThe type of location approximation. Always
approximate.const WebSearchToolUserLocationTypeApproximate WebSearchToolUserLocationType = "approximate"
-
-
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
ServerLabel stringA label for this MCP server, used to identify it in tool calls.
-
Type McpThe type of the MCP tool. Always
mcp.const McpMcp Mcp = "mcp"
-
AllowedTools ToolMcpAllowedToolsUnionList of allowed tool names or a filter object.
-
type ToolMcpAllowedToolsMcpAllowedTools []stringA string array of allowed tool names
-
type ToolMcpAllowedToolsMcpToolFilter struct{…}A filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
Authorization stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
ConnectorID stringIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
const ToolMcpConnectorIDConnectorDropbox ToolMcpConnectorID = "connector_dropbox" -
const ToolMcpConnectorIDConnectorGmail ToolMcpConnectorID = "connector_gmail" -
const ToolMcpConnectorIDConnectorGooglecalendar ToolMcpConnectorID = "connector_googlecalendar" -
const ToolMcpConnectorIDConnectorGoogledrive ToolMcpConnectorID = "connector_googledrive" -
const ToolMcpConnectorIDConnectorMicrosoftteams ToolMcpConnectorID = "connector_microsoftteams" -
const ToolMcpConnectorIDConnectorOutlookcalendar ToolMcpConnectorID = "connector_outlookcalendar" -
const ToolMcpConnectorIDConnectorOutlookemail ToolMcpConnectorID = "connector_outlookemail" -
const ToolMcpConnectorIDConnectorSharepoint ToolMcpConnectorID = "connector_sharepoint"
-
-
DeferLoading boolWhether this MCP tool is deferred and discovered via tool search.
-
Headers map[string, string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
RequireApproval ToolMcpRequireApprovalUnionSpecify which of the MCP server's tools require approval.
-
type ToolMcpRequireApprovalMcpToolApprovalFilter 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.-
Always ToolMcpRequireApprovalMcpToolApprovalFilterAlwaysA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
Never ToolMcpRequireApprovalMcpToolApprovalFilterNeverA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
type ToolMcpRequireApprovalMcpToolApprovalSetting stringSpecify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
const ToolMcpRequireApprovalMcpToolApprovalSettingAlways ToolMcpRequireApprovalMcpToolApprovalSetting = "always" -
const ToolMcpRequireApprovalMcpToolApprovalSettingNever ToolMcpRequireApprovalMcpToolApprovalSetting = "never"
-
-
-
ServerDescription stringOptional description of the MCP server, used to provide more context.
-
ServerURL stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
TunnelID stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
Container ToolCodeInterpreterContainerUnionThe code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
string -
type ToolCodeInterpreterContainerCodeInterpreterContainerAuto struct{…}Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
Type AutoAlways
auto.const AutoAuto Auto = "auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit stringThe memory limit for the code interpreter container.
-
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"
-
-
NetworkPolicy ToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…}-
Type DisabledDisable outbound network access. Always
disabled.const DisabledDisabled Disabled = "disabled"
-
-
type ContainerNetworkPolicyAllowlist struct{…}-
AllowedDomains []stringA list of allowed domains when type is
allowlist. -
Type AllowlistAllow outbound network access only to specified domains. Always
allowlist.const AllowlistAllowlist Allowlist = "allowlist"
-
DomainSecrets []ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
Domain stringThe domain associated with the secret.
-
Name stringThe name of the secret to inject for the domain.
-
Value stringThe secret value to inject for the domain.
-
-
-
-
-
-
Type CodeInterpreterThe type of the code interpreter tool. Always
code_interpreter.const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"
-
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
Type ImageGenerationThe type of the image generation tool. Always
image_generation.const ImageGenerationImageGeneration ImageGeneration = "image_generation"
-
Action stringWhether to generate a new image or edit an existing image. Default:
auto.-
const ToolImageGenerationActionGenerate ToolImageGenerationAction = "generate" -
const ToolImageGenerationActionEdit ToolImageGenerationAction = "edit" -
const ToolImageGenerationActionAuto ToolImageGenerationAction = "auto"
-
-
Background stringAllows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
const ToolImageGenerationBackgroundTransparent ToolImageGenerationBackground = "transparent" -
const ToolImageGenerationBackgroundOpaque ToolImageGenerationBackground = "opaque" -
const ToolImageGenerationBackgroundAuto ToolImageGenerationBackground = "auto"
-
-
InputFidelity stringControl how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
const ToolImageGenerationInputFidelityHigh ToolImageGenerationInputFidelity = "high" -
const ToolImageGenerationInputFidelityLow ToolImageGenerationInputFidelity = "low"
-
-
InputImageMask ToolImageGenerationInputImageMaskOptional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
FileID stringFile ID for the mask image.
-
ImageURL stringBase64-encoded mask image.
-
-
Model stringThe image generation model to use. Default:
gpt-image-1.-
string -
string-
const ToolImageGenerationModelGPTImage1 ToolImageGenerationModel = "gpt-image-1" -
const ToolImageGenerationModelGPTImage1Mini ToolImageGenerationModel = "gpt-image-1-mini" -
const ToolImageGenerationModelGPTImage2 ToolImageGenerationModel = "gpt-image-2" -
const ToolImageGenerationModelGPTImage2_2026_04_21 ToolImageGenerationModel = "gpt-image-2-2026-04-21" -
const ToolImageGenerationModelGPTImage1_5 ToolImageGenerationModel = "gpt-image-1.5" -
const ToolImageGenerationModelChatgptImageLatest ToolImageGenerationModel = "chatgpt-image-latest"
-
-
-
Moderation stringModeration level for the generated image. Default:
auto.-
const ToolImageGenerationModerationAuto ToolImageGenerationModeration = "auto" -
const ToolImageGenerationModerationLow ToolImageGenerationModeration = "low"
-
-
OutputCompression int64Compression level for the output image. Default: 100.
-
OutputFormat stringThe output format of the generated image. One of
png,webp, orjpeg. Default:png.-
const ToolImageGenerationOutputFormatPNG ToolImageGenerationOutputFormat = "png" -
const ToolImageGenerationOutputFormatWebP ToolImageGenerationOutputFormat = "webp" -
const ToolImageGenerationOutputFormatJPEG ToolImageGenerationOutputFormat = "jpeg"
-
-
PartialImages int64Number of partial images to generate in streaming mode, from 0 (default value) to 3.
-
Quality stringThe quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
const ToolImageGenerationQualityLow ToolImageGenerationQuality = "low" -
const ToolImageGenerationQualityMedium ToolImageGenerationQuality = "medium" -
const ToolImageGenerationQualityHigh ToolImageGenerationQuality = "high" -
const ToolImageGenerationQualityAuto ToolImageGenerationQuality = "auto"
-
-
Size stringThe size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
string -
string-
const ToolImageGenerationSize1024x1024 ToolImageGenerationSize = "1024x1024" -
const ToolImageGenerationSize1024x1536 ToolImageGenerationSize = "1024x1536" -
const ToolImageGenerationSize1536x1024 ToolImageGenerationSize = "1536x1024" -
const ToolImageGenerationSizeAuto ToolImageGenerationSize = "auto"
-
-
-
-
type ToolLocalShell struct{…}A tool that allows the model to execute shell commands in a local environment.
-
Type LocalShellThe type of the local shell tool. Always
local_shell.const LocalShellLocalShell LocalShell = "local_shell"
-
-
type FunctionShellTool struct{…}A tool that allows the model to execute shell commands.
-
Type ShellThe type of the shell tool. Always
shell.const ShellShell Shell = "shell"
-
Environment FunctionShellToolEnvironmentUnion-
type ContainerAuto struct{…}-
Type ContainerAutoAutomatically creates a container for this request
const ContainerAutoContainerAuto ContainerAuto = "container_auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit ContainerAutoMemoryLimitThe memory limit for the container.
-
const ContainerAutoMemoryLimit1g ContainerAutoMemoryLimit = "1g" -
const ContainerAutoMemoryLimit4g ContainerAutoMemoryLimit = "4g" -
const ContainerAutoMemoryLimit16g ContainerAutoMemoryLimit = "16g" -
const ContainerAutoMemoryLimit64g ContainerAutoMemoryLimit = "64g"
-
-
NetworkPolicy ContainerAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…} -
type ContainerNetworkPolicyAllowlist struct{…}
-
-
Skills []ContainerAutoSkillUnionAn optional list of skills referenced by id or inline data.
-
type SkillReference struct{…}-
SkillID stringThe ID of the referenced skill.
-
Type SkillReferenceReferences a skill created with the /v1/skills endpoint.
const SkillReferenceSkillReference SkillReference = "skill_reference"
-
Version stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
type InlineSkill struct{…}-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Source InlineSkillSourceInline skill payload
-
Data stringBase64-encoded skill zip bundle.
-
MediaType ApplicationZipThe media type of the inline skill payload. Must be
application/zip.const ApplicationZipApplicationZip ApplicationZip = "application/zip"
-
Type Base64The type of the inline skill source. Must be
base64.const Base64Base64 Base64 = "base64"
-
-
Type InlineDefines an inline skill for this request.
const InlineInline Inline = "inline"
-
-
-
-
type LocalEnvironment struct{…}-
Type LocalUse a local computer environment.
const LocalLocal Local = "local"
-
Skills []LocalSkillAn optional list of skills.
-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Path stringThe path to the directory containing the skill.
-
-
-
type ContainerReference struct{…}-
ContainerID stringThe ID of the referenced container.
-
Type ContainerReferenceReferences a container created with the /v1/containers endpoint
const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
Name stringThe name of the custom tool, used to identify it in tool calls.
-
Type CustomThe type of the custom tool. Always
custom.const CustomCustom Custom = "custom"
-
DeferLoading boolWhether this tool should be deferred and discovered via tool search.
-
Description stringOptional description of the custom tool, used to provide more context.
-
Format CustomToolInputFormatUnionThe input format for the custom tool. Default is unconstrained text.
-
type CustomToolInputFormatText struct{…}Unconstrained free-form text.
-
Type TextUnconstrained text format. Always
text.const TextText Text = "text"
-
-
type CustomToolInputFormatGrammar struct{…}A grammar defined by the user.
-
Definition stringThe grammar definition.
-
Syntax stringThe syntax of the grammar definition. One of
larkorregex.-
const CustomToolInputFormatGrammarSyntaxLark CustomToolInputFormatGrammarSyntax = "lark" -
const CustomToolInputFormatGrammarSyntaxRegex CustomToolInputFormatGrammarSyntax = "regex"
-
-
Type GrammarGrammar format. Always
grammar.const GrammarGrammar Grammar = "grammar"
-
-
-
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
Description stringA description of the namespace shown to the model.
-
Name stringThe namespace name used in tool calls (for example,
crm). -
Tools []NamespaceToolToolUnionThe function/custom tools available inside this namespace.
-
type NamespaceToolToolFunction struct{…}-
Name string -
Type Functionconst FunctionFunction Function = "function"
-
DeferLoading boolWhether this function should be deferred and discovered via tool search.
-
Description string -
Parameters any -
Strict bool
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
-
Type NamespaceThe type of the tool. Always
namespace.const NamespaceNamespace Namespace = "namespace"
-
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
Type ToolSearchThe type of the tool. Always
tool_search.const ToolSearchToolSearch ToolSearch = "tool_search"
-
Description stringDescription shown to the model for a client-executed tool search tool.
-
Execution ToolSearchToolExecutionWhether tool search is executed by the server or by the client.
-
const ToolSearchToolExecutionServer ToolSearchToolExecution = "server" -
const ToolSearchToolExecutionClient ToolSearchToolExecution = "client"
-
-
Parameters anyParameter schema for a client-executed tool search tool.
-
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
Type WebSearchPreviewToolTypeThe type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
const WebSearchPreviewToolTypeWebSearchPreview WebSearchPreviewToolType = "web_search_preview" -
const WebSearchPreviewToolTypeWebSearchPreview2025_03_11 WebSearchPreviewToolType = "web_search_preview_2025_03_11"
-
-
SearchContentTypes []string-
const WebSearchPreviewToolSearchContentTypeText WebSearchPreviewToolSearchContentType = "text" -
const WebSearchPreviewToolSearchContentTypeImage WebSearchPreviewToolSearchContentType = "image"
-
-
SearchContextSize WebSearchPreviewToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchPreviewToolSearchContextSizeLow WebSearchPreviewToolSearchContextSize = "low" -
const WebSearchPreviewToolSearchContextSizeMedium WebSearchPreviewToolSearchContextSize = "medium" -
const WebSearchPreviewToolSearchContextSizeHigh WebSearchPreviewToolSearchContextSize = "high"
-
-
UserLocation WebSearchPreviewToolUserLocationThe user's location.
-
Type ApproximateThe type of location approximation. Always
approximate.const ApproximateApproximate Approximate = "approximate"
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
Type ApplyPatchThe type of the tool. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
-
Type ToolSearchOutputThe item type. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
ID stringThe unique ID of this tool search output.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemParamExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemParamExecutionServer ResponseToolSearchOutputItemParamExecution = "server" -
const ResponseToolSearchOutputItemParamExecutionClient ResponseToolSearchOutputItemParamExecution = "client"
-
-
Status ResponseToolSearchOutputItemParamStatusThe status of the tool search output.
-
const ResponseToolSearchOutputItemParamStatusInProgress ResponseToolSearchOutputItemParamStatus = "in_progress" -
const ResponseToolSearchOutputItemParamStatusCompleted ResponseToolSearchOutputItemParamStatus = "completed" -
const ResponseToolSearchOutputItemParamStatusIncomplete ResponseToolSearchOutputItemParamStatus = "incomplete"
-
-
-
type ResponseInputItemAdditionalTools struct{…}-
Role DeveloperThe role that provided the additional tools. Only
developeris supported.const DeveloperDeveloper Developer = "developer"
-
Tools []ToolUnionA list of additional tools made available at this item.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type AdditionalToolsThe item type. Always
additional_tools.const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"
-
ID stringThe unique ID of this additional tools item.
-
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
ID stringThe unique identifier of the reasoning content.
-
Summary []ResponseReasoningItemSummaryReasoning summary content.
-
Text stringA summary of the reasoning output from the model so far.
-
Type SummaryTextThe type of the object. Always
summary_text.const SummaryTextSummaryText SummaryText = "summary_text"
-
-
Type ReasoningThe type of the object. Always
reasoning.const ReasoningReasoning Reasoning = "reasoning"
-
Content []ResponseReasoningItemContentReasoning text content.
-
Text stringThe reasoning text from the model.
-
Type ReasoningTextThe type of the reasoning text. Always
reasoning_text.const ReasoningTextReasoningText ReasoningText = "reasoning_text"
-
-
EncryptedContent stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
Status ResponseReasoningItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseReasoningItemStatusInProgress ResponseReasoningItemStatus = "in_progress" -
const ResponseReasoningItemStatusCompleted ResponseReasoningItemStatus = "completed" -
const ResponseReasoningItemStatusIncomplete ResponseReasoningItemStatus = "incomplete"
-
-
-
type ResponseCompactionItemParamResp struct{…}A compaction item generated by the
v1/responses/compactAPI.-
EncryptedContent stringThe encrypted content of the compaction summary.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
ID stringThe ID of the compaction item.
-
-
type ResponseInputItemImageGenerationCall struct{…}An image generation request made by the model.
-
ID stringThe unique ID of the image generation call.
-
Result stringThe generated image encoded in base64.
-
Status stringThe status of the image generation call.
-
const ResponseInputItemImageGenerationCallStatusInProgress ResponseInputItemImageGenerationCallStatus = "in_progress" -
const ResponseInputItemImageGenerationCallStatusCompleted ResponseInputItemImageGenerationCallStatus = "completed" -
const ResponseInputItemImageGenerationCallStatusGenerating ResponseInputItemImageGenerationCallStatus = "generating" -
const ResponseInputItemImageGenerationCallStatusFailed ResponseInputItemImageGenerationCallStatus = "failed"
-
-
Type ImageGenerationCallThe type of the image generation call. Always
image_generation_call.const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"
-
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
ID stringThe unique ID of the code interpreter tool call.
-
Code stringThe code to run, or null if not available.
-
ContainerID stringThe ID of the container used to run the code.
-
Outputs []ResponseCodeInterpreterToolCallOutputUnionThe outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
type ResponseCodeInterpreterToolCallOutputLogs struct{…}The logs output from the code interpreter.
-
Logs stringThe logs output from the code interpreter.
-
Type LogsThe type of the output. Always
logs.const LogsLogs Logs = "logs"
-
-
type ResponseCodeInterpreterToolCallOutputImage struct{…}The image output from the code interpreter.
-
Type ImageThe type of the output. Always
image.const ImageImage Image = "image"
-
URL stringThe URL of the image output from the code interpreter.
-
-
-
Status ResponseCodeInterpreterToolCallStatusThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
const ResponseCodeInterpreterToolCallStatusInProgress ResponseCodeInterpreterToolCallStatus = "in_progress" -
const ResponseCodeInterpreterToolCallStatusCompleted ResponseCodeInterpreterToolCallStatus = "completed" -
const ResponseCodeInterpreterToolCallStatusIncomplete ResponseCodeInterpreterToolCallStatus = "incomplete" -
const ResponseCodeInterpreterToolCallStatusInterpreting ResponseCodeInterpreterToolCallStatus = "interpreting" -
const ResponseCodeInterpreterToolCallStatusFailed ResponseCodeInterpreterToolCallStatus = "failed"
-
-
Type CodeInterpreterCallThe type of the code interpreter tool call. Always
code_interpreter_call.const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"
-
-
type ResponseInputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
ID stringThe unique ID of the local shell call.
-
Action ResponseInputItemLocalShellCallActionExecute a shell command on the server.
-
Command []stringThe command to run.
-
Env map[string, string]Environment variables to set for the command.
-
Type ExecThe type of the local shell action. Always
exec.const ExecExec Exec = "exec"
-
TimeoutMs int64Optional timeout in milliseconds for the command.
-
User stringOptional user to run the command as.
-
WorkingDirectory stringOptional working directory to run the command in.
-
-
CallID stringThe unique ID of the local shell tool call generated by the model.
-
Status stringThe status of the local shell call.
-
const ResponseInputItemLocalShellCallStatusInProgress ResponseInputItemLocalShellCallStatus = "in_progress" -
const ResponseInputItemLocalShellCallStatusCompleted ResponseInputItemLocalShellCallStatus = "completed" -
const ResponseInputItemLocalShellCallStatusIncomplete ResponseInputItemLocalShellCallStatus = "incomplete"
-
-
Type LocalShellCallThe type of the local shell call. Always
local_shell_call.const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"
-
-
type ResponseInputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
ID stringThe unique ID of the local shell tool call generated by the model.
-
Output stringA JSON string of the output of the local shell tool call.
-
Type LocalShellCallOutputThe type of the local shell tool call output. Always
local_shell_call_output.const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete.-
const ResponseInputItemLocalShellCallOutputStatusInProgress ResponseInputItemLocalShellCallOutputStatus = "in_progress" -
const ResponseInputItemLocalShellCallOutputStatusCompleted ResponseInputItemLocalShellCallOutputStatus = "completed" -
const ResponseInputItemLocalShellCallOutputStatusIncomplete ResponseInputItemLocalShellCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemShellCall struct{…}A tool representing a request to execute one or more shell commands.
-
Action ResponseInputItemShellCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []stringOrdered shell commands for the execution environment to run.
-
MaxOutputLength int64Maximum number of UTF-8 characters to capture from combined stdout and stderr output.
-
TimeoutMs int64Maximum wall-clock time in milliseconds to allow the shell commands to run.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Environment ResponseInputItemShellCallEnvironmentUnionThe environment to execute the shell commands in.
-
type LocalEnvironment struct{…} -
type ContainerReference struct{…}
-
-
Status stringThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseInputItemShellCallStatusInProgress ResponseInputItemShellCallStatus = "in_progress" -
const ResponseInputItemShellCallStatusCompleted ResponseInputItemShellCallStatus = "completed" -
const ResponseInputItemShellCallStatusIncomplete ResponseInputItemShellCallStatus = "incomplete"
-
-
-
type ResponseInputItemShellCallOutput struct{…}The streamed output items emitted by a shell tool call.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Output []ResponseFunctionShellCallOutputContentCaptured chunks of stdout and stderr output, along with their associated outcomes.
-
Outcome ResponseFunctionShellCallOutputContentOutcomeUnionThe exit or timeout outcome associated with this shell call.
-
type ResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellCallOutputContentOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64The exit code returned by the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringCaptured stderr output for the shell call.
-
Stdout stringCaptured stdout output for the shell call.
-
-
Type ShellCallOutputThe type of the item. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
ID stringThe unique ID of the shell tool call output. Populated when this item is returned via API.
-
MaxOutputLength int64The maximum number of UTF-8 characters captured for this shell call's combined output.
-
Status stringThe status of the shell call output.
-
const ResponseInputItemShellCallOutputStatusInProgress ResponseInputItemShellCallOutputStatus = "in_progress" -
const ResponseInputItemShellCallOutputStatusCompleted ResponseInputItemShellCallOutputStatus = "completed" -
const ResponseInputItemShellCallOutputStatusIncomplete ResponseInputItemShellCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemApplyPatchCall struct{…}A tool call representing a request to create, delete, or update files using diff patches.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseInputItemApplyPatchCallOperationUnionThe specific create, delete, or update instruction for the apply_patch tool call.
-
type ResponseInputItemApplyPatchCallOperationCreateFile struct{…}Instruction for creating a new file via the apply_patch tool.
-
Diff stringUnified diff content to apply when creating the file.
-
Path stringPath of the file to create relative to the workspace root.
-
Type CreateFileThe operation type. Always
create_file.const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseInputItemApplyPatchCallOperationDeleteFile struct{…}Instruction for deleting an existing file via the apply_patch tool.
-
Path stringPath of the file to delete relative to the workspace root.
-
Type DeleteFileThe operation type. Always
delete_file.const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseInputItemApplyPatchCallOperationUpdateFile struct{…}Instruction for updating an existing file via the apply_patch tool.
-
Diff stringUnified diff content to apply to the existing file.
-
Path stringPath of the file to update relative to the workspace root.
-
Type UpdateFileThe operation type. Always
update_file.const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status stringThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseInputItemApplyPatchCallStatusInProgress ResponseInputItemApplyPatchCallStatus = "in_progress" -
const ResponseInputItemApplyPatchCallStatusCompleted ResponseInputItemApplyPatchCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
-
type ResponseInputItemApplyPatchCallOutput struct{…}The streamed output emitted by an apply patch tool call.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status stringThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseInputItemApplyPatchCallOutputStatusCompleted ResponseInputItemApplyPatchCallOutputStatus = "completed" -
const ResponseInputItemApplyPatchCallOutputStatusFailed ResponseInputItemApplyPatchCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
Output stringOptional human-readable log text from the apply patch tool (e.g., patch results or errors).
-
-
type ResponseInputItemMcpListTools struct{…}A list of tools available on an MCP server.
-
ID stringThe unique ID of the list.
-
ServerLabel stringThe label of the MCP server.
-
Tools []ResponseInputItemMcpListToolsToolThe tools available on the server.
-
InputSchema anyThe JSON schema describing the tool's input.
-
Name stringThe name of the tool.
-
Annotations anyAdditional annotations about the tool.
-
Description stringThe description of the tool.
-
-
Type McpListToolsThe type of the item. Always
mcp_list_tools.const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
-
Error stringError message if the server could not list tools.
-
-
type ResponseInputItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
ID stringThe unique ID of the approval request.
-
Arguments stringA JSON string of arguments for the tool.
-
Name stringThe name of the tool to run.
-
ServerLabel stringThe label of the MCP server making the request.
-
Type McpApprovalRequestThe type of the item. Always
mcp_approval_request.const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"
-
-
type ResponseInputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
ApprovalRequestID stringThe ID of the approval request being answered.
-
Approve boolWhether the request was approved.
-
Type McpApprovalResponseThe type of the item. Always
mcp_approval_response.const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
-
ID stringThe unique ID of the approval response
-
Reason stringOptional reason for the decision.
-
-
type ResponseInputItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
ID stringThe unique ID of the tool call.
-
Arguments stringA JSON string of the arguments passed to the tool.
-
Name stringThe name of the tool that was run.
-
ServerLabel stringThe label of the MCP server running the tool.
-
Type McpCallThe type of the item. Always
mcp_call.const McpCallMcpCall McpCall = "mcp_call"
-
ApprovalRequestID stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
Error stringThe error from the tool call, if any.
-
Output stringThe output from the tool call.
-
Status stringThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
const ResponseInputItemMcpCallStatusInProgress ResponseInputItemMcpCallStatus = "in_progress" -
const ResponseInputItemMcpCallStatusCompleted ResponseInputItemMcpCallStatus = "completed" -
const ResponseInputItemMcpCallStatusIncomplete ResponseInputItemMcpCallStatus = "incomplete" -
const ResponseInputItemMcpCallStatusCalling ResponseInputItemMcpCallStatus = "calling" -
const ResponseInputItemMcpCallStatusFailed ResponseInputItemMcpCallStatus = "failed"
-
-
-
type ResponseCustomToolCallOutput struct{…}The output of a custom tool call from your code, being sent back to the model.
-
CallID stringThe call ID, used to map this custom tool call output to a custom tool call.
-
Output ResponseCustomToolCallOutputOutputUnionThe output from the custom tool call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseCustomToolCallOutputOutputOutputContentList []ResponseCustomToolCallOutputOutputOutputContentListItemUnionText, image, or file output of the custom tool call.
-
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
-
Type CustomToolCallOutputThe type of the custom tool call output. Always
custom_tool_call_output.const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"
-
ID stringThe unique ID of the custom tool call output in the OpenAI platform.
-
-
type ResponseCustomToolCall struct{…}A call to a custom tool created by the model.
-
CallID stringAn identifier used to map this custom tool call to a tool call output.
-
Input stringThe input for the custom tool call generated by the model.
-
Name stringThe name of the custom tool being called.
-
Type CustomToolCallThe type of the custom tool call. Always
custom_tool_call.const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"
-
ID stringThe unique ID of the custom tool call in the OpenAI platform.
-
Namespace stringThe namespace of the custom tool being called.
-
-
type ResponseInputItemCompactionTrigger struct{…}Compacts the current context. Must be the final input item.
-
Type CompactionTriggerThe type of the item. Always
compaction_trigger.const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"
-
-
type ResponseInputItemItemReference struct{…}An internal identifier for an item to reference.
-
ID stringThe ID of the item to reference.
-
Type stringThe type of item to reference. Always
item_reference.const ResponseInputItemItemReferenceTypeItemReference ResponseInputItemItemReferenceType = "item_reference"
-
-
-
-
Instructions param.Field[string]A system (or developer) message inserted into the model's context. When used along with
previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses. -
PreviousResponseID param.Field[string]The unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about conversation state. Cannot be used in conjunction with
conversation. -
PromptCacheKey param.Field[string]A key to use when reading from or writing to the prompt cache.
-
PromptCacheRetention param.Field[ResponseCompactParamsPromptCacheRetention]How long to retain a prompt cache entry created by this request.
-
const ResponseCompactParamsPromptCacheRetentionInMemory ResponseCompactParamsPromptCacheRetention = "in_memory" -
const ResponseCompactParamsPromptCacheRetention24h ResponseCompactParamsPromptCacheRetention = "24h"
-
-
ServiceTier param.Field[ResponseCompactParamsServiceTier]The service tier to use for this request.
-
const ResponseCompactParamsServiceTierAuto ResponseCompactParamsServiceTier = "auto" -
const ResponseCompactParamsServiceTierDefault ResponseCompactParamsServiceTier = "default" -
const ResponseCompactParamsServiceTierFlex ResponseCompactParamsServiceTier = "flex" -
const ResponseCompactParamsServiceTierPriority ResponseCompactParamsServiceTier = "priority"
-
-
Returns
-
type CompactedResponse struct{…}-
ID stringThe unique identifier for the compacted response.
-
CreatedAt int64Unix timestamp (in seconds) when the compacted conversation was created.
-
Object ResponseCompactionThe object type. Always
response.compaction.const ResponseCompactionResponseCompaction ResponseCompaction = "response.compaction"
-
Output []ResponseOutputItemUnionThe compacted list of output items. This is a list of all user messages, followed by a single compaction item.
-
type ResponseOutputMessage struct{…}An output message from the model.
-
ID stringThe unique ID of the output message.
-
Content []ResponseOutputMessageContentUnionThe content of the output message.
-
type ResponseOutputText struct{…}A text output from the model.
-
Annotations []ResponseOutputTextAnnotationUnionThe annotations of the text output.
-
type ResponseOutputTextAnnotationFileCitation struct{…}A citation to a file.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the file cited.
-
Index int64The index of the file in the list of files.
-
Type FileCitationThe type of the file citation. Always
file_citation.const FileCitationFileCitation FileCitation = "file_citation"
-
-
type ResponseOutputTextAnnotationURLCitation struct{…}A citation for a web resource used to generate a model response.
-
EndIndex int64The index of the last character of the URL citation in the message.
-
StartIndex int64The index of the first character of the URL citation in the message.
-
Title stringThe title of the web resource.
-
Type URLCitationThe type of the URL citation. Always
url_citation.const URLCitationURLCitation URLCitation = "url_citation"
-
URL stringThe URL of the web resource.
-
-
type ResponseOutputTextAnnotationContainerFileCitation struct{…}A citation for a container file used to generate a model response.
-
ContainerID stringThe ID of the container file.
-
EndIndex int64The index of the last character of the container file citation in the message.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the container file cited.
-
StartIndex int64The index of the first character of the container file citation in the message.
-
Type ContainerFileCitationThe type of the container file citation. Always
container_file_citation.const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"
-
-
type ResponseOutputTextAnnotationFilePath struct{…}A path to a file.
-
FileID stringThe ID of the file.
-
Index int64The index of the file in the list of files.
-
Type FilePathThe type of the file path. Always
file_path.const FilePathFilePath FilePath = "file_path"
-
-
-
Text stringThe text output from the model.
-
Type OutputTextThe type of the output text. Always
output_text.const OutputTextOutputText OutputText = "output_text"
-
Logprobs []ResponseOutputTextLogprob-
Token string -
Bytes []int64 -
Logprob float64 -
TopLogprobs []ResponseOutputTextLogprobTopLogprob-
Token string -
Bytes []int64 -
Logprob float64
-
-
-
-
type ResponseOutputRefusal struct{…}A refusal from the model.
-
Refusal stringThe refusal explanation from the model.
-
Type RefusalThe type of the refusal. Always
refusal.const RefusalRefusal Refusal = "refusal"
-
-
-
Role AssistantThe role of the output message. Always
assistant.const AssistantAssistant Assistant = "assistant"
-
Status ResponseOutputMessageStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseOutputMessageStatusInProgress ResponseOutputMessageStatus = "in_progress" -
const ResponseOutputMessageStatusCompleted ResponseOutputMessageStatus = "completed" -
const ResponseOutputMessageStatusIncomplete ResponseOutputMessageStatus = "incomplete"
-
-
Type MessageThe type of the output message. Always
message.const MessageMessage Message = "message"
-
Phase ResponseOutputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const ResponseOutputMessagePhaseCommentary ResponseOutputMessagePhase = "commentary" -
const ResponseOutputMessagePhaseFinalAnswer ResponseOutputMessagePhase = "final_answer"
-
-
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
ID stringThe unique ID of the file search tool call.
-
Queries []stringThe queries used to search for files.
-
Status ResponseFileSearchToolCallStatusThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
const ResponseFileSearchToolCallStatusInProgress ResponseFileSearchToolCallStatus = "in_progress" -
const ResponseFileSearchToolCallStatusSearching ResponseFileSearchToolCallStatus = "searching" -
const ResponseFileSearchToolCallStatusCompleted ResponseFileSearchToolCallStatus = "completed" -
const ResponseFileSearchToolCallStatusIncomplete ResponseFileSearchToolCallStatus = "incomplete" -
const ResponseFileSearchToolCallStatusFailed ResponseFileSearchToolCallStatus = "failed"
-
-
Type FileSearchCallThe type of the file search tool call. Always
file_search_call.const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"
-
Results []ResponseFileSearchToolCallResultThe results of the file search tool call.
-
Attributes map[string, ResponseFileSearchToolCallResultAttributeUnion]Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.
-
string -
float64 -
bool
-
-
FileID stringThe unique ID of the file.
-
Filename stringThe name of the file.
-
Score float64The relevance score of the file - a value between 0 and 1.
-
Text stringThe text that was retrieved from the file.
-
-
-
type ResponseFunctionToolCall struct{…}A tool call to run a function. See the function calling guide for more information.
-
Arguments stringA JSON string of the arguments to pass to the function.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Name stringThe name of the function to run.
-
Type FunctionCallThe type of the function tool call. Always
function_call.const FunctionCallFunctionCall FunctionCall = "function_call"
-
ID stringThe unique ID of the function tool call.
-
Namespace stringThe namespace of the function to run.
-
Status ResponseFunctionToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallStatusInProgress ResponseFunctionToolCallStatus = "in_progress" -
const ResponseFunctionToolCallStatusCompleted ResponseFunctionToolCallStatus = "completed" -
const ResponseFunctionToolCallStatusIncomplete ResponseFunctionToolCallStatus = "incomplete"
-
-
-
type ResponseFunctionToolCallOutputItem struct{…}-
ID stringThe unique ID of the function call tool output.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseFunctionToolCallOutputItemOutputUnionThe output from the function call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseFunctionToolCallOutputItemOutputOutputContentList []ResponseFunctionToolCallOutputItemOutputOutputContentListItemUnionText, image, or file output of the function call.
-
type ResponseInputText struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
Detail ResponseInputImageDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageDetailLow ResponseInputImageDetail = "low" -
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high" -
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto" -
const ResponseInputImageDetailOriginal ResponseInputImageDetail = "original"
-
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFile struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileDetailLow ResponseInputFileDetail = "low" -
const ResponseInputFileDetailHigh ResponseInputFileDetail = "high"
-
-
FileData stringThe content of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Status ResponseFunctionToolCallOutputItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallOutputItemStatusInProgress ResponseFunctionToolCallOutputItemStatus = "in_progress" -
const ResponseFunctionToolCallOutputItemStatusCompleted ResponseFunctionToolCallOutputItemStatus = "completed" -
const ResponseFunctionToolCallOutputItemStatusIncomplete ResponseFunctionToolCallOutputItemStatus = "incomplete"
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
ID stringThe unique ID of the web search tool call.
-
Action ResponseFunctionWebSearchActionUnionAn object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
type ResponseFunctionWebSearchActionSearch struct{…}Action type "search" - Performs a web search query.
-
Type SearchThe action type.
const SearchSearch Search = "search"
-
Queries []stringThe search queries.
-
Query stringThe search query.
-
Sources []ResponseFunctionWebSearchActionSearchSourceThe sources used in the search.
-
Type URLThe type of source. Always
url.const URLURL URL = "url"
-
URL stringThe URL of the source.
-
-
-
type ResponseFunctionWebSearchActionOpenPage struct{…}Action type "open_page" - Opens a specific URL from search results.
-
Type OpenPageThe action type.
const OpenPageOpenPage OpenPage = "open_page"
-
URL stringThe URL opened by the model.
-
-
type ResponseFunctionWebSearchActionFindInPage struct{…}Action type "find_in_page": Searches for a pattern within a loaded page.
-
Pattern stringThe pattern or text to search for within the page.
-
Type FindInPageThe action type.
const FindInPageFindInPage FindInPage = "find_in_page"
-
URL stringThe URL of the page searched for the pattern.
-
-
-
Status ResponseFunctionWebSearchStatusThe status of the web search tool call.
-
const ResponseFunctionWebSearchStatusInProgress ResponseFunctionWebSearchStatus = "in_progress" -
const ResponseFunctionWebSearchStatusSearching ResponseFunctionWebSearchStatus = "searching" -
const ResponseFunctionWebSearchStatusCompleted ResponseFunctionWebSearchStatus = "completed" -
const ResponseFunctionWebSearchStatusFailed ResponseFunctionWebSearchStatus = "failed"
-
-
Type WebSearchCallThe type of the web search tool call. Always
web_search_call.const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"
-
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
ID stringThe unique ID of the computer call.
-
CallID stringAn identifier used when responding to the tool call with output.
-
PendingSafetyChecks []ResponseComputerToolCallPendingSafetyCheckThe pending safety checks for the computer call.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status ResponseComputerToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseComputerToolCallStatusInProgress ResponseComputerToolCallStatus = "in_progress" -
const ResponseComputerToolCallStatusCompleted ResponseComputerToolCallStatus = "completed" -
const ResponseComputerToolCallStatusIncomplete ResponseComputerToolCallStatus = "incomplete"
-
-
Type ResponseComputerToolCallTypeThe type of the computer call. Always
computer_call.const ResponseComputerToolCallTypeComputerCall ResponseComputerToolCallType = "computer_call"
-
Action ResponseComputerToolCallActionUnionA click action.
-
type ResponseComputerToolCallActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ResponseComputerToolCallActionClickButtonLeft ResponseComputerToolCallActionClickButton = "left" -
const ResponseComputerToolCallActionClickButtonRight ResponseComputerToolCallActionClickButton = "right" -
const ResponseComputerToolCallActionClickButtonWheel ResponseComputerToolCallActionClickButton = "wheel" -
const ResponseComputerToolCallActionClickButtonBack ResponseComputerToolCallActionClickButton = "back" -
const ResponseComputerToolCallActionClickButtonForward ResponseComputerToolCallActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ResponseComputerToolCallActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ResponseComputerToolCallActionDrag struct{…}A drag action.
-
Path []ResponseComputerToolCallActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ResponseComputerToolCallActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ResponseComputerToolCallActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ResponseComputerToolCallActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ResponseComputerToolCallActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ResponseComputerToolCallActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ResponseComputerToolCallActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
Actions ComputerActionListFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
type ComputerActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ComputerActionClickButtonLeft ComputerActionClickButton = "left" -
const ComputerActionClickButtonRight ComputerActionClickButton = "right" -
const ComputerActionClickButtonWheel ComputerActionClickButton = "wheel" -
const ComputerActionClickButtonBack ComputerActionClickButton = "back" -
const ComputerActionClickButtonForward ComputerActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ComputerActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ComputerActionDrag struct{…}A drag action.
-
Path []ComputerActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ComputerActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ComputerActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ComputerActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ComputerActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ComputerActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ComputerActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
-
type ResponseComputerToolCallOutputItem struct{…}-
ID stringThe unique ID of the computer call tool output.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Type ComputerScreenshotSpecifies the event type. For a computer screenshot, this property is always set to
computer_screenshot.const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"
-
FileID stringThe identifier of an uploaded file that contains the screenshot.
-
ImageURL stringThe URL of the screenshot image.
-
-
Status ResponseComputerToolCallOutputItemStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseComputerToolCallOutputItemStatusCompleted ResponseComputerToolCallOutputItemStatus = "completed" -
const ResponseComputerToolCallOutputItemStatusIncomplete ResponseComputerToolCallOutputItemStatus = "incomplete" -
const ResponseComputerToolCallOutputItemStatusFailed ResponseComputerToolCallOutputItemStatus = "failed" -
const ResponseComputerToolCallOutputItemStatusInProgress ResponseComputerToolCallOutputItemStatus = "in_progress"
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
AcknowledgedSafetyChecks []ResponseComputerToolCallOutputItemAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
ID stringThe unique identifier of the reasoning content.
-
Summary []ResponseReasoningItemSummaryReasoning summary content.
-
Text stringA summary of the reasoning output from the model so far.
-
Type SummaryTextThe type of the object. Always
summary_text.const SummaryTextSummaryText SummaryText = "summary_text"
-
-
Type ReasoningThe type of the object. Always
reasoning.const ReasoningReasoning Reasoning = "reasoning"
-
Content []ResponseReasoningItemContentReasoning text content.
-
Text stringThe reasoning text from the model.
-
Type ReasoningTextThe type of the reasoning text. Always
reasoning_text.const ReasoningTextReasoningText ReasoningText = "reasoning_text"
-
-
EncryptedContent stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
Status ResponseReasoningItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseReasoningItemStatusInProgress ResponseReasoningItemStatus = "in_progress" -
const ResponseReasoningItemStatusCompleted ResponseReasoningItemStatus = "completed" -
const ResponseReasoningItemStatusIncomplete ResponseReasoningItemStatus = "incomplete"
-
-
-
type ResponseToolSearchCall struct{…}-
ID stringThe unique ID of the tool search call item.
-
Arguments anyArguments used for the tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchCallExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchCallExecutionServer ResponseToolSearchCallExecution = "server" -
const ResponseToolSearchCallExecutionClient ResponseToolSearchCallExecution = "client"
-
-
Status ResponseToolSearchCallStatusThe status of the tool search call item that was recorded.
-
const ResponseToolSearchCallStatusInProgress ResponseToolSearchCallStatus = "in_progress" -
const ResponseToolSearchCallStatusCompleted ResponseToolSearchCallStatus = "completed" -
const ResponseToolSearchCallStatusIncomplete ResponseToolSearchCallStatus = "incomplete"
-
-
Type ToolSearchCallThe type of the item. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseToolSearchOutputItem struct{…}-
ID stringThe unique ID of the tool search output item.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemExecutionServer ResponseToolSearchOutputItemExecution = "server" -
const ResponseToolSearchOutputItemExecutionClient ResponseToolSearchOutputItemExecution = "client"
-
-
Status ResponseToolSearchOutputItemStatusThe status of the tool search output item that was recorded.
-
const ResponseToolSearchOutputItemStatusInProgress ResponseToolSearchOutputItemStatus = "in_progress" -
const ResponseToolSearchOutputItemStatusCompleted ResponseToolSearchOutputItemStatus = "completed" -
const ResponseToolSearchOutputItemStatusIncomplete ResponseToolSearchOutputItemStatus = "incomplete"
-
-
Tools []ToolUnionThe loaded tool definitions returned by tool search.
-
type FunctionTool struct{…}Defines a function in your own code the model can choose to call. Learn more about function calling.
-
Name stringThe name of the function to call.
-
Parameters map[string, any]A JSON schema object describing the parameters of the function.
-
Strict boolWhether to enforce strict parameter validation. Default
true. -
Type FunctionThe type of the function tool. Always
function.const FunctionFunction Function = "function"
-
DeferLoading boolWhether this function is deferred and loaded via tool search.
-
Description stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
type FileSearchTool struct{…}A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
Type FileSearchThe type of the file search tool. Always
file_search.const FileSearchFileSearch FileSearch = "file_search"
-
VectorStoreIDs []stringThe IDs of the vector stores to search.
-
Filters FileSearchToolFiltersUnionA filter to apply.
-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
Key stringThe key to compare against the value.
-
Type ComparisonFilterTypeSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
const ComparisonFilterTypeEq ComparisonFilterType = "eq" -
const ComparisonFilterTypeNe ComparisonFilterType = "ne" -
const ComparisonFilterTypeGt ComparisonFilterType = "gt" -
const ComparisonFilterTypeGte ComparisonFilterType = "gte" -
const ComparisonFilterTypeLt ComparisonFilterType = "lt" -
const ComparisonFilterTypeLte ComparisonFilterType = "lte" -
const ComparisonFilterTypeIn ComparisonFilterType = "in" -
const ComparisonFilterTypeNin ComparisonFilterType = "nin"
-
-
Value ComparisonFilterValueUnionThe value to compare against the attribute key; supports string, number, or boolean types.
-
string -
float64 -
bool -
type ComparisonFilterValueArray []ComparisonFilterValueArrayItemUnion-
string -
float64
-
-
-
-
type CompoundFilter struct{…}Combine multiple filters using
andoror.-
Filters []ComparisonFilterArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
-
Type CompoundFilterTypeType of operation:
andoror.-
const CompoundFilterTypeAnd CompoundFilterType = "and" -
const CompoundFilterTypeOr CompoundFilterType = "or"
-
-
-
-
MaxNumResults int64The maximum number of results to return. This number should be between 1 and 50 inclusive.
-
RankingOptions FileSearchToolRankingOptionsRanking options for search.
-
HybridSearch FileSearchToolRankingOptionsHybridSearchWeights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
EmbeddingWeight float64The weight of the embedding in the reciprocal ranking fusion.
-
TextWeight float64The weight of the text in the reciprocal ranking fusion.
-
-
Ranker stringThe ranker to use for the file search.
-
const FileSearchToolRankingOptionsRankerAuto FileSearchToolRankingOptionsRanker = "auto" -
const FileSearchToolRankingOptionsRankerDefault2024_11_15 FileSearchToolRankingOptionsRanker = "default-2024-11-15"
-
-
ScoreThreshold float64The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
Type ComputerThe type of the computer tool. Always
computer.const ComputerComputer Computer = "computer"
-
-
type ComputerUsePreviewTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
DisplayHeight int64The height of the computer display.
-
DisplayWidth int64The width of the computer display.
-
Environment ComputerUsePreviewToolEnvironmentThe type of computer environment to control.
-
const ComputerUsePreviewToolEnvironmentWindows ComputerUsePreviewToolEnvironment = "windows" -
const ComputerUsePreviewToolEnvironmentMac ComputerUsePreviewToolEnvironment = "mac" -
const ComputerUsePreviewToolEnvironmentLinux ComputerUsePreviewToolEnvironment = "linux" -
const ComputerUsePreviewToolEnvironmentUbuntu ComputerUsePreviewToolEnvironment = "ubuntu" -
const ComputerUsePreviewToolEnvironmentBrowser ComputerUsePreviewToolEnvironment = "browser"
-
-
Type ComputerUsePreviewThe type of the computer use tool. Always
computer_use_preview.const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"
-
-
type WebSearchTool struct{…}Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
Type WebSearchToolTypeThe type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
const WebSearchToolTypeWebSearch WebSearchToolType = "web_search" -
const WebSearchToolTypeWebSearch2025_08_26 WebSearchToolType = "web_search_2025_08_26"
-
-
Filters WebSearchToolFiltersFilters for the search.
-
AllowedDomains []stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
SearchContextSize WebSearchToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchToolSearchContextSizeLow WebSearchToolSearchContextSize = "low" -
const WebSearchToolSearchContextSizeMedium WebSearchToolSearchContextSize = "medium" -
const WebSearchToolSearchContextSizeHigh WebSearchToolSearchContextSize = "high"
-
-
UserLocation WebSearchToolUserLocationThe approximate location of the user.
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
Type stringThe type of location approximation. Always
approximate.const WebSearchToolUserLocationTypeApproximate WebSearchToolUserLocationType = "approximate"
-
-
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
ServerLabel stringA label for this MCP server, used to identify it in tool calls.
-
Type McpThe type of the MCP tool. Always
mcp.const McpMcp Mcp = "mcp"
-
AllowedTools ToolMcpAllowedToolsUnionList of allowed tool names or a filter object.
-
type ToolMcpAllowedToolsMcpAllowedTools []stringA string array of allowed tool names
-
type ToolMcpAllowedToolsMcpToolFilter struct{…}A filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
Authorization stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
ConnectorID stringIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
const ToolMcpConnectorIDConnectorDropbox ToolMcpConnectorID = "connector_dropbox" -
const ToolMcpConnectorIDConnectorGmail ToolMcpConnectorID = "connector_gmail" -
const ToolMcpConnectorIDConnectorGooglecalendar ToolMcpConnectorID = "connector_googlecalendar" -
const ToolMcpConnectorIDConnectorGoogledrive ToolMcpConnectorID = "connector_googledrive" -
const ToolMcpConnectorIDConnectorMicrosoftteams ToolMcpConnectorID = "connector_microsoftteams" -
const ToolMcpConnectorIDConnectorOutlookcalendar ToolMcpConnectorID = "connector_outlookcalendar" -
const ToolMcpConnectorIDConnectorOutlookemail ToolMcpConnectorID = "connector_outlookemail" -
const ToolMcpConnectorIDConnectorSharepoint ToolMcpConnectorID = "connector_sharepoint"
-
-
DeferLoading boolWhether this MCP tool is deferred and discovered via tool search.
-
Headers map[string, string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
RequireApproval ToolMcpRequireApprovalUnionSpecify which of the MCP server's tools require approval.
-
type ToolMcpRequireApprovalMcpToolApprovalFilter 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.-
Always ToolMcpRequireApprovalMcpToolApprovalFilterAlwaysA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
Never ToolMcpRequireApprovalMcpToolApprovalFilterNeverA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
type ToolMcpRequireApprovalMcpToolApprovalSetting stringSpecify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
const ToolMcpRequireApprovalMcpToolApprovalSettingAlways ToolMcpRequireApprovalMcpToolApprovalSetting = "always" -
const ToolMcpRequireApprovalMcpToolApprovalSettingNever ToolMcpRequireApprovalMcpToolApprovalSetting = "never"
-
-
-
ServerDescription stringOptional description of the MCP server, used to provide more context.
-
ServerURL stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
TunnelID stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
Container ToolCodeInterpreterContainerUnionThe code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
string -
type ToolCodeInterpreterContainerCodeInterpreterContainerAuto struct{…}Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
Type AutoAlways
auto.const AutoAuto Auto = "auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit stringThe memory limit for the code interpreter container.
-
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"
-
-
NetworkPolicy ToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…}-
Type DisabledDisable outbound network access. Always
disabled.const DisabledDisabled Disabled = "disabled"
-
-
type ContainerNetworkPolicyAllowlist struct{…}-
AllowedDomains []stringA list of allowed domains when type is
allowlist. -
Type AllowlistAllow outbound network access only to specified domains. Always
allowlist.const AllowlistAllowlist Allowlist = "allowlist"
-
DomainSecrets []ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
Domain stringThe domain associated with the secret.
-
Name stringThe name of the secret to inject for the domain.
-
Value stringThe secret value to inject for the domain.
-
-
-
-
-
-
Type CodeInterpreterThe type of the code interpreter tool. Always
code_interpreter.const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"
-
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
Type ImageGenerationThe type of the image generation tool. Always
image_generation.const ImageGenerationImageGeneration ImageGeneration = "image_generation"
-
Action stringWhether to generate a new image or edit an existing image. Default:
auto.-
const ToolImageGenerationActionGenerate ToolImageGenerationAction = "generate" -
const ToolImageGenerationActionEdit ToolImageGenerationAction = "edit" -
const ToolImageGenerationActionAuto ToolImageGenerationAction = "auto"
-
-
Background stringAllows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
const ToolImageGenerationBackgroundTransparent ToolImageGenerationBackground = "transparent" -
const ToolImageGenerationBackgroundOpaque ToolImageGenerationBackground = "opaque" -
const ToolImageGenerationBackgroundAuto ToolImageGenerationBackground = "auto"
-
-
InputFidelity stringControl how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
const ToolImageGenerationInputFidelityHigh ToolImageGenerationInputFidelity = "high" -
const ToolImageGenerationInputFidelityLow ToolImageGenerationInputFidelity = "low"
-
-
InputImageMask ToolImageGenerationInputImageMaskOptional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
FileID stringFile ID for the mask image.
-
ImageURL stringBase64-encoded mask image.
-
-
Model stringThe image generation model to use. Default:
gpt-image-1.-
string -
string-
const ToolImageGenerationModelGPTImage1 ToolImageGenerationModel = "gpt-image-1" -
const ToolImageGenerationModelGPTImage1Mini ToolImageGenerationModel = "gpt-image-1-mini" -
const ToolImageGenerationModelGPTImage2 ToolImageGenerationModel = "gpt-image-2" -
const ToolImageGenerationModelGPTImage2_2026_04_21 ToolImageGenerationModel = "gpt-image-2-2026-04-21" -
const ToolImageGenerationModelGPTImage1_5 ToolImageGenerationModel = "gpt-image-1.5" -
const ToolImageGenerationModelChatgptImageLatest ToolImageGenerationModel = "chatgpt-image-latest"
-
-
-
Moderation stringModeration level for the generated image. Default:
auto.-
const ToolImageGenerationModerationAuto ToolImageGenerationModeration = "auto" -
const ToolImageGenerationModerationLow ToolImageGenerationModeration = "low"
-
-
OutputCompression int64Compression level for the output image. Default: 100.
-
OutputFormat stringThe output format of the generated image. One of
png,webp, orjpeg. Default:png.-
const ToolImageGenerationOutputFormatPNG ToolImageGenerationOutputFormat = "png" -
const ToolImageGenerationOutputFormatWebP ToolImageGenerationOutputFormat = "webp" -
const ToolImageGenerationOutputFormatJPEG ToolImageGenerationOutputFormat = "jpeg"
-
-
PartialImages int64Number of partial images to generate in streaming mode, from 0 (default value) to 3.
-
Quality stringThe quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
const ToolImageGenerationQualityLow ToolImageGenerationQuality = "low" -
const ToolImageGenerationQualityMedium ToolImageGenerationQuality = "medium" -
const ToolImageGenerationQualityHigh ToolImageGenerationQuality = "high" -
const ToolImageGenerationQualityAuto ToolImageGenerationQuality = "auto"
-
-
Size stringThe size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
string -
string-
const ToolImageGenerationSize1024x1024 ToolImageGenerationSize = "1024x1024" -
const ToolImageGenerationSize1024x1536 ToolImageGenerationSize = "1024x1536" -
const ToolImageGenerationSize1536x1024 ToolImageGenerationSize = "1536x1024" -
const ToolImageGenerationSizeAuto ToolImageGenerationSize = "auto"
-
-
-
-
type ToolLocalShell struct{…}A tool that allows the model to execute shell commands in a local environment.
-
Type LocalShellThe type of the local shell tool. Always
local_shell.const LocalShellLocalShell LocalShell = "local_shell"
-
-
type FunctionShellTool struct{…}A tool that allows the model to execute shell commands.
-
Type ShellThe type of the shell tool. Always
shell.const ShellShell Shell = "shell"
-
Environment FunctionShellToolEnvironmentUnion-
type ContainerAuto struct{…}-
Type ContainerAutoAutomatically creates a container for this request
const ContainerAutoContainerAuto ContainerAuto = "container_auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit ContainerAutoMemoryLimitThe memory limit for the container.
-
const ContainerAutoMemoryLimit1g ContainerAutoMemoryLimit = "1g" -
const ContainerAutoMemoryLimit4g ContainerAutoMemoryLimit = "4g" -
const ContainerAutoMemoryLimit16g ContainerAutoMemoryLimit = "16g" -
const ContainerAutoMemoryLimit64g ContainerAutoMemoryLimit = "64g"
-
-
NetworkPolicy ContainerAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…} -
type ContainerNetworkPolicyAllowlist struct{…}
-
-
Skills []ContainerAutoSkillUnionAn optional list of skills referenced by id or inline data.
-
type SkillReference struct{…}-
SkillID stringThe ID of the referenced skill.
-
Type SkillReferenceReferences a skill created with the /v1/skills endpoint.
const SkillReferenceSkillReference SkillReference = "skill_reference"
-
Version stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
type InlineSkill struct{…}-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Source InlineSkillSourceInline skill payload
-
Data stringBase64-encoded skill zip bundle.
-
MediaType ApplicationZipThe media type of the inline skill payload. Must be
application/zip.const ApplicationZipApplicationZip ApplicationZip = "application/zip"
-
Type Base64The type of the inline skill source. Must be
base64.const Base64Base64 Base64 = "base64"
-
-
Type InlineDefines an inline skill for this request.
const InlineInline Inline = "inline"
-
-
-
-
type LocalEnvironment struct{…}-
Type LocalUse a local computer environment.
const LocalLocal Local = "local"
-
Skills []LocalSkillAn optional list of skills.
-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Path stringThe path to the directory containing the skill.
-
-
-
type ContainerReference struct{…}-
ContainerID stringThe ID of the referenced container.
-
Type ContainerReferenceReferences a container created with the /v1/containers endpoint
const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
Name stringThe name of the custom tool, used to identify it in tool calls.
-
Type CustomThe type of the custom tool. Always
custom.const CustomCustom Custom = "custom"
-
DeferLoading boolWhether this tool should be deferred and discovered via tool search.
-
Description stringOptional description of the custom tool, used to provide more context.
-
Format CustomToolInputFormatUnionThe input format for the custom tool. Default is unconstrained text.
-
type CustomToolInputFormatText struct{…}Unconstrained free-form text.
-
Type TextUnconstrained text format. Always
text.const TextText Text = "text"
-
-
type CustomToolInputFormatGrammar struct{…}A grammar defined by the user.
-
Definition stringThe grammar definition.
-
Syntax stringThe syntax of the grammar definition. One of
larkorregex.-
const CustomToolInputFormatGrammarSyntaxLark CustomToolInputFormatGrammarSyntax = "lark" -
const CustomToolInputFormatGrammarSyntaxRegex CustomToolInputFormatGrammarSyntax = "regex"
-
-
Type GrammarGrammar format. Always
grammar.const GrammarGrammar Grammar = "grammar"
-
-
-
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
Description stringA description of the namespace shown to the model.
-
Name stringThe namespace name used in tool calls (for example,
crm). -
Tools []NamespaceToolToolUnionThe function/custom tools available inside this namespace.
-
type NamespaceToolToolFunction struct{…}-
Name string -
Type Functionconst FunctionFunction Function = "function"
-
DeferLoading boolWhether this function should be deferred and discovered via tool search.
-
Description string -
Parameters any -
Strict bool
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
-
Type NamespaceThe type of the tool. Always
namespace.const NamespaceNamespace Namespace = "namespace"
-
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
Type ToolSearchThe type of the tool. Always
tool_search.const ToolSearchToolSearch ToolSearch = "tool_search"
-
Description stringDescription shown to the model for a client-executed tool search tool.
-
Execution ToolSearchToolExecutionWhether tool search is executed by the server or by the client.
-
const ToolSearchToolExecutionServer ToolSearchToolExecution = "server" -
const ToolSearchToolExecutionClient ToolSearchToolExecution = "client"
-
-
Parameters anyParameter schema for a client-executed tool search tool.
-
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
Type WebSearchPreviewToolTypeThe type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
const WebSearchPreviewToolTypeWebSearchPreview WebSearchPreviewToolType = "web_search_preview" -
const WebSearchPreviewToolTypeWebSearchPreview2025_03_11 WebSearchPreviewToolType = "web_search_preview_2025_03_11"
-
-
SearchContentTypes []string-
const WebSearchPreviewToolSearchContentTypeText WebSearchPreviewToolSearchContentType = "text" -
const WebSearchPreviewToolSearchContentTypeImage WebSearchPreviewToolSearchContentType = "image"
-
-
SearchContextSize WebSearchPreviewToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchPreviewToolSearchContextSizeLow WebSearchPreviewToolSearchContextSize = "low" -
const WebSearchPreviewToolSearchContextSizeMedium WebSearchPreviewToolSearchContextSize = "medium" -
const WebSearchPreviewToolSearchContextSizeHigh WebSearchPreviewToolSearchContextSize = "high"
-
-
UserLocation WebSearchPreviewToolUserLocationThe user's location.
-
Type ApproximateThe type of location approximation. Always
approximate.const ApproximateApproximate Approximate = "approximate"
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
Type ApplyPatchThe type of the tool. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
-
Type ToolSearchOutputThe type of the item. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseOutputItemAdditionalTools struct{…}-
ID stringThe unique ID of the additional tools item.
-
Role stringThe role that provided the additional tools.
-
const ResponseOutputItemAdditionalToolsRoleUnknown ResponseOutputItemAdditionalToolsRole = "unknown" -
const ResponseOutputItemAdditionalToolsRoleUser ResponseOutputItemAdditionalToolsRole = "user" -
const ResponseOutputItemAdditionalToolsRoleAssistant ResponseOutputItemAdditionalToolsRole = "assistant" -
const ResponseOutputItemAdditionalToolsRoleSystem ResponseOutputItemAdditionalToolsRole = "system" -
const ResponseOutputItemAdditionalToolsRoleCritic ResponseOutputItemAdditionalToolsRole = "critic" -
const ResponseOutputItemAdditionalToolsRoleDiscriminator ResponseOutputItemAdditionalToolsRole = "discriminator" -
const ResponseOutputItemAdditionalToolsRoleDeveloper ResponseOutputItemAdditionalToolsRole = "developer" -
const ResponseOutputItemAdditionalToolsRoleTool ResponseOutputItemAdditionalToolsRole = "tool"
-
-
Tools []ToolUnionThe additional tool definitions made available at this item.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type AdditionalToolsThe type of the item. Always
additional_tools.const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"
-
-
type ResponseCompactionItem struct{…}A compaction item generated by the
v1/responses/compactAPI.-
ID stringThe unique ID of the compaction item.
-
EncryptedContent stringThe encrypted content that was produced by compaction.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseOutputItemImageGenerationCall struct{…}An image generation request made by the model.
-
ID stringThe unique ID of the image generation call.
-
Result stringThe generated image encoded in base64.
-
Status stringThe status of the image generation call.
-
const ResponseOutputItemImageGenerationCallStatusInProgress ResponseOutputItemImageGenerationCallStatus = "in_progress" -
const ResponseOutputItemImageGenerationCallStatusCompleted ResponseOutputItemImageGenerationCallStatus = "completed" -
const ResponseOutputItemImageGenerationCallStatusGenerating ResponseOutputItemImageGenerationCallStatus = "generating" -
const ResponseOutputItemImageGenerationCallStatusFailed ResponseOutputItemImageGenerationCallStatus = "failed"
-
-
Type ImageGenerationCallThe type of the image generation call. Always
image_generation_call.const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"
-
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
ID stringThe unique ID of the code interpreter tool call.
-
Code stringThe code to run, or null if not available.
-
ContainerID stringThe ID of the container used to run the code.
-
Outputs []ResponseCodeInterpreterToolCallOutputUnionThe outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
type ResponseCodeInterpreterToolCallOutputLogs struct{…}The logs output from the code interpreter.
-
Logs stringThe logs output from the code interpreter.
-
Type LogsThe type of the output. Always
logs.const LogsLogs Logs = "logs"
-
-
type ResponseCodeInterpreterToolCallOutputImage struct{…}The image output from the code interpreter.
-
Type ImageThe type of the output. Always
image.const ImageImage Image = "image"
-
URL stringThe URL of the image output from the code interpreter.
-
-
-
Status ResponseCodeInterpreterToolCallStatusThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
const ResponseCodeInterpreterToolCallStatusInProgress ResponseCodeInterpreterToolCallStatus = "in_progress" -
const ResponseCodeInterpreterToolCallStatusCompleted ResponseCodeInterpreterToolCallStatus = "completed" -
const ResponseCodeInterpreterToolCallStatusIncomplete ResponseCodeInterpreterToolCallStatus = "incomplete" -
const ResponseCodeInterpreterToolCallStatusInterpreting ResponseCodeInterpreterToolCallStatus = "interpreting" -
const ResponseCodeInterpreterToolCallStatusFailed ResponseCodeInterpreterToolCallStatus = "failed"
-
-
Type CodeInterpreterCallThe type of the code interpreter tool call. Always
code_interpreter_call.const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"
-
-
type ResponseOutputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
ID stringThe unique ID of the local shell call.
-
Action ResponseOutputItemLocalShellCallActionExecute a shell command on the server.
-
Command []stringThe command to run.
-
Env map[string, string]Environment variables to set for the command.
-
Type ExecThe type of the local shell action. Always
exec.const ExecExec Exec = "exec"
-
TimeoutMs int64Optional timeout in milliseconds for the command.
-
User stringOptional user to run the command as.
-
WorkingDirectory stringOptional working directory to run the command in.
-
-
CallID stringThe unique ID of the local shell tool call generated by the model.
-
Status stringThe status of the local shell call.
-
const ResponseOutputItemLocalShellCallStatusInProgress ResponseOutputItemLocalShellCallStatus = "in_progress" -
const ResponseOutputItemLocalShellCallStatusCompleted ResponseOutputItemLocalShellCallStatus = "completed" -
const ResponseOutputItemLocalShellCallStatusIncomplete ResponseOutputItemLocalShellCallStatus = "incomplete"
-
-
Type LocalShellCallThe type of the local shell call. Always
local_shell_call.const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"
-
-
type ResponseOutputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
ID stringThe unique ID of the local shell tool call generated by the model.
-
Output stringA JSON string of the output of the local shell tool call.
-
Type LocalShellCallOutputThe type of the local shell tool call output. Always
local_shell_call_output.const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete.-
const ResponseOutputItemLocalShellCallOutputStatusInProgress ResponseOutputItemLocalShellCallOutputStatus = "in_progress" -
const ResponseOutputItemLocalShellCallOutputStatusCompleted ResponseOutputItemLocalShellCallOutputStatus = "completed" -
const ResponseOutputItemLocalShellCallOutputStatusIncomplete ResponseOutputItemLocalShellCallOutputStatus = "incomplete"
-
-
-
type ResponseFunctionShellToolCall struct{…}A tool call that executes one or more shell commands in a managed environment.
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Action ResponseFunctionShellToolCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []string -
MaxOutputLength int64Optional maximum number of characters to return from each command.
-
TimeoutMs int64Optional timeout in milliseconds for the commands.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Environment ResponseFunctionShellToolCallEnvironmentUnionRepresents the use of a local environment to perform shell actions.
-
type ResponseLocalEnvironment struct{…}Represents the use of a local environment to perform shell actions.
-
Type LocalThe environment type. Always
local.const LocalLocal Local = "local"
-
-
type ResponseContainerReference struct{…}Represents a container created with /v1/containers.
-
ContainerID string -
Type ContainerReferenceThe environment type. Always
container_reference.const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
Status ResponseFunctionShellToolCallStatusThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallStatusInProgress ResponseFunctionShellToolCallStatus = "in_progress" -
const ResponseFunctionShellToolCallStatusCompleted ResponseFunctionShellToolCallStatus = "completed" -
const ResponseFunctionShellToolCallStatusIncomplete ResponseFunctionShellToolCallStatus = "incomplete"
-
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseFunctionShellToolCallOutput struct{…}The output of a shell tool call that was emitted.
-
ID stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
MaxOutputLength int64The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
Output []ResponseFunctionShellToolCallOutputOutputAn array of shell call output contents
-
Outcome ResponseFunctionShellToolCallOutputOutputOutcomeUnionRepresents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
type ResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64Exit code from the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringThe standard error output that was captured.
-
Stdout stringThe standard output that was captured.
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
Status ResponseFunctionShellToolCallOutputStatusThe status of the shell call output. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallOutputStatusInProgress ResponseFunctionShellToolCallOutputStatus = "in_progress" -
const ResponseFunctionShellToolCallOutputStatusCompleted ResponseFunctionShellToolCallOutputStatus = "completed" -
const ResponseFunctionShellToolCallOutputStatusIncomplete ResponseFunctionShellToolCallOutputStatus = "incomplete"
-
-
Type ShellCallOutputThe type of the shell call output. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseApplyPatchToolCall struct{…}A tool call that applies file diffs by creating, deleting, or updating files.
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseApplyPatchToolCallOperationUnionOne of the create_file, delete_file, or update_file operations applied via apply_patch.
-
type ResponseApplyPatchToolCallOperationCreateFile struct{…}Instruction describing how to create a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to create.
-
Type CreateFileCreate a new file with the provided diff.
const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseApplyPatchToolCallOperationDeleteFile struct{…}Instruction describing how to delete a file via the apply_patch tool.
-
Path stringPath of the file to delete.
-
Type DeleteFileDelete the specified file.
const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseApplyPatchToolCallOperationUpdateFile struct{…}Instruction describing how to update a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to update.
-
Type UpdateFileUpdate an existing file with the provided diff.
const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status ResponseApplyPatchToolCallStatusThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseApplyPatchToolCallStatusInProgress ResponseApplyPatchToolCallStatus = "in_progress" -
const ResponseApplyPatchToolCallStatusCompleted ResponseApplyPatchToolCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseApplyPatchToolCallOutput struct{…}The output emitted by an apply patch tool call.
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status ResponseApplyPatchToolCallOutputStatusThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseApplyPatchToolCallOutputStatusCompleted ResponseApplyPatchToolCallOutputStatus = "completed" -
const ResponseApplyPatchToolCallOutputStatusFailed ResponseApplyPatchToolCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
CreatedBy stringThe ID of the entity that created this tool call output.
-
Output stringOptional textual output returned by the apply patch tool.
-
-
type ResponseOutputItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
ID stringThe unique ID of the tool call.
-
Arguments stringA JSON string of the arguments passed to the tool.
-
Name stringThe name of the tool that was run.
-
ServerLabel stringThe label of the MCP server running the tool.
-
Type McpCallThe type of the item. Always
mcp_call.const McpCallMcpCall McpCall = "mcp_call"
-
ApprovalRequestID stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
Error stringThe error from the tool call, if any.
-
Output stringThe output from the tool call.
-
Status stringThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
const ResponseOutputItemMcpCallStatusInProgress ResponseOutputItemMcpCallStatus = "in_progress" -
const ResponseOutputItemMcpCallStatusCompleted ResponseOutputItemMcpCallStatus = "completed" -
const ResponseOutputItemMcpCallStatusIncomplete ResponseOutputItemMcpCallStatus = "incomplete" -
const ResponseOutputItemMcpCallStatusCalling ResponseOutputItemMcpCallStatus = "calling" -
const ResponseOutputItemMcpCallStatusFailed ResponseOutputItemMcpCallStatus = "failed"
-
-
-
type ResponseOutputItemMcpListTools struct{…}A list of tools available on an MCP server.
-
ID stringThe unique ID of the list.
-
ServerLabel stringThe label of the MCP server.
-
Tools []ResponseOutputItemMcpListToolsToolThe tools available on the server.
-
InputSchema anyThe JSON schema describing the tool's input.
-
Name stringThe name of the tool.
-
Annotations anyAdditional annotations about the tool.
-
Description stringThe description of the tool.
-
-
Type McpListToolsThe type of the item. Always
mcp_list_tools.const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
-
Error stringError message if the server could not list tools.
-
-
type ResponseOutputItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
ID stringThe unique ID of the approval request.
-
Arguments stringA JSON string of arguments for the tool.
-
Name stringThe name of the tool to run.
-
ServerLabel stringThe label of the MCP server making the request.
-
Type McpApprovalRequestThe type of the item. Always
mcp_approval_request.const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"
-
-
type ResponseOutputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
ID stringThe unique ID of the approval response
-
ApprovalRequestID stringThe ID of the approval request being answered.
-
Approve boolWhether the request was approved.
-
Type McpApprovalResponseThe type of the item. Always
mcp_approval_response.const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
-
Reason stringOptional reason for the decision.
-
-
type ResponseCustomToolCall struct{…}A call to a custom tool created by the model.
-
CallID stringAn identifier used to map this custom tool call to a tool call output.
-
Input stringThe input for the custom tool call generated by the model.
-
Name stringThe name of the custom tool being called.
-
Type CustomToolCallThe type of the custom tool call. Always
custom_tool_call.const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"
-
ID stringThe unique ID of the custom tool call in the OpenAI platform.
-
Namespace stringThe namespace of the custom tool being called.
-
-
type ResponseCustomToolCallOutputItem struct{…}The output of a custom tool call from your code, being sent back to the model.
-
ID stringThe unique ID of the custom tool call output item.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseCustomToolCallOutputItemStatusInProgress ResponseCustomToolCallOutputItemStatus = "in_progress" -
const ResponseCustomToolCallOutputItemStatusCompleted ResponseCustomToolCallOutputItemStatus = "completed" -
const ResponseCustomToolCallOutputItemStatusIncomplete ResponseCustomToolCallOutputItemStatus = "incomplete"
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
-
Usage ResponseUsageToken accounting for the compaction pass, including cached, reasoning, and total tokens.
-
InputTokens int64The number of input tokens.
-
InputTokensDetails ResponseUsageInputTokensDetailsA detailed breakdown of the input tokens.
-
CachedTokens int64The number of tokens that were retrieved from the cache. More on prompt caching.
-
-
OutputTokens int64The number of output tokens.
-
OutputTokensDetails ResponseUsageOutputTokensDetailsA detailed breakdown of the output tokens.
-
ReasoningTokens int64The number of reasoning tokens.
-
-
TotalTokens int64The total number of tokens used.
-
-
Example
package main
import (
"context"
"fmt"
"github.com/openai/openai-go"
"github.com/openai/openai-go/option"
"github.com/openai/openai-go/responses"
)
func main() {
client := openai.NewClient(
option.WithAPIKey("My API Key"),
)
compactedResponse, err := client.Responses.Compact(context.TODO(), responses.ResponseCompactParams{
Model: responses.ResponseCompactParamsModelGPT5_4,
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", compactedResponse.ID)
}
Response
{
"id": "id",
"created_at": 0,
"object": "response.compaction",
"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"
}
],
"usage": {
"input_tokens": 0,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 0,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 0
}
}
Domain Types
Apply Patch Tool
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
Type ApplyPatchThe type of the tool. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
Compacted Response
-
type CompactedResponse struct{…}-
ID stringThe unique identifier for the compacted response.
-
CreatedAt int64Unix timestamp (in seconds) when the compacted conversation was created.
-
Object ResponseCompactionThe object type. Always
response.compaction.const ResponseCompactionResponseCompaction ResponseCompaction = "response.compaction"
-
Output []ResponseOutputItemUnionThe compacted list of output items. This is a list of all user messages, followed by a single compaction item.
-
type ResponseOutputMessage struct{…}An output message from the model.
-
ID stringThe unique ID of the output message.
-
Content []ResponseOutputMessageContentUnionThe content of the output message.
-
type ResponseOutputText struct{…}A text output from the model.
-
Annotations []ResponseOutputTextAnnotationUnionThe annotations of the text output.
-
type ResponseOutputTextAnnotationFileCitation struct{…}A citation to a file.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the file cited.
-
Index int64The index of the file in the list of files.
-
Type FileCitationThe type of the file citation. Always
file_citation.const FileCitationFileCitation FileCitation = "file_citation"
-
-
type ResponseOutputTextAnnotationURLCitation struct{…}A citation for a web resource used to generate a model response.
-
EndIndex int64The index of the last character of the URL citation in the message.
-
StartIndex int64The index of the first character of the URL citation in the message.
-
Title stringThe title of the web resource.
-
Type URLCitationThe type of the URL citation. Always
url_citation.const URLCitationURLCitation URLCitation = "url_citation"
-
URL stringThe URL of the web resource.
-
-
type ResponseOutputTextAnnotationContainerFileCitation struct{…}A citation for a container file used to generate a model response.
-
ContainerID stringThe ID of the container file.
-
EndIndex int64The index of the last character of the container file citation in the message.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the container file cited.
-
StartIndex int64The index of the first character of the container file citation in the message.
-
Type ContainerFileCitationThe type of the container file citation. Always
container_file_citation.const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"
-
-
type ResponseOutputTextAnnotationFilePath struct{…}A path to a file.
-
FileID stringThe ID of the file.
-
Index int64The index of the file in the list of files.
-
Type FilePathThe type of the file path. Always
file_path.const FilePathFilePath FilePath = "file_path"
-
-
-
Text stringThe text output from the model.
-
Type OutputTextThe type of the output text. Always
output_text.const OutputTextOutputText OutputText = "output_text"
-
Logprobs []ResponseOutputTextLogprob-
Token string -
Bytes []int64 -
Logprob float64 -
TopLogprobs []ResponseOutputTextLogprobTopLogprob-
Token string -
Bytes []int64 -
Logprob float64
-
-
-
-
type ResponseOutputRefusal struct{…}A refusal from the model.
-
Refusal stringThe refusal explanation from the model.
-
Type RefusalThe type of the refusal. Always
refusal.const RefusalRefusal Refusal = "refusal"
-
-
-
Role AssistantThe role of the output message. Always
assistant.const AssistantAssistant Assistant = "assistant"
-
Status ResponseOutputMessageStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseOutputMessageStatusInProgress ResponseOutputMessageStatus = "in_progress" -
const ResponseOutputMessageStatusCompleted ResponseOutputMessageStatus = "completed" -
const ResponseOutputMessageStatusIncomplete ResponseOutputMessageStatus = "incomplete"
-
-
Type MessageThe type of the output message. Always
message.const MessageMessage Message = "message"
-
Phase ResponseOutputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const ResponseOutputMessagePhaseCommentary ResponseOutputMessagePhase = "commentary" -
const ResponseOutputMessagePhaseFinalAnswer ResponseOutputMessagePhase = "final_answer"
-
-
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
ID stringThe unique ID of the file search tool call.
-
Queries []stringThe queries used to search for files.
-
Status ResponseFileSearchToolCallStatusThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
const ResponseFileSearchToolCallStatusInProgress ResponseFileSearchToolCallStatus = "in_progress" -
const ResponseFileSearchToolCallStatusSearching ResponseFileSearchToolCallStatus = "searching" -
const ResponseFileSearchToolCallStatusCompleted ResponseFileSearchToolCallStatus = "completed" -
const ResponseFileSearchToolCallStatusIncomplete ResponseFileSearchToolCallStatus = "incomplete" -
const ResponseFileSearchToolCallStatusFailed ResponseFileSearchToolCallStatus = "failed"
-
-
Type FileSearchCallThe type of the file search tool call. Always
file_search_call.const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"
-
Results []ResponseFileSearchToolCallResultThe results of the file search tool call.
-
Attributes map[string, ResponseFileSearchToolCallResultAttributeUnion]Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.
-
string -
float64 -
bool
-
-
FileID stringThe unique ID of the file.
-
Filename stringThe name of the file.
-
Score float64The relevance score of the file - a value between 0 and 1.
-
Text stringThe text that was retrieved from the file.
-
-
-
type ResponseFunctionToolCall struct{…}A tool call to run a function. See the function calling guide for more information.
-
Arguments stringA JSON string of the arguments to pass to the function.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Name stringThe name of the function to run.
-
Type FunctionCallThe type of the function tool call. Always
function_call.const FunctionCallFunctionCall FunctionCall = "function_call"
-
ID stringThe unique ID of the function tool call.
-
Namespace stringThe namespace of the function to run.
-
Status ResponseFunctionToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallStatusInProgress ResponseFunctionToolCallStatus = "in_progress" -
const ResponseFunctionToolCallStatusCompleted ResponseFunctionToolCallStatus = "completed" -
const ResponseFunctionToolCallStatusIncomplete ResponseFunctionToolCallStatus = "incomplete"
-
-
-
type ResponseFunctionToolCallOutputItem struct{…}-
ID stringThe unique ID of the function call tool output.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseFunctionToolCallOutputItemOutputUnionThe output from the function call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseFunctionToolCallOutputItemOutputOutputContentList []ResponseFunctionToolCallOutputItemOutputOutputContentListItemUnionText, image, or file output of the function call.
-
type ResponseInputText struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
Detail ResponseInputImageDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageDetailLow ResponseInputImageDetail = "low" -
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high" -
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto" -
const ResponseInputImageDetailOriginal ResponseInputImageDetail = "original"
-
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFile struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileDetailLow ResponseInputFileDetail = "low" -
const ResponseInputFileDetailHigh ResponseInputFileDetail = "high"
-
-
FileData stringThe content of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Status ResponseFunctionToolCallOutputItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallOutputItemStatusInProgress ResponseFunctionToolCallOutputItemStatus = "in_progress" -
const ResponseFunctionToolCallOutputItemStatusCompleted ResponseFunctionToolCallOutputItemStatus = "completed" -
const ResponseFunctionToolCallOutputItemStatusIncomplete ResponseFunctionToolCallOutputItemStatus = "incomplete"
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
ID stringThe unique ID of the web search tool call.
-
Action ResponseFunctionWebSearchActionUnionAn object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
type ResponseFunctionWebSearchActionSearch struct{…}Action type "search" - Performs a web search query.
-
Type SearchThe action type.
const SearchSearch Search = "search"
-
Queries []stringThe search queries.
-
Query stringThe search query.
-
Sources []ResponseFunctionWebSearchActionSearchSourceThe sources used in the search.
-
Type URLThe type of source. Always
url.const URLURL URL = "url"
-
URL stringThe URL of the source.
-
-
-
type ResponseFunctionWebSearchActionOpenPage struct{…}Action type "open_page" - Opens a specific URL from search results.
-
Type OpenPageThe action type.
const OpenPageOpenPage OpenPage = "open_page"
-
URL stringThe URL opened by the model.
-
-
type ResponseFunctionWebSearchActionFindInPage struct{…}Action type "find_in_page": Searches for a pattern within a loaded page.
-
Pattern stringThe pattern or text to search for within the page.
-
Type FindInPageThe action type.
const FindInPageFindInPage FindInPage = "find_in_page"
-
URL stringThe URL of the page searched for the pattern.
-
-
-
Status ResponseFunctionWebSearchStatusThe status of the web search tool call.
-
const ResponseFunctionWebSearchStatusInProgress ResponseFunctionWebSearchStatus = "in_progress" -
const ResponseFunctionWebSearchStatusSearching ResponseFunctionWebSearchStatus = "searching" -
const ResponseFunctionWebSearchStatusCompleted ResponseFunctionWebSearchStatus = "completed" -
const ResponseFunctionWebSearchStatusFailed ResponseFunctionWebSearchStatus = "failed"
-
-
Type WebSearchCallThe type of the web search tool call. Always
web_search_call.const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"
-
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
ID stringThe unique ID of the computer call.
-
CallID stringAn identifier used when responding to the tool call with output.
-
PendingSafetyChecks []ResponseComputerToolCallPendingSafetyCheckThe pending safety checks for the computer call.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status ResponseComputerToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseComputerToolCallStatusInProgress ResponseComputerToolCallStatus = "in_progress" -
const ResponseComputerToolCallStatusCompleted ResponseComputerToolCallStatus = "completed" -
const ResponseComputerToolCallStatusIncomplete ResponseComputerToolCallStatus = "incomplete"
-
-
Type ResponseComputerToolCallTypeThe type of the computer call. Always
computer_call.const ResponseComputerToolCallTypeComputerCall ResponseComputerToolCallType = "computer_call"
-
Action ResponseComputerToolCallActionUnionA click action.
-
type ResponseComputerToolCallActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ResponseComputerToolCallActionClickButtonLeft ResponseComputerToolCallActionClickButton = "left" -
const ResponseComputerToolCallActionClickButtonRight ResponseComputerToolCallActionClickButton = "right" -
const ResponseComputerToolCallActionClickButtonWheel ResponseComputerToolCallActionClickButton = "wheel" -
const ResponseComputerToolCallActionClickButtonBack ResponseComputerToolCallActionClickButton = "back" -
const ResponseComputerToolCallActionClickButtonForward ResponseComputerToolCallActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ResponseComputerToolCallActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ResponseComputerToolCallActionDrag struct{…}A drag action.
-
Path []ResponseComputerToolCallActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ResponseComputerToolCallActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ResponseComputerToolCallActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ResponseComputerToolCallActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ResponseComputerToolCallActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ResponseComputerToolCallActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ResponseComputerToolCallActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
Actions ComputerActionListFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
type ComputerActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ComputerActionClickButtonLeft ComputerActionClickButton = "left" -
const ComputerActionClickButtonRight ComputerActionClickButton = "right" -
const ComputerActionClickButtonWheel ComputerActionClickButton = "wheel" -
const ComputerActionClickButtonBack ComputerActionClickButton = "back" -
const ComputerActionClickButtonForward ComputerActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ComputerActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ComputerActionDrag struct{…}A drag action.
-
Path []ComputerActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ComputerActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ComputerActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ComputerActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ComputerActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ComputerActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ComputerActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
-
type ResponseComputerToolCallOutputItem struct{…}-
ID stringThe unique ID of the computer call tool output.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Type ComputerScreenshotSpecifies the event type. For a computer screenshot, this property is always set to
computer_screenshot.const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"
-
FileID stringThe identifier of an uploaded file that contains the screenshot.
-
ImageURL stringThe URL of the screenshot image.
-
-
Status ResponseComputerToolCallOutputItemStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseComputerToolCallOutputItemStatusCompleted ResponseComputerToolCallOutputItemStatus = "completed" -
const ResponseComputerToolCallOutputItemStatusIncomplete ResponseComputerToolCallOutputItemStatus = "incomplete" -
const ResponseComputerToolCallOutputItemStatusFailed ResponseComputerToolCallOutputItemStatus = "failed" -
const ResponseComputerToolCallOutputItemStatusInProgress ResponseComputerToolCallOutputItemStatus = "in_progress"
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
AcknowledgedSafetyChecks []ResponseComputerToolCallOutputItemAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
ID stringThe unique identifier of the reasoning content.
-
Summary []ResponseReasoningItemSummaryReasoning summary content.
-
Text stringA summary of the reasoning output from the model so far.
-
Type SummaryTextThe type of the object. Always
summary_text.const SummaryTextSummaryText SummaryText = "summary_text"
-
-
Type ReasoningThe type of the object. Always
reasoning.const ReasoningReasoning Reasoning = "reasoning"
-
Content []ResponseReasoningItemContentReasoning text content.
-
Text stringThe reasoning text from the model.
-
Type ReasoningTextThe type of the reasoning text. Always
reasoning_text.const ReasoningTextReasoningText ReasoningText = "reasoning_text"
-
-
EncryptedContent stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
Status ResponseReasoningItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseReasoningItemStatusInProgress ResponseReasoningItemStatus = "in_progress" -
const ResponseReasoningItemStatusCompleted ResponseReasoningItemStatus = "completed" -
const ResponseReasoningItemStatusIncomplete ResponseReasoningItemStatus = "incomplete"
-
-
-
type ResponseToolSearchCall struct{…}-
ID stringThe unique ID of the tool search call item.
-
Arguments anyArguments used for the tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchCallExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchCallExecutionServer ResponseToolSearchCallExecution = "server" -
const ResponseToolSearchCallExecutionClient ResponseToolSearchCallExecution = "client"
-
-
Status ResponseToolSearchCallStatusThe status of the tool search call item that was recorded.
-
const ResponseToolSearchCallStatusInProgress ResponseToolSearchCallStatus = "in_progress" -
const ResponseToolSearchCallStatusCompleted ResponseToolSearchCallStatus = "completed" -
const ResponseToolSearchCallStatusIncomplete ResponseToolSearchCallStatus = "incomplete"
-
-
Type ToolSearchCallThe type of the item. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseToolSearchOutputItem struct{…}-
ID stringThe unique ID of the tool search output item.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemExecutionServer ResponseToolSearchOutputItemExecution = "server" -
const ResponseToolSearchOutputItemExecutionClient ResponseToolSearchOutputItemExecution = "client"
-
-
Status ResponseToolSearchOutputItemStatusThe status of the tool search output item that was recorded.
-
const ResponseToolSearchOutputItemStatusInProgress ResponseToolSearchOutputItemStatus = "in_progress" -
const ResponseToolSearchOutputItemStatusCompleted ResponseToolSearchOutputItemStatus = "completed" -
const ResponseToolSearchOutputItemStatusIncomplete ResponseToolSearchOutputItemStatus = "incomplete"
-
-
Tools []ToolUnionThe loaded tool definitions returned by tool search.
-
type FunctionTool struct{…}Defines a function in your own code the model can choose to call. Learn more about function calling.
-
Name stringThe name of the function to call.
-
Parameters map[string, any]A JSON schema object describing the parameters of the function.
-
Strict boolWhether to enforce strict parameter validation. Default
true. -
Type FunctionThe type of the function tool. Always
function.const FunctionFunction Function = "function"
-
DeferLoading boolWhether this function is deferred and loaded via tool search.
-
Description stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
type FileSearchTool struct{…}A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
Type FileSearchThe type of the file search tool. Always
file_search.const FileSearchFileSearch FileSearch = "file_search"
-
VectorStoreIDs []stringThe IDs of the vector stores to search.
-
Filters FileSearchToolFiltersUnionA filter to apply.
-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
Key stringThe key to compare against the value.
-
Type ComparisonFilterTypeSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
const ComparisonFilterTypeEq ComparisonFilterType = "eq" -
const ComparisonFilterTypeNe ComparisonFilterType = "ne" -
const ComparisonFilterTypeGt ComparisonFilterType = "gt" -
const ComparisonFilterTypeGte ComparisonFilterType = "gte" -
const ComparisonFilterTypeLt ComparisonFilterType = "lt" -
const ComparisonFilterTypeLte ComparisonFilterType = "lte" -
const ComparisonFilterTypeIn ComparisonFilterType = "in" -
const ComparisonFilterTypeNin ComparisonFilterType = "nin"
-
-
Value ComparisonFilterValueUnionThe value to compare against the attribute key; supports string, number, or boolean types.
-
string -
float64 -
bool -
type ComparisonFilterValueArray []ComparisonFilterValueArrayItemUnion-
string -
float64
-
-
-
-
type CompoundFilter struct{…}Combine multiple filters using
andoror.-
Filters []ComparisonFilterArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
-
Type CompoundFilterTypeType of operation:
andoror.-
const CompoundFilterTypeAnd CompoundFilterType = "and" -
const CompoundFilterTypeOr CompoundFilterType = "or"
-
-
-
-
MaxNumResults int64The maximum number of results to return. This number should be between 1 and 50 inclusive.
-
RankingOptions FileSearchToolRankingOptionsRanking options for search.
-
HybridSearch FileSearchToolRankingOptionsHybridSearchWeights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
EmbeddingWeight float64The weight of the embedding in the reciprocal ranking fusion.
-
TextWeight float64The weight of the text in the reciprocal ranking fusion.
-
-
Ranker stringThe ranker to use for the file search.
-
const FileSearchToolRankingOptionsRankerAuto FileSearchToolRankingOptionsRanker = "auto" -
const FileSearchToolRankingOptionsRankerDefault2024_11_15 FileSearchToolRankingOptionsRanker = "default-2024-11-15"
-
-
ScoreThreshold float64The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
Type ComputerThe type of the computer tool. Always
computer.const ComputerComputer Computer = "computer"
-
-
type ComputerUsePreviewTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
DisplayHeight int64The height of the computer display.
-
DisplayWidth int64The width of the computer display.
-
Environment ComputerUsePreviewToolEnvironmentThe type of computer environment to control.
-
const ComputerUsePreviewToolEnvironmentWindows ComputerUsePreviewToolEnvironment = "windows" -
const ComputerUsePreviewToolEnvironmentMac ComputerUsePreviewToolEnvironment = "mac" -
const ComputerUsePreviewToolEnvironmentLinux ComputerUsePreviewToolEnvironment = "linux" -
const ComputerUsePreviewToolEnvironmentUbuntu ComputerUsePreviewToolEnvironment = "ubuntu" -
const ComputerUsePreviewToolEnvironmentBrowser ComputerUsePreviewToolEnvironment = "browser"
-
-
Type ComputerUsePreviewThe type of the computer use tool. Always
computer_use_preview.const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"
-
-
type WebSearchTool struct{…}Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
Type WebSearchToolTypeThe type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
const WebSearchToolTypeWebSearch WebSearchToolType = "web_search" -
const WebSearchToolTypeWebSearch2025_08_26 WebSearchToolType = "web_search_2025_08_26"
-
-
Filters WebSearchToolFiltersFilters for the search.
-
AllowedDomains []stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
SearchContextSize WebSearchToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchToolSearchContextSizeLow WebSearchToolSearchContextSize = "low" -
const WebSearchToolSearchContextSizeMedium WebSearchToolSearchContextSize = "medium" -
const WebSearchToolSearchContextSizeHigh WebSearchToolSearchContextSize = "high"
-
-
UserLocation WebSearchToolUserLocationThe approximate location of the user.
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
Type stringThe type of location approximation. Always
approximate.const WebSearchToolUserLocationTypeApproximate WebSearchToolUserLocationType = "approximate"
-
-
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
ServerLabel stringA label for this MCP server, used to identify it in tool calls.
-
Type McpThe type of the MCP tool. Always
mcp.const McpMcp Mcp = "mcp"
-
AllowedTools ToolMcpAllowedToolsUnionList of allowed tool names or a filter object.
-
type ToolMcpAllowedToolsMcpAllowedTools []stringA string array of allowed tool names
-
type ToolMcpAllowedToolsMcpToolFilter struct{…}A filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
Authorization stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
ConnectorID stringIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
const ToolMcpConnectorIDConnectorDropbox ToolMcpConnectorID = "connector_dropbox" -
const ToolMcpConnectorIDConnectorGmail ToolMcpConnectorID = "connector_gmail" -
const ToolMcpConnectorIDConnectorGooglecalendar ToolMcpConnectorID = "connector_googlecalendar" -
const ToolMcpConnectorIDConnectorGoogledrive ToolMcpConnectorID = "connector_googledrive" -
const ToolMcpConnectorIDConnectorMicrosoftteams ToolMcpConnectorID = "connector_microsoftteams" -
const ToolMcpConnectorIDConnectorOutlookcalendar ToolMcpConnectorID = "connector_outlookcalendar" -
const ToolMcpConnectorIDConnectorOutlookemail ToolMcpConnectorID = "connector_outlookemail" -
const ToolMcpConnectorIDConnectorSharepoint ToolMcpConnectorID = "connector_sharepoint"
-
-
DeferLoading boolWhether this MCP tool is deferred and discovered via tool search.
-
Headers map[string, string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
RequireApproval ToolMcpRequireApprovalUnionSpecify which of the MCP server's tools require approval.
-
type ToolMcpRequireApprovalMcpToolApprovalFilter 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.-
Always ToolMcpRequireApprovalMcpToolApprovalFilterAlwaysA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
Never ToolMcpRequireApprovalMcpToolApprovalFilterNeverA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
type ToolMcpRequireApprovalMcpToolApprovalSetting stringSpecify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
const ToolMcpRequireApprovalMcpToolApprovalSettingAlways ToolMcpRequireApprovalMcpToolApprovalSetting = "always" -
const ToolMcpRequireApprovalMcpToolApprovalSettingNever ToolMcpRequireApprovalMcpToolApprovalSetting = "never"
-
-
-
ServerDescription stringOptional description of the MCP server, used to provide more context.
-
ServerURL stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
TunnelID stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
Container ToolCodeInterpreterContainerUnionThe code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
string -
type ToolCodeInterpreterContainerCodeInterpreterContainerAuto struct{…}Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
Type AutoAlways
auto.const AutoAuto Auto = "auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit stringThe memory limit for the code interpreter container.
-
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"
-
-
NetworkPolicy ToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…}-
Type DisabledDisable outbound network access. Always
disabled.const DisabledDisabled Disabled = "disabled"
-
-
type ContainerNetworkPolicyAllowlist struct{…}-
AllowedDomains []stringA list of allowed domains when type is
allowlist. -
Type AllowlistAllow outbound network access only to specified domains. Always
allowlist.const AllowlistAllowlist Allowlist = "allowlist"
-
DomainSecrets []ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
Domain stringThe domain associated with the secret.
-
Name stringThe name of the secret to inject for the domain.
-
Value stringThe secret value to inject for the domain.
-
-
-
-
-
-
Type CodeInterpreterThe type of the code interpreter tool. Always
code_interpreter.const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"
-
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
Type ImageGenerationThe type of the image generation tool. Always
image_generation.const ImageGenerationImageGeneration ImageGeneration = "image_generation"
-
Action stringWhether to generate a new image or edit an existing image. Default:
auto.-
const ToolImageGenerationActionGenerate ToolImageGenerationAction = "generate" -
const ToolImageGenerationActionEdit ToolImageGenerationAction = "edit" -
const ToolImageGenerationActionAuto ToolImageGenerationAction = "auto"
-
-
Background stringAllows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
const ToolImageGenerationBackgroundTransparent ToolImageGenerationBackground = "transparent" -
const ToolImageGenerationBackgroundOpaque ToolImageGenerationBackground = "opaque" -
const ToolImageGenerationBackgroundAuto ToolImageGenerationBackground = "auto"
-
-
InputFidelity stringControl how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
const ToolImageGenerationInputFidelityHigh ToolImageGenerationInputFidelity = "high" -
const ToolImageGenerationInputFidelityLow ToolImageGenerationInputFidelity = "low"
-
-
InputImageMask ToolImageGenerationInputImageMaskOptional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
FileID stringFile ID for the mask image.
-
ImageURL stringBase64-encoded mask image.
-
-
Model stringThe image generation model to use. Default:
gpt-image-1.-
string -
string-
const ToolImageGenerationModelGPTImage1 ToolImageGenerationModel = "gpt-image-1" -
const ToolImageGenerationModelGPTImage1Mini ToolImageGenerationModel = "gpt-image-1-mini" -
const ToolImageGenerationModelGPTImage2 ToolImageGenerationModel = "gpt-image-2" -
const ToolImageGenerationModelGPTImage2_2026_04_21 ToolImageGenerationModel = "gpt-image-2-2026-04-21" -
const ToolImageGenerationModelGPTImage1_5 ToolImageGenerationModel = "gpt-image-1.5" -
const ToolImageGenerationModelChatgptImageLatest ToolImageGenerationModel = "chatgpt-image-latest"
-
-
-
Moderation stringModeration level for the generated image. Default:
auto.-
const ToolImageGenerationModerationAuto ToolImageGenerationModeration = "auto" -
const ToolImageGenerationModerationLow ToolImageGenerationModeration = "low"
-
-
OutputCompression int64Compression level for the output image. Default: 100.
-
OutputFormat stringThe output format of the generated image. One of
png,webp, orjpeg. Default:png.-
const ToolImageGenerationOutputFormatPNG ToolImageGenerationOutputFormat = "png" -
const ToolImageGenerationOutputFormatWebP ToolImageGenerationOutputFormat = "webp" -
const ToolImageGenerationOutputFormatJPEG ToolImageGenerationOutputFormat = "jpeg"
-
-
PartialImages int64Number of partial images to generate in streaming mode, from 0 (default value) to 3.
-
Quality stringThe quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
const ToolImageGenerationQualityLow ToolImageGenerationQuality = "low" -
const ToolImageGenerationQualityMedium ToolImageGenerationQuality = "medium" -
const ToolImageGenerationQualityHigh ToolImageGenerationQuality = "high" -
const ToolImageGenerationQualityAuto ToolImageGenerationQuality = "auto"
-
-
Size stringThe size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
string -
string-
const ToolImageGenerationSize1024x1024 ToolImageGenerationSize = "1024x1024" -
const ToolImageGenerationSize1024x1536 ToolImageGenerationSize = "1024x1536" -
const ToolImageGenerationSize1536x1024 ToolImageGenerationSize = "1536x1024" -
const ToolImageGenerationSizeAuto ToolImageGenerationSize = "auto"
-
-
-
-
type ToolLocalShell struct{…}A tool that allows the model to execute shell commands in a local environment.
-
Type LocalShellThe type of the local shell tool. Always
local_shell.const LocalShellLocalShell LocalShell = "local_shell"
-
-
type FunctionShellTool struct{…}A tool that allows the model to execute shell commands.
-
Type ShellThe type of the shell tool. Always
shell.const ShellShell Shell = "shell"
-
Environment FunctionShellToolEnvironmentUnion-
type ContainerAuto struct{…}-
Type ContainerAutoAutomatically creates a container for this request
const ContainerAutoContainerAuto ContainerAuto = "container_auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit ContainerAutoMemoryLimitThe memory limit for the container.
-
const ContainerAutoMemoryLimit1g ContainerAutoMemoryLimit = "1g" -
const ContainerAutoMemoryLimit4g ContainerAutoMemoryLimit = "4g" -
const ContainerAutoMemoryLimit16g ContainerAutoMemoryLimit = "16g" -
const ContainerAutoMemoryLimit64g ContainerAutoMemoryLimit = "64g"
-
-
NetworkPolicy ContainerAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…} -
type ContainerNetworkPolicyAllowlist struct{…}
-
-
Skills []ContainerAutoSkillUnionAn optional list of skills referenced by id or inline data.
-
type SkillReference struct{…}-
SkillID stringThe ID of the referenced skill.
-
Type SkillReferenceReferences a skill created with the /v1/skills endpoint.
const SkillReferenceSkillReference SkillReference = "skill_reference"
-
Version stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
type InlineSkill struct{…}-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Source InlineSkillSourceInline skill payload
-
Data stringBase64-encoded skill zip bundle.
-
MediaType ApplicationZipThe media type of the inline skill payload. Must be
application/zip.const ApplicationZipApplicationZip ApplicationZip = "application/zip"
-
Type Base64The type of the inline skill source. Must be
base64.const Base64Base64 Base64 = "base64"
-
-
Type InlineDefines an inline skill for this request.
const InlineInline Inline = "inline"
-
-
-
-
type LocalEnvironment struct{…}-
Type LocalUse a local computer environment.
const LocalLocal Local = "local"
-
Skills []LocalSkillAn optional list of skills.
-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Path stringThe path to the directory containing the skill.
-
-
-
type ContainerReference struct{…}-
ContainerID stringThe ID of the referenced container.
-
Type ContainerReferenceReferences a container created with the /v1/containers endpoint
const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
Name stringThe name of the custom tool, used to identify it in tool calls.
-
Type CustomThe type of the custom tool. Always
custom.const CustomCustom Custom = "custom"
-
DeferLoading boolWhether this tool should be deferred and discovered via tool search.
-
Description stringOptional description of the custom tool, used to provide more context.
-
Format CustomToolInputFormatUnionThe input format for the custom tool. Default is unconstrained text.
-
type CustomToolInputFormatText struct{…}Unconstrained free-form text.
-
Type TextUnconstrained text format. Always
text.const TextText Text = "text"
-
-
type CustomToolInputFormatGrammar struct{…}A grammar defined by the user.
-
Definition stringThe grammar definition.
-
Syntax stringThe syntax of the grammar definition. One of
larkorregex.-
const CustomToolInputFormatGrammarSyntaxLark CustomToolInputFormatGrammarSyntax = "lark" -
const CustomToolInputFormatGrammarSyntaxRegex CustomToolInputFormatGrammarSyntax = "regex"
-
-
Type GrammarGrammar format. Always
grammar.const GrammarGrammar Grammar = "grammar"
-
-
-
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
Description stringA description of the namespace shown to the model.
-
Name stringThe namespace name used in tool calls (for example,
crm). -
Tools []NamespaceToolToolUnionThe function/custom tools available inside this namespace.
-
type NamespaceToolToolFunction struct{…}-
Name string -
Type Functionconst FunctionFunction Function = "function"
-
DeferLoading boolWhether this function should be deferred and discovered via tool search.
-
Description string -
Parameters any -
Strict bool
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
-
Type NamespaceThe type of the tool. Always
namespace.const NamespaceNamespace Namespace = "namespace"
-
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
Type ToolSearchThe type of the tool. Always
tool_search.const ToolSearchToolSearch ToolSearch = "tool_search"
-
Description stringDescription shown to the model for a client-executed tool search tool.
-
Execution ToolSearchToolExecutionWhether tool search is executed by the server or by the client.
-
const ToolSearchToolExecutionServer ToolSearchToolExecution = "server" -
const ToolSearchToolExecutionClient ToolSearchToolExecution = "client"
-
-
Parameters anyParameter schema for a client-executed tool search tool.
-
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
Type WebSearchPreviewToolTypeThe type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
const WebSearchPreviewToolTypeWebSearchPreview WebSearchPreviewToolType = "web_search_preview" -
const WebSearchPreviewToolTypeWebSearchPreview2025_03_11 WebSearchPreviewToolType = "web_search_preview_2025_03_11"
-
-
SearchContentTypes []string-
const WebSearchPreviewToolSearchContentTypeText WebSearchPreviewToolSearchContentType = "text" -
const WebSearchPreviewToolSearchContentTypeImage WebSearchPreviewToolSearchContentType = "image"
-
-
SearchContextSize WebSearchPreviewToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchPreviewToolSearchContextSizeLow WebSearchPreviewToolSearchContextSize = "low" -
const WebSearchPreviewToolSearchContextSizeMedium WebSearchPreviewToolSearchContextSize = "medium" -
const WebSearchPreviewToolSearchContextSizeHigh WebSearchPreviewToolSearchContextSize = "high"
-
-
UserLocation WebSearchPreviewToolUserLocationThe user's location.
-
Type ApproximateThe type of location approximation. Always
approximate.const ApproximateApproximate Approximate = "approximate"
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
Type ApplyPatchThe type of the tool. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
-
Type ToolSearchOutputThe type of the item. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseOutputItemAdditionalTools struct{…}-
ID stringThe unique ID of the additional tools item.
-
Role stringThe role that provided the additional tools.
-
const ResponseOutputItemAdditionalToolsRoleUnknown ResponseOutputItemAdditionalToolsRole = "unknown" -
const ResponseOutputItemAdditionalToolsRoleUser ResponseOutputItemAdditionalToolsRole = "user" -
const ResponseOutputItemAdditionalToolsRoleAssistant ResponseOutputItemAdditionalToolsRole = "assistant" -
const ResponseOutputItemAdditionalToolsRoleSystem ResponseOutputItemAdditionalToolsRole = "system" -
const ResponseOutputItemAdditionalToolsRoleCritic ResponseOutputItemAdditionalToolsRole = "critic" -
const ResponseOutputItemAdditionalToolsRoleDiscriminator ResponseOutputItemAdditionalToolsRole = "discriminator" -
const ResponseOutputItemAdditionalToolsRoleDeveloper ResponseOutputItemAdditionalToolsRole = "developer" -
const ResponseOutputItemAdditionalToolsRoleTool ResponseOutputItemAdditionalToolsRole = "tool"
-
-
Tools []ToolUnionThe additional tool definitions made available at this item.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type AdditionalToolsThe type of the item. Always
additional_tools.const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"
-
-
type ResponseCompactionItem struct{…}A compaction item generated by the
v1/responses/compactAPI.-
ID stringThe unique ID of the compaction item.
-
EncryptedContent stringThe encrypted content that was produced by compaction.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseOutputItemImageGenerationCall struct{…}An image generation request made by the model.
-
ID stringThe unique ID of the image generation call.
-
Result stringThe generated image encoded in base64.
-
Status stringThe status of the image generation call.
-
const ResponseOutputItemImageGenerationCallStatusInProgress ResponseOutputItemImageGenerationCallStatus = "in_progress" -
const ResponseOutputItemImageGenerationCallStatusCompleted ResponseOutputItemImageGenerationCallStatus = "completed" -
const ResponseOutputItemImageGenerationCallStatusGenerating ResponseOutputItemImageGenerationCallStatus = "generating" -
const ResponseOutputItemImageGenerationCallStatusFailed ResponseOutputItemImageGenerationCallStatus = "failed"
-
-
Type ImageGenerationCallThe type of the image generation call. Always
image_generation_call.const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"
-
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
ID stringThe unique ID of the code interpreter tool call.
-
Code stringThe code to run, or null if not available.
-
ContainerID stringThe ID of the container used to run the code.
-
Outputs []ResponseCodeInterpreterToolCallOutputUnionThe outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
type ResponseCodeInterpreterToolCallOutputLogs struct{…}The logs output from the code interpreter.
-
Logs stringThe logs output from the code interpreter.
-
Type LogsThe type of the output. Always
logs.const LogsLogs Logs = "logs"
-
-
type ResponseCodeInterpreterToolCallOutputImage struct{…}The image output from the code interpreter.
-
Type ImageThe type of the output. Always
image.const ImageImage Image = "image"
-
URL stringThe URL of the image output from the code interpreter.
-
-
-
Status ResponseCodeInterpreterToolCallStatusThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
const ResponseCodeInterpreterToolCallStatusInProgress ResponseCodeInterpreterToolCallStatus = "in_progress" -
const ResponseCodeInterpreterToolCallStatusCompleted ResponseCodeInterpreterToolCallStatus = "completed" -
const ResponseCodeInterpreterToolCallStatusIncomplete ResponseCodeInterpreterToolCallStatus = "incomplete" -
const ResponseCodeInterpreterToolCallStatusInterpreting ResponseCodeInterpreterToolCallStatus = "interpreting" -
const ResponseCodeInterpreterToolCallStatusFailed ResponseCodeInterpreterToolCallStatus = "failed"
-
-
Type CodeInterpreterCallThe type of the code interpreter tool call. Always
code_interpreter_call.const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"
-
-
type ResponseOutputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
ID stringThe unique ID of the local shell call.
-
Action ResponseOutputItemLocalShellCallActionExecute a shell command on the server.
-
Command []stringThe command to run.
-
Env map[string, string]Environment variables to set for the command.
-
Type ExecThe type of the local shell action. Always
exec.const ExecExec Exec = "exec"
-
TimeoutMs int64Optional timeout in milliseconds for the command.
-
User stringOptional user to run the command as.
-
WorkingDirectory stringOptional working directory to run the command in.
-
-
CallID stringThe unique ID of the local shell tool call generated by the model.
-
Status stringThe status of the local shell call.
-
const ResponseOutputItemLocalShellCallStatusInProgress ResponseOutputItemLocalShellCallStatus = "in_progress" -
const ResponseOutputItemLocalShellCallStatusCompleted ResponseOutputItemLocalShellCallStatus = "completed" -
const ResponseOutputItemLocalShellCallStatusIncomplete ResponseOutputItemLocalShellCallStatus = "incomplete"
-
-
Type LocalShellCallThe type of the local shell call. Always
local_shell_call.const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"
-
-
type ResponseOutputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
ID stringThe unique ID of the local shell tool call generated by the model.
-
Output stringA JSON string of the output of the local shell tool call.
-
Type LocalShellCallOutputThe type of the local shell tool call output. Always
local_shell_call_output.const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete.-
const ResponseOutputItemLocalShellCallOutputStatusInProgress ResponseOutputItemLocalShellCallOutputStatus = "in_progress" -
const ResponseOutputItemLocalShellCallOutputStatusCompleted ResponseOutputItemLocalShellCallOutputStatus = "completed" -
const ResponseOutputItemLocalShellCallOutputStatusIncomplete ResponseOutputItemLocalShellCallOutputStatus = "incomplete"
-
-
-
type ResponseFunctionShellToolCall struct{…}A tool call that executes one or more shell commands in a managed environment.
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Action ResponseFunctionShellToolCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []string -
MaxOutputLength int64Optional maximum number of characters to return from each command.
-
TimeoutMs int64Optional timeout in milliseconds for the commands.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Environment ResponseFunctionShellToolCallEnvironmentUnionRepresents the use of a local environment to perform shell actions.
-
type ResponseLocalEnvironment struct{…}Represents the use of a local environment to perform shell actions.
-
Type LocalThe environment type. Always
local.const LocalLocal Local = "local"
-
-
type ResponseContainerReference struct{…}Represents a container created with /v1/containers.
-
ContainerID string -
Type ContainerReferenceThe environment type. Always
container_reference.const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
Status ResponseFunctionShellToolCallStatusThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallStatusInProgress ResponseFunctionShellToolCallStatus = "in_progress" -
const ResponseFunctionShellToolCallStatusCompleted ResponseFunctionShellToolCallStatus = "completed" -
const ResponseFunctionShellToolCallStatusIncomplete ResponseFunctionShellToolCallStatus = "incomplete"
-
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseFunctionShellToolCallOutput struct{…}The output of a shell tool call that was emitted.
-
ID stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
MaxOutputLength int64The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
Output []ResponseFunctionShellToolCallOutputOutputAn array of shell call output contents
-
Outcome ResponseFunctionShellToolCallOutputOutputOutcomeUnionRepresents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
type ResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64Exit code from the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringThe standard error output that was captured.
-
Stdout stringThe standard output that was captured.
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
Status ResponseFunctionShellToolCallOutputStatusThe status of the shell call output. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallOutputStatusInProgress ResponseFunctionShellToolCallOutputStatus = "in_progress" -
const ResponseFunctionShellToolCallOutputStatusCompleted ResponseFunctionShellToolCallOutputStatus = "completed" -
const ResponseFunctionShellToolCallOutputStatusIncomplete ResponseFunctionShellToolCallOutputStatus = "incomplete"
-
-
Type ShellCallOutputThe type of the shell call output. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseApplyPatchToolCall struct{…}A tool call that applies file diffs by creating, deleting, or updating files.
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseApplyPatchToolCallOperationUnionOne of the create_file, delete_file, or update_file operations applied via apply_patch.
-
type ResponseApplyPatchToolCallOperationCreateFile struct{…}Instruction describing how to create a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to create.
-
Type CreateFileCreate a new file with the provided diff.
const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseApplyPatchToolCallOperationDeleteFile struct{…}Instruction describing how to delete a file via the apply_patch tool.
-
Path stringPath of the file to delete.
-
Type DeleteFileDelete the specified file.
const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseApplyPatchToolCallOperationUpdateFile struct{…}Instruction describing how to update a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to update.
-
Type UpdateFileUpdate an existing file with the provided diff.
const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status ResponseApplyPatchToolCallStatusThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseApplyPatchToolCallStatusInProgress ResponseApplyPatchToolCallStatus = "in_progress" -
const ResponseApplyPatchToolCallStatusCompleted ResponseApplyPatchToolCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseApplyPatchToolCallOutput struct{…}The output emitted by an apply patch tool call.
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status ResponseApplyPatchToolCallOutputStatusThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseApplyPatchToolCallOutputStatusCompleted ResponseApplyPatchToolCallOutputStatus = "completed" -
const ResponseApplyPatchToolCallOutputStatusFailed ResponseApplyPatchToolCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
CreatedBy stringThe ID of the entity that created this tool call output.
-
Output stringOptional textual output returned by the apply patch tool.
-
-
type ResponseOutputItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
ID stringThe unique ID of the tool call.
-
Arguments stringA JSON string of the arguments passed to the tool.
-
Name stringThe name of the tool that was run.
-
ServerLabel stringThe label of the MCP server running the tool.
-
Type McpCallThe type of the item. Always
mcp_call.const McpCallMcpCall McpCall = "mcp_call"
-
ApprovalRequestID stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
Error stringThe error from the tool call, if any.
-
Output stringThe output from the tool call.
-
Status stringThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
const ResponseOutputItemMcpCallStatusInProgress ResponseOutputItemMcpCallStatus = "in_progress" -
const ResponseOutputItemMcpCallStatusCompleted ResponseOutputItemMcpCallStatus = "completed" -
const ResponseOutputItemMcpCallStatusIncomplete ResponseOutputItemMcpCallStatus = "incomplete" -
const ResponseOutputItemMcpCallStatusCalling ResponseOutputItemMcpCallStatus = "calling" -
const ResponseOutputItemMcpCallStatusFailed ResponseOutputItemMcpCallStatus = "failed"
-
-
-
type ResponseOutputItemMcpListTools struct{…}A list of tools available on an MCP server.
-
ID stringThe unique ID of the list.
-
ServerLabel stringThe label of the MCP server.
-
Tools []ResponseOutputItemMcpListToolsToolThe tools available on the server.
-
InputSchema anyThe JSON schema describing the tool's input.
-
Name stringThe name of the tool.
-
Annotations anyAdditional annotations about the tool.
-
Description stringThe description of the tool.
-
-
Type McpListToolsThe type of the item. Always
mcp_list_tools.const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
-
Error stringError message if the server could not list tools.
-
-
type ResponseOutputItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
ID stringThe unique ID of the approval request.
-
Arguments stringA JSON string of arguments for the tool.
-
Name stringThe name of the tool to run.
-
ServerLabel stringThe label of the MCP server making the request.
-
Type McpApprovalRequestThe type of the item. Always
mcp_approval_request.const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"
-
-
type ResponseOutputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
ID stringThe unique ID of the approval response
-
ApprovalRequestID stringThe ID of the approval request being answered.
-
Approve boolWhether the request was approved.
-
Type McpApprovalResponseThe type of the item. Always
mcp_approval_response.const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
-
Reason stringOptional reason for the decision.
-
-
type ResponseCustomToolCall struct{…}A call to a custom tool created by the model.
-
CallID stringAn identifier used to map this custom tool call to a tool call output.
-
Input stringThe input for the custom tool call generated by the model.
-
Name stringThe name of the custom tool being called.
-
Type CustomToolCallThe type of the custom tool call. Always
custom_tool_call.const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"
-
ID stringThe unique ID of the custom tool call in the OpenAI platform.
-
Namespace stringThe namespace of the custom tool being called.
-
-
type ResponseCustomToolCallOutputItem struct{…}The output of a custom tool call from your code, being sent back to the model.
-
ID stringThe unique ID of the custom tool call output item.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseCustomToolCallOutputItemStatusInProgress ResponseCustomToolCallOutputItemStatus = "in_progress" -
const ResponseCustomToolCallOutputItemStatusCompleted ResponseCustomToolCallOutputItemStatus = "completed" -
const ResponseCustomToolCallOutputItemStatusIncomplete ResponseCustomToolCallOutputItemStatus = "incomplete"
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
-
Usage ResponseUsageToken accounting for the compaction pass, including cached, reasoning, and total tokens.
-
InputTokens int64The number of input tokens.
-
InputTokensDetails ResponseUsageInputTokensDetailsA detailed breakdown of the input tokens.
-
CachedTokens int64The number of tokens that were retrieved from the cache. More on prompt caching.
-
-
OutputTokens int64The number of output tokens.
-
OutputTokensDetails ResponseUsageOutputTokensDetailsA detailed breakdown of the output tokens.
-
ReasoningTokens int64The number of reasoning tokens.
-
-
TotalTokens int64The total number of tokens used.
-
-
Computer Action
-
type ComputerActionUnion interface{…}A click action.
-
type ComputerActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ComputerActionClickButtonLeft ComputerActionClickButton = "left" -
const ComputerActionClickButtonRight ComputerActionClickButton = "right" -
const ComputerActionClickButtonWheel ComputerActionClickButton = "wheel" -
const ComputerActionClickButtonBack ComputerActionClickButton = "back" -
const ComputerActionClickButtonForward ComputerActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ComputerActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ComputerActionDrag struct{…}A drag action.
-
Path []ComputerActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ComputerActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ComputerActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ComputerActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ComputerActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ComputerActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ComputerActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
Computer Action List
-
type ComputerActionList []ComputerActionUnionFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
type ComputerActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ComputerActionClickButtonLeft ComputerActionClickButton = "left" -
const ComputerActionClickButtonRight ComputerActionClickButton = "right" -
const ComputerActionClickButtonWheel ComputerActionClickButton = "wheel" -
const ComputerActionClickButtonBack ComputerActionClickButton = "back" -
const ComputerActionClickButtonForward ComputerActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ComputerActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ComputerActionDrag struct{…}A drag action.
-
Path []ComputerActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ComputerActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ComputerActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ComputerActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ComputerActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ComputerActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ComputerActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
Computer Tool
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
Type ComputerThe type of the computer tool. Always
computer.const ComputerComputer Computer = "computer"
-
Computer Use Preview Tool
-
type ComputerUsePreviewTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
DisplayHeight int64The height of the computer display.
-
DisplayWidth int64The width of the computer display.
-
Environment ComputerUsePreviewToolEnvironmentThe type of computer environment to control.
-
const ComputerUsePreviewToolEnvironmentWindows ComputerUsePreviewToolEnvironment = "windows" -
const ComputerUsePreviewToolEnvironmentMac ComputerUsePreviewToolEnvironment = "mac" -
const ComputerUsePreviewToolEnvironmentLinux ComputerUsePreviewToolEnvironment = "linux" -
const ComputerUsePreviewToolEnvironmentUbuntu ComputerUsePreviewToolEnvironment = "ubuntu" -
const ComputerUsePreviewToolEnvironmentBrowser ComputerUsePreviewToolEnvironment = "browser"
-
-
Type ComputerUsePreviewThe type of the computer use tool. Always
computer_use_preview.const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"
-
Container Auto
-
type ContainerAuto struct{…}-
Type ContainerAutoAutomatically creates a container for this request
const ContainerAutoContainerAuto ContainerAuto = "container_auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit ContainerAutoMemoryLimitThe memory limit for the container.
-
const ContainerAutoMemoryLimit1g ContainerAutoMemoryLimit = "1g" -
const ContainerAutoMemoryLimit4g ContainerAutoMemoryLimit = "4g" -
const ContainerAutoMemoryLimit16g ContainerAutoMemoryLimit = "16g" -
const ContainerAutoMemoryLimit64g ContainerAutoMemoryLimit = "64g"
-
-
NetworkPolicy ContainerAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…}-
Type DisabledDisable outbound network access. Always
disabled.const DisabledDisabled Disabled = "disabled"
-
-
type ContainerNetworkPolicyAllowlist struct{…}-
AllowedDomains []stringA list of allowed domains when type is
allowlist. -
Type AllowlistAllow outbound network access only to specified domains. Always
allowlist.const AllowlistAllowlist Allowlist = "allowlist"
-
DomainSecrets []ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
Domain stringThe domain associated with the secret.
-
Name stringThe name of the secret to inject for the domain.
-
Value stringThe secret value to inject for the domain.
-
-
-
-
Skills []ContainerAutoSkillUnionAn optional list of skills referenced by id or inline data.
-
type SkillReference struct{…}-
SkillID stringThe ID of the referenced skill.
-
Type SkillReferenceReferences a skill created with the /v1/skills endpoint.
const SkillReferenceSkillReference SkillReference = "skill_reference"
-
Version stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
type InlineSkill struct{…}-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Source InlineSkillSourceInline skill payload
-
Data stringBase64-encoded skill zip bundle.
-
MediaType ApplicationZipThe media type of the inline skill payload. Must be
application/zip.const ApplicationZipApplicationZip ApplicationZip = "application/zip"
-
Type Base64The type of the inline skill source. Must be
base64.const Base64Base64 Base64 = "base64"
-
-
Type InlineDefines an inline skill for this request.
const InlineInline Inline = "inline"
-
-
-
Container Network Policy Allowlist
-
type ContainerNetworkPolicyAllowlist struct{…}-
AllowedDomains []stringA list of allowed domains when type is
allowlist. -
Type AllowlistAllow outbound network access only to specified domains. Always
allowlist.const AllowlistAllowlist Allowlist = "allowlist"
-
DomainSecrets []ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
Domain stringThe domain associated with the secret.
-
Name stringThe name of the secret to inject for the domain.
-
Value stringThe secret value to inject for the domain.
-
-
Container Network Policy Disabled
-
type ContainerNetworkPolicyDisabled struct{…}-
Type DisabledDisable outbound network access. Always
disabled.const DisabledDisabled Disabled = "disabled"
-
Container Network Policy Domain Secret
-
type ContainerNetworkPolicyDomainSecret struct{…}-
Domain stringThe domain associated with the secret.
-
Name stringThe name of the secret to inject for the domain.
-
Value stringThe secret value to inject for the domain.
-
Container Reference
-
type ContainerReference struct{…}-
ContainerID stringThe ID of the referenced container.
-
Type ContainerReferenceReferences a container created with the /v1/containers endpoint
const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
Custom Tool
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
Name stringThe name of the custom tool, used to identify it in tool calls.
-
Type CustomThe type of the custom tool. Always
custom.const CustomCustom Custom = "custom"
-
DeferLoading boolWhether this tool should be deferred and discovered via tool search.
-
Description stringOptional description of the custom tool, used to provide more context.
-
Format CustomToolInputFormatUnionThe input format for the custom tool. Default is unconstrained text.
-
type CustomToolInputFormatText struct{…}Unconstrained free-form text.
-
Type TextUnconstrained text format. Always
text.const TextText Text = "text"
-
-
type CustomToolInputFormatGrammar struct{…}A grammar defined by the user.
-
Definition stringThe grammar definition.
-
Syntax stringThe syntax of the grammar definition. One of
larkorregex.-
const CustomToolInputFormatGrammarSyntaxLark CustomToolInputFormatGrammarSyntax = "lark" -
const CustomToolInputFormatGrammarSyntaxRegex CustomToolInputFormatGrammarSyntax = "regex"
-
-
Type GrammarGrammar format. Always
grammar.const GrammarGrammar Grammar = "grammar"
-
-
-
Easy Input Message
-
type EasyInputMessage struct{…}A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.-
Content EasyInputMessageContentUnionText, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
-
string -
type ResponseInputMessageContentList []ResponseInputContentUnionA list of one or many input items to the model, containing different content types.
-
type ResponseInputText struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
Detail ResponseInputImageDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageDetailLow ResponseInputImageDetail = "low" -
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high" -
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto" -
const ResponseInputImageDetailOriginal ResponseInputImageDetail = "original"
-
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFile struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileDetailLow ResponseInputFileDetail = "low" -
const ResponseInputFileDetailHigh ResponseInputFileDetail = "high"
-
-
FileData stringThe content of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Role EasyInputMessageRoleThe role of the message input. One of
user,assistant,system, ordeveloper.-
const EasyInputMessageRoleUser EasyInputMessageRole = "user" -
const EasyInputMessageRoleAssistant EasyInputMessageRole = "assistant" -
const EasyInputMessageRoleSystem EasyInputMessageRole = "system" -
const EasyInputMessageRoleDeveloper EasyInputMessageRole = "developer"
-
-
Phase EasyInputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const EasyInputMessagePhaseCommentary EasyInputMessagePhase = "commentary" -
const EasyInputMessagePhaseFinalAnswer EasyInputMessagePhase = "final_answer"
-
-
Type EasyInputMessageTypeThe type of the message input. Always
message.const EasyInputMessageTypeMessage EasyInputMessageType = "message"
-
File Search Tool
-
type FileSearchTool struct{…}A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
Type FileSearchThe type of the file search tool. Always
file_search.const FileSearchFileSearch FileSearch = "file_search"
-
VectorStoreIDs []stringThe IDs of the vector stores to search.
-
Filters FileSearchToolFiltersUnionA filter to apply.
-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
Key stringThe key to compare against the value.
-
Type ComparisonFilterTypeSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
const ComparisonFilterTypeEq ComparisonFilterType = "eq" -
const ComparisonFilterTypeNe ComparisonFilterType = "ne" -
const ComparisonFilterTypeGt ComparisonFilterType = "gt" -
const ComparisonFilterTypeGte ComparisonFilterType = "gte" -
const ComparisonFilterTypeLt ComparisonFilterType = "lt" -
const ComparisonFilterTypeLte ComparisonFilterType = "lte" -
const ComparisonFilterTypeIn ComparisonFilterType = "in" -
const ComparisonFilterTypeNin ComparisonFilterType = "nin"
-
-
Value ComparisonFilterValueUnionThe value to compare against the attribute key; supports string, number, or boolean types.
-
string -
float64 -
bool -
type ComparisonFilterValueArray []ComparisonFilterValueArrayItemUnion-
string -
float64
-
-
-
-
type CompoundFilter struct{…}Combine multiple filters using
andoror.-
Filters []ComparisonFilterArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
-
Type CompoundFilterTypeType of operation:
andoror.-
const CompoundFilterTypeAnd CompoundFilterType = "and" -
const CompoundFilterTypeOr CompoundFilterType = "or"
-
-
-
-
MaxNumResults int64The maximum number of results to return. This number should be between 1 and 50 inclusive.
-
RankingOptions FileSearchToolRankingOptionsRanking options for search.
-
HybridSearch FileSearchToolRankingOptionsHybridSearchWeights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
EmbeddingWeight float64The weight of the embedding in the reciprocal ranking fusion.
-
TextWeight float64The weight of the text in the reciprocal ranking fusion.
-
-
Ranker stringThe ranker to use for the file search.
-
const FileSearchToolRankingOptionsRankerAuto FileSearchToolRankingOptionsRanker = "auto" -
const FileSearchToolRankingOptionsRankerDefault2024_11_15 FileSearchToolRankingOptionsRanker = "default-2024-11-15"
-
-
ScoreThreshold float64The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
Function Shell Tool
-
type FunctionShellTool struct{…}A tool that allows the model to execute shell commands.
-
Type ShellThe type of the shell tool. Always
shell.const ShellShell Shell = "shell"
-
Environment FunctionShellToolEnvironmentUnion-
type ContainerAuto struct{…}-
Type ContainerAutoAutomatically creates a container for this request
const ContainerAutoContainerAuto ContainerAuto = "container_auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit ContainerAutoMemoryLimitThe memory limit for the container.
-
const ContainerAutoMemoryLimit1g ContainerAutoMemoryLimit = "1g" -
const ContainerAutoMemoryLimit4g ContainerAutoMemoryLimit = "4g" -
const ContainerAutoMemoryLimit16g ContainerAutoMemoryLimit = "16g" -
const ContainerAutoMemoryLimit64g ContainerAutoMemoryLimit = "64g"
-
-
NetworkPolicy ContainerAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…}-
Type DisabledDisable outbound network access. Always
disabled.const DisabledDisabled Disabled = "disabled"
-
-
type ContainerNetworkPolicyAllowlist struct{…}-
AllowedDomains []stringA list of allowed domains when type is
allowlist. -
Type AllowlistAllow outbound network access only to specified domains. Always
allowlist.const AllowlistAllowlist Allowlist = "allowlist"
-
DomainSecrets []ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
Domain stringThe domain associated with the secret.
-
Name stringThe name of the secret to inject for the domain.
-
Value stringThe secret value to inject for the domain.
-
-
-
-
Skills []ContainerAutoSkillUnionAn optional list of skills referenced by id or inline data.
-
type SkillReference struct{…}-
SkillID stringThe ID of the referenced skill.
-
Type SkillReferenceReferences a skill created with the /v1/skills endpoint.
const SkillReferenceSkillReference SkillReference = "skill_reference"
-
Version stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
type InlineSkill struct{…}-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Source InlineSkillSourceInline skill payload
-
Data stringBase64-encoded skill zip bundle.
-
MediaType ApplicationZipThe media type of the inline skill payload. Must be
application/zip.const ApplicationZipApplicationZip ApplicationZip = "application/zip"
-
Type Base64The type of the inline skill source. Must be
base64.const Base64Base64 Base64 = "base64"
-
-
Type InlineDefines an inline skill for this request.
const InlineInline Inline = "inline"
-
-
-
-
type LocalEnvironment struct{…}-
Type LocalUse a local computer environment.
const LocalLocal Local = "local"
-
Skills []LocalSkillAn optional list of skills.
-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Path stringThe path to the directory containing the skill.
-
-
-
type ContainerReference struct{…}-
ContainerID stringThe ID of the referenced container.
-
Type ContainerReferenceReferences a container created with the /v1/containers endpoint
const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
Function Tool
-
type FunctionTool struct{…}Defines a function in your own code the model can choose to call. Learn more about function calling.
-
Name stringThe name of the function to call.
-
Parameters map[string, any]A JSON schema object describing the parameters of the function.
-
Strict boolWhether to enforce strict parameter validation. Default
true. -
Type FunctionThe type of the function tool. Always
function.const FunctionFunction Function = "function"
-
DeferLoading boolWhether this function is deferred and loaded via tool search.
-
Description stringA description of the function. Used by the model to determine whether or not to call the function.
-
Inline Skill
-
type InlineSkill struct{…}-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Source InlineSkillSourceInline skill payload
-
Data stringBase64-encoded skill zip bundle.
-
MediaType ApplicationZipThe media type of the inline skill payload. Must be
application/zip.const ApplicationZipApplicationZip ApplicationZip = "application/zip"
-
Type Base64The type of the inline skill source. Must be
base64.const Base64Base64 Base64 = "base64"
-
-
Type InlineDefines an inline skill for this request.
const InlineInline Inline = "inline"
-
Inline Skill Source
-
type InlineSkillSource struct{…}Inline skill payload
-
Data stringBase64-encoded skill zip bundle.
-
MediaType ApplicationZipThe media type of the inline skill payload. Must be
application/zip.const ApplicationZipApplicationZip ApplicationZip = "application/zip"
-
Type Base64The type of the inline skill source. Must be
base64.const Base64Base64 Base64 = "base64"
-
Local Environment
-
type LocalEnvironment struct{…}-
Type LocalUse a local computer environment.
const LocalLocal Local = "local"
-
Skills []LocalSkillAn optional list of skills.
-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Path stringThe path to the directory containing the skill.
-
-
Local Skill
-
type LocalSkill struct{…}-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Path stringThe path to the directory containing the skill.
-
Namespace Tool
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
Description stringA description of the namespace shown to the model.
-
Name stringThe namespace name used in tool calls (for example,
crm). -
Tools []NamespaceToolToolUnionThe function/custom tools available inside this namespace.
-
type NamespaceToolToolFunction struct{…}-
Name string -
Type Functionconst FunctionFunction Function = "function"
-
DeferLoading boolWhether this function should be deferred and discovered via tool search.
-
Description string -
Parameters any -
Strict bool
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
Name stringThe name of the custom tool, used to identify it in tool calls.
-
Type CustomThe type of the custom tool. Always
custom.const CustomCustom Custom = "custom"
-
DeferLoading boolWhether this tool should be deferred and discovered via tool search.
-
Description stringOptional description of the custom tool, used to provide more context.
-
Format CustomToolInputFormatUnionThe input format for the custom tool. Default is unconstrained text.
-
type CustomToolInputFormatText struct{…}Unconstrained free-form text.
-
Type TextUnconstrained text format. Always
text.const TextText Text = "text"
-
-
type CustomToolInputFormatGrammar struct{…}A grammar defined by the user.
-
Definition stringThe grammar definition.
-
Syntax stringThe syntax of the grammar definition. One of
larkorregex.-
const CustomToolInputFormatGrammarSyntaxLark CustomToolInputFormatGrammarSyntax = "lark" -
const CustomToolInputFormatGrammarSyntaxRegex CustomToolInputFormatGrammarSyntax = "regex"
-
-
Type GrammarGrammar format. Always
grammar.const GrammarGrammar Grammar = "grammar"
-
-
-
-
-
Type NamespaceThe type of the tool. Always
namespace.const NamespaceNamespace Namespace = "namespace"
-
Response
-
type Response struct{…}-
ID stringUnique identifier for this Response.
-
CreatedAt float64Unix timestamp (in seconds) of when this Response was created.
-
Error ResponseErrorAn error object returned when the model fails to generate a Response.
-
Code ResponseErrorCodeThe error code for the response.
-
const ResponseErrorCodeServerError ResponseErrorCode = "server_error" -
const ResponseErrorCodeRateLimitExceeded ResponseErrorCode = "rate_limit_exceeded" -
const ResponseErrorCodeInvalidPrompt ResponseErrorCode = "invalid_prompt" -
const ResponseErrorCodeVectorStoreTimeout ResponseErrorCode = "vector_store_timeout" -
const ResponseErrorCodeInvalidImage ResponseErrorCode = "invalid_image" -
const ResponseErrorCodeInvalidImageFormat ResponseErrorCode = "invalid_image_format" -
const ResponseErrorCodeInvalidBase64Image ResponseErrorCode = "invalid_base64_image" -
const ResponseErrorCodeInvalidImageURL ResponseErrorCode = "invalid_image_url" -
const ResponseErrorCodeImageTooLarge ResponseErrorCode = "image_too_large" -
const ResponseErrorCodeImageTooSmall ResponseErrorCode = "image_too_small" -
const ResponseErrorCodeImageParseError ResponseErrorCode = "image_parse_error" -
const ResponseErrorCodeImageContentPolicyViolation ResponseErrorCode = "image_content_policy_violation" -
const ResponseErrorCodeInvalidImageMode ResponseErrorCode = "invalid_image_mode" -
const ResponseErrorCodeImageFileTooLarge ResponseErrorCode = "image_file_too_large" -
const ResponseErrorCodeUnsupportedImageMediaType ResponseErrorCode = "unsupported_image_media_type" -
const ResponseErrorCodeEmptyImageFile ResponseErrorCode = "empty_image_file" -
const ResponseErrorCodeFailedToDownloadImage ResponseErrorCode = "failed_to_download_image" -
const ResponseErrorCodeImageFileNotFound ResponseErrorCode = "image_file_not_found"
-
-
Message stringA human-readable description of the error.
-
-
IncompleteDetails ResponseIncompleteDetailsDetails about why the response is incomplete.
-
Reason stringThe reason why the response is incomplete.
-
const ResponseIncompleteDetailsReasonMaxOutputTokens ResponseIncompleteDetailsReason = "max_output_tokens" -
const ResponseIncompleteDetailsReasonContentFilter ResponseIncompleteDetailsReason = "content_filter"
-
-
-
Instructions ResponseInstructionsUnionA system (or developer) message inserted into the model's context.
When using along with
previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses.-
string -
type ResponseInstructionsInputItemList []ResponseInputItemUnionA list of one or many input items to the model, containing different content types.
-
type EasyInputMessage struct{…}A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.-
Content EasyInputMessageContentUnionText, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
-
string -
type ResponseInputMessageContentList []ResponseInputContentUnionA list of one or many input items to the model, containing different content types.
-
type ResponseInputText struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
Detail ResponseInputImageDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageDetailLow ResponseInputImageDetail = "low" -
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high" -
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto" -
const ResponseInputImageDetailOriginal ResponseInputImageDetail = "original"
-
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFile struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileDetailLow ResponseInputFileDetail = "low" -
const ResponseInputFileDetailHigh ResponseInputFileDetail = "high"
-
-
FileData stringThe content of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Role EasyInputMessageRoleThe role of the message input. One of
user,assistant,system, ordeveloper.-
const EasyInputMessageRoleUser EasyInputMessageRole = "user" -
const EasyInputMessageRoleAssistant EasyInputMessageRole = "assistant" -
const EasyInputMessageRoleSystem EasyInputMessageRole = "system" -
const EasyInputMessageRoleDeveloper EasyInputMessageRole = "developer"
-
-
Phase EasyInputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const EasyInputMessagePhaseCommentary EasyInputMessagePhase = "commentary" -
const EasyInputMessagePhaseFinalAnswer EasyInputMessagePhase = "final_answer"
-
-
Type EasyInputMessageTypeThe type of the message input. Always
message.const EasyInputMessageTypeMessage EasyInputMessageType = "message"
-
-
type ResponseInputItemMessage struct{…}A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole.-
Content ResponseInputMessageContentListA list of one or many input items to the model, containing different content types.
-
Role stringThe role of the message input. One of
user,system, ordeveloper.-
const ResponseInputItemMessageRoleUser ResponseInputItemMessageRole = "user" -
const ResponseInputItemMessageRoleSystem ResponseInputItemMessageRole = "system" -
const ResponseInputItemMessageRoleDeveloper ResponseInputItemMessageRole = "developer"
-
-
Status stringThe status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputItemMessageStatusInProgress ResponseInputItemMessageStatus = "in_progress" -
const ResponseInputItemMessageStatusCompleted ResponseInputItemMessageStatus = "completed" -
const ResponseInputItemMessageStatusIncomplete ResponseInputItemMessageStatus = "incomplete"
-
-
Type stringThe type of the message input. Always set to
message.const ResponseInputItemMessageTypeMessage ResponseInputItemMessageType = "message"
-
-
type ResponseOutputMessage struct{…}An output message from the model.
-
ID stringThe unique ID of the output message.
-
Content []ResponseOutputMessageContentUnionThe content of the output message.
-
type ResponseOutputText struct{…}A text output from the model.
-
Annotations []ResponseOutputTextAnnotationUnionThe annotations of the text output.
-
type ResponseOutputTextAnnotationFileCitation struct{…}A citation to a file.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the file cited.
-
Index int64The index of the file in the list of files.
-
Type FileCitationThe type of the file citation. Always
file_citation.const FileCitationFileCitation FileCitation = "file_citation"
-
-
type ResponseOutputTextAnnotationURLCitation struct{…}A citation for a web resource used to generate a model response.
-
EndIndex int64The index of the last character of the URL citation in the message.
-
StartIndex int64The index of the first character of the URL citation in the message.
-
Title stringThe title of the web resource.
-
Type URLCitationThe type of the URL citation. Always
url_citation.const URLCitationURLCitation URLCitation = "url_citation"
-
URL stringThe URL of the web resource.
-
-
type ResponseOutputTextAnnotationContainerFileCitation struct{…}A citation for a container file used to generate a model response.
-
ContainerID stringThe ID of the container file.
-
EndIndex int64The index of the last character of the container file citation in the message.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the container file cited.
-
StartIndex int64The index of the first character of the container file citation in the message.
-
Type ContainerFileCitationThe type of the container file citation. Always
container_file_citation.const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"
-
-
type ResponseOutputTextAnnotationFilePath struct{…}A path to a file.
-
FileID stringThe ID of the file.
-
Index int64The index of the file in the list of files.
-
Type FilePathThe type of the file path. Always
file_path.const FilePathFilePath FilePath = "file_path"
-
-
-
Text stringThe text output from the model.
-
Type OutputTextThe type of the output text. Always
output_text.const OutputTextOutputText OutputText = "output_text"
-
Logprobs []ResponseOutputTextLogprob-
Token string -
Bytes []int64 -
Logprob float64 -
TopLogprobs []ResponseOutputTextLogprobTopLogprob-
Token string -
Bytes []int64 -
Logprob float64
-
-
-
-
type ResponseOutputRefusal struct{…}A refusal from the model.
-
Refusal stringThe refusal explanation from the model.
-
Type RefusalThe type of the refusal. Always
refusal.const RefusalRefusal Refusal = "refusal"
-
-
-
Role AssistantThe role of the output message. Always
assistant.const AssistantAssistant Assistant = "assistant"
-
Status ResponseOutputMessageStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseOutputMessageStatusInProgress ResponseOutputMessageStatus = "in_progress" -
const ResponseOutputMessageStatusCompleted ResponseOutputMessageStatus = "completed" -
const ResponseOutputMessageStatusIncomplete ResponseOutputMessageStatus = "incomplete"
-
-
Type MessageThe type of the output message. Always
message.const MessageMessage Message = "message"
-
Phase ResponseOutputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const ResponseOutputMessagePhaseCommentary ResponseOutputMessagePhase = "commentary" -
const ResponseOutputMessagePhaseFinalAnswer ResponseOutputMessagePhase = "final_answer"
-
-
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
ID stringThe unique ID of the file search tool call.
-
Queries []stringThe queries used to search for files.
-
Status ResponseFileSearchToolCallStatusThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
const ResponseFileSearchToolCallStatusInProgress ResponseFileSearchToolCallStatus = "in_progress" -
const ResponseFileSearchToolCallStatusSearching ResponseFileSearchToolCallStatus = "searching" -
const ResponseFileSearchToolCallStatusCompleted ResponseFileSearchToolCallStatus = "completed" -
const ResponseFileSearchToolCallStatusIncomplete ResponseFileSearchToolCallStatus = "incomplete" -
const ResponseFileSearchToolCallStatusFailed ResponseFileSearchToolCallStatus = "failed"
-
-
Type FileSearchCallThe type of the file search tool call. Always
file_search_call.const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"
-
Results []ResponseFileSearchToolCallResultThe results of the file search tool call.
-
Attributes map[string, ResponseFileSearchToolCallResultAttributeUnion]Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.
-
string -
float64 -
bool
-
-
FileID stringThe unique ID of the file.
-
Filename stringThe name of the file.
-
Score float64The relevance score of the file - a value between 0 and 1.
-
Text stringThe text that was retrieved from the file.
-
-
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
ID stringThe unique ID of the computer call.
-
CallID stringAn identifier used when responding to the tool call with output.
-
PendingSafetyChecks []ResponseComputerToolCallPendingSafetyCheckThe pending safety checks for the computer call.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status ResponseComputerToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseComputerToolCallStatusInProgress ResponseComputerToolCallStatus = "in_progress" -
const ResponseComputerToolCallStatusCompleted ResponseComputerToolCallStatus = "completed" -
const ResponseComputerToolCallStatusIncomplete ResponseComputerToolCallStatus = "incomplete"
-
-
Type ResponseComputerToolCallTypeThe type of the computer call. Always
computer_call.const ResponseComputerToolCallTypeComputerCall ResponseComputerToolCallType = "computer_call"
-
Action ResponseComputerToolCallActionUnionA click action.
-
type ResponseComputerToolCallActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ResponseComputerToolCallActionClickButtonLeft ResponseComputerToolCallActionClickButton = "left" -
const ResponseComputerToolCallActionClickButtonRight ResponseComputerToolCallActionClickButton = "right" -
const ResponseComputerToolCallActionClickButtonWheel ResponseComputerToolCallActionClickButton = "wheel" -
const ResponseComputerToolCallActionClickButtonBack ResponseComputerToolCallActionClickButton = "back" -
const ResponseComputerToolCallActionClickButtonForward ResponseComputerToolCallActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ResponseComputerToolCallActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ResponseComputerToolCallActionDrag struct{…}A drag action.
-
Path []ResponseComputerToolCallActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ResponseComputerToolCallActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ResponseComputerToolCallActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ResponseComputerToolCallActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ResponseComputerToolCallActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ResponseComputerToolCallActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ResponseComputerToolCallActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
Actions ComputerActionListFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
type ComputerActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ComputerActionClickButtonLeft ComputerActionClickButton = "left" -
const ComputerActionClickButtonRight ComputerActionClickButton = "right" -
const ComputerActionClickButtonWheel ComputerActionClickButton = "wheel" -
const ComputerActionClickButtonBack ComputerActionClickButton = "back" -
const ComputerActionClickButtonForward ComputerActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ComputerActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ComputerActionDrag struct{…}A drag action.
-
Path []ComputerActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ComputerActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ComputerActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ComputerActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ComputerActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ComputerActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ComputerActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
-
type ResponseInputItemComputerCallOutput struct{…}The output of a computer tool call.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Type ComputerScreenshotSpecifies the event type. For a computer screenshot, this property is always set to
computer_screenshot.const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"
-
FileID stringThe identifier of an uploaded file that contains the screenshot.
-
ImageURL stringThe URL of the screenshot image.
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
ID stringThe ID of the computer tool call output.
-
AcknowledgedSafetyChecks []ResponseInputItemComputerCallOutputAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status stringThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseInputItemComputerCallOutputStatusInProgress ResponseInputItemComputerCallOutputStatus = "in_progress" -
const ResponseInputItemComputerCallOutputStatusCompleted ResponseInputItemComputerCallOutputStatus = "completed" -
const ResponseInputItemComputerCallOutputStatusIncomplete ResponseInputItemComputerCallOutputStatus = "incomplete"
-
-
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
ID stringThe unique ID of the web search tool call.
-
Action ResponseFunctionWebSearchActionUnionAn object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
type ResponseFunctionWebSearchActionSearch struct{…}Action type "search" - Performs a web search query.
-
Type SearchThe action type.
const SearchSearch Search = "search"
-
Queries []stringThe search queries.
-
Query stringThe search query.
-
Sources []ResponseFunctionWebSearchActionSearchSourceThe sources used in the search.
-
Type URLThe type of source. Always
url.const URLURL URL = "url"
-
URL stringThe URL of the source.
-
-
-
type ResponseFunctionWebSearchActionOpenPage struct{…}Action type "open_page" - Opens a specific URL from search results.
-
Type OpenPageThe action type.
const OpenPageOpenPage OpenPage = "open_page"
-
URL stringThe URL opened by the model.
-
-
type ResponseFunctionWebSearchActionFindInPage struct{…}Action type "find_in_page": Searches for a pattern within a loaded page.
-
Pattern stringThe pattern or text to search for within the page.
-
Type FindInPageThe action type.
const FindInPageFindInPage FindInPage = "find_in_page"
-
URL stringThe URL of the page searched for the pattern.
-
-
-
Status ResponseFunctionWebSearchStatusThe status of the web search tool call.
-
const ResponseFunctionWebSearchStatusInProgress ResponseFunctionWebSearchStatus = "in_progress" -
const ResponseFunctionWebSearchStatusSearching ResponseFunctionWebSearchStatus = "searching" -
const ResponseFunctionWebSearchStatusCompleted ResponseFunctionWebSearchStatus = "completed" -
const ResponseFunctionWebSearchStatusFailed ResponseFunctionWebSearchStatus = "failed"
-
-
Type WebSearchCallThe type of the web search tool call. Always
web_search_call.const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"
-
-
type ResponseFunctionToolCall struct{…}A tool call to run a function. See the function calling guide for more information.
-
Arguments stringA JSON string of the arguments to pass to the function.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Name stringThe name of the function to run.
-
Type FunctionCallThe type of the function tool call. Always
function_call.const FunctionCallFunctionCall FunctionCall = "function_call"
-
ID stringThe unique ID of the function tool call.
-
Namespace stringThe namespace of the function to run.
-
Status ResponseFunctionToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallStatusInProgress ResponseFunctionToolCallStatus = "in_progress" -
const ResponseFunctionToolCallStatusCompleted ResponseFunctionToolCallStatus = "completed" -
const ResponseFunctionToolCallStatusIncomplete ResponseFunctionToolCallStatus = "incomplete"
-
-
-
type ResponseInputItemFunctionCallOutput struct{…}The output of a function tool call.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseInputItemFunctionCallOutputOutputUnionText, image, or file output of the function tool call.
-
string -
type ResponseFunctionCallOutputItemList []ResponseFunctionCallOutputItemUnionAn array of content outputs (text, image, file) for the function tool call.
-
type ResponseInputTextContent struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImageContent struct{…}An image input to the model. Learn about image inputs
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
Detail ResponseInputImageContentDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageContentDetailLow ResponseInputImageContentDetail = "low" -
const ResponseInputImageContentDetailHigh ResponseInputImageContentDetail = "high" -
const ResponseInputImageContentDetailAuto ResponseInputImageContentDetail = "auto" -
const ResponseInputImageContentDetailOriginal ResponseInputImageContentDetail = "original"
-
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFileContent struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileContentDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileContentDetailLow ResponseInputFileContentDetail = "low" -
const ResponseInputFileContentDetailHigh ResponseInputFileContentDetail = "high"
-
-
FileData stringThe base64-encoded data of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
ID stringThe unique ID of the function tool call output. Populated when this item is returned via API.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputItemFunctionCallOutputStatusInProgress ResponseInputItemFunctionCallOutputStatus = "in_progress" -
const ResponseInputItemFunctionCallOutputStatusCompleted ResponseInputItemFunctionCallOutputStatus = "completed" -
const ResponseInputItemFunctionCallOutputStatusIncomplete ResponseInputItemFunctionCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemToolSearchCall struct{…}-
Arguments anyThe arguments supplied to the tool search call.
-
Type ToolSearchCallThe item type. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
ID stringThe unique ID of this tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution stringWhether tool search was executed by the server or by the client.
-
const ResponseInputItemToolSearchCallExecutionServer ResponseInputItemToolSearchCallExecution = "server" -
const ResponseInputItemToolSearchCallExecutionClient ResponseInputItemToolSearchCallExecution = "client"
-
-
Status stringThe status of the tool search call.
-
const ResponseInputItemToolSearchCallStatusInProgress ResponseInputItemToolSearchCallStatus = "in_progress" -
const ResponseInputItemToolSearchCallStatusCompleted ResponseInputItemToolSearchCallStatus = "completed" -
const ResponseInputItemToolSearchCallStatusIncomplete ResponseInputItemToolSearchCallStatus = "incomplete"
-
-
-
type ResponseToolSearchOutputItemParamResp struct{…}-
Tools []ToolUnionThe loaded tool definitions returned by the tool search output.
-
type FunctionTool struct{…}Defines a function in your own code the model can choose to call. Learn more about function calling.
-
Name stringThe name of the function to call.
-
Parameters map[string, any]A JSON schema object describing the parameters of the function.
-
Strict boolWhether to enforce strict parameter validation. Default
true. -
Type FunctionThe type of the function tool. Always
function.const FunctionFunction Function = "function"
-
DeferLoading boolWhether this function is deferred and loaded via tool search.
-
Description stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
type FileSearchTool struct{…}A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
Type FileSearchThe type of the file search tool. Always
file_search.const FileSearchFileSearch FileSearch = "file_search"
-
VectorStoreIDs []stringThe IDs of the vector stores to search.
-
Filters FileSearchToolFiltersUnionA filter to apply.
-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
Key stringThe key to compare against the value.
-
Type ComparisonFilterTypeSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
const ComparisonFilterTypeEq ComparisonFilterType = "eq" -
const ComparisonFilterTypeNe ComparisonFilterType = "ne" -
const ComparisonFilterTypeGt ComparisonFilterType = "gt" -
const ComparisonFilterTypeGte ComparisonFilterType = "gte" -
const ComparisonFilterTypeLt ComparisonFilterType = "lt" -
const ComparisonFilterTypeLte ComparisonFilterType = "lte" -
const ComparisonFilterTypeIn ComparisonFilterType = "in" -
const ComparisonFilterTypeNin ComparisonFilterType = "nin"
-
-
Value ComparisonFilterValueUnionThe value to compare against the attribute key; supports string, number, or boolean types.
-
string -
float64 -
bool -
type ComparisonFilterValueArray []ComparisonFilterValueArrayItemUnion-
string -
float64
-
-
-
-
type CompoundFilter struct{…}Combine multiple filters using
andoror.-
Filters []ComparisonFilterArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
-
Type CompoundFilterTypeType of operation:
andoror.-
const CompoundFilterTypeAnd CompoundFilterType = "and" -
const CompoundFilterTypeOr CompoundFilterType = "or"
-
-
-
-
MaxNumResults int64The maximum number of results to return. This number should be between 1 and 50 inclusive.
-
RankingOptions FileSearchToolRankingOptionsRanking options for search.
-
HybridSearch FileSearchToolRankingOptionsHybridSearchWeights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
EmbeddingWeight float64The weight of the embedding in the reciprocal ranking fusion.
-
TextWeight float64The weight of the text in the reciprocal ranking fusion.
-
-
Ranker stringThe ranker to use for the file search.
-
const FileSearchToolRankingOptionsRankerAuto FileSearchToolRankingOptionsRanker = "auto" -
const FileSearchToolRankingOptionsRankerDefault2024_11_15 FileSearchToolRankingOptionsRanker = "default-2024-11-15"
-
-
ScoreThreshold float64The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
Type ComputerThe type of the computer tool. Always
computer.const ComputerComputer Computer = "computer"
-
-
type ComputerUsePreviewTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
DisplayHeight int64The height of the computer display.
-
DisplayWidth int64The width of the computer display.
-
Environment ComputerUsePreviewToolEnvironmentThe type of computer environment to control.
-
const ComputerUsePreviewToolEnvironmentWindows ComputerUsePreviewToolEnvironment = "windows" -
const ComputerUsePreviewToolEnvironmentMac ComputerUsePreviewToolEnvironment = "mac" -
const ComputerUsePreviewToolEnvironmentLinux ComputerUsePreviewToolEnvironment = "linux" -
const ComputerUsePreviewToolEnvironmentUbuntu ComputerUsePreviewToolEnvironment = "ubuntu" -
const ComputerUsePreviewToolEnvironmentBrowser ComputerUsePreviewToolEnvironment = "browser"
-
-
Type ComputerUsePreviewThe type of the computer use tool. Always
computer_use_preview.const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"
-
-
type WebSearchTool struct{…}Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
Type WebSearchToolTypeThe type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
const WebSearchToolTypeWebSearch WebSearchToolType = "web_search" -
const WebSearchToolTypeWebSearch2025_08_26 WebSearchToolType = "web_search_2025_08_26"
-
-
Filters WebSearchToolFiltersFilters for the search.
-
AllowedDomains []stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
SearchContextSize WebSearchToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchToolSearchContextSizeLow WebSearchToolSearchContextSize = "low" -
const WebSearchToolSearchContextSizeMedium WebSearchToolSearchContextSize = "medium" -
const WebSearchToolSearchContextSizeHigh WebSearchToolSearchContextSize = "high"
-
-
UserLocation WebSearchToolUserLocationThe approximate location of the user.
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
Type stringThe type of location approximation. Always
approximate.const WebSearchToolUserLocationTypeApproximate WebSearchToolUserLocationType = "approximate"
-
-
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
ServerLabel stringA label for this MCP server, used to identify it in tool calls.
-
Type McpThe type of the MCP tool. Always
mcp.const McpMcp Mcp = "mcp"
-
AllowedTools ToolMcpAllowedToolsUnionList of allowed tool names or a filter object.
-
type ToolMcpAllowedToolsMcpAllowedTools []stringA string array of allowed tool names
-
type ToolMcpAllowedToolsMcpToolFilter struct{…}A filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
Authorization stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
ConnectorID stringIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
const ToolMcpConnectorIDConnectorDropbox ToolMcpConnectorID = "connector_dropbox" -
const ToolMcpConnectorIDConnectorGmail ToolMcpConnectorID = "connector_gmail" -
const ToolMcpConnectorIDConnectorGooglecalendar ToolMcpConnectorID = "connector_googlecalendar" -
const ToolMcpConnectorIDConnectorGoogledrive ToolMcpConnectorID = "connector_googledrive" -
const ToolMcpConnectorIDConnectorMicrosoftteams ToolMcpConnectorID = "connector_microsoftteams" -
const ToolMcpConnectorIDConnectorOutlookcalendar ToolMcpConnectorID = "connector_outlookcalendar" -
const ToolMcpConnectorIDConnectorOutlookemail ToolMcpConnectorID = "connector_outlookemail" -
const ToolMcpConnectorIDConnectorSharepoint ToolMcpConnectorID = "connector_sharepoint"
-
-
DeferLoading boolWhether this MCP tool is deferred and discovered via tool search.
-
Headers map[string, string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
RequireApproval ToolMcpRequireApprovalUnionSpecify which of the MCP server's tools require approval.
-
type ToolMcpRequireApprovalMcpToolApprovalFilter 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.-
Always ToolMcpRequireApprovalMcpToolApprovalFilterAlwaysA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
Never ToolMcpRequireApprovalMcpToolApprovalFilterNeverA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
type ToolMcpRequireApprovalMcpToolApprovalSetting stringSpecify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
const ToolMcpRequireApprovalMcpToolApprovalSettingAlways ToolMcpRequireApprovalMcpToolApprovalSetting = "always" -
const ToolMcpRequireApprovalMcpToolApprovalSettingNever ToolMcpRequireApprovalMcpToolApprovalSetting = "never"
-
-
-
ServerDescription stringOptional description of the MCP server, used to provide more context.
-
ServerURL stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
TunnelID stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
Container ToolCodeInterpreterContainerUnionThe code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
string -
type ToolCodeInterpreterContainerCodeInterpreterContainerAuto struct{…}Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
Type AutoAlways
auto.const AutoAuto Auto = "auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit stringThe memory limit for the code interpreter container.
-
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"
-
-
NetworkPolicy ToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…}-
Type DisabledDisable outbound network access. Always
disabled.const DisabledDisabled Disabled = "disabled"
-
-
type ContainerNetworkPolicyAllowlist struct{…}-
AllowedDomains []stringA list of allowed domains when type is
allowlist. -
Type AllowlistAllow outbound network access only to specified domains. Always
allowlist.const AllowlistAllowlist Allowlist = "allowlist"
-
DomainSecrets []ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
Domain stringThe domain associated with the secret.
-
Name stringThe name of the secret to inject for the domain.
-
Value stringThe secret value to inject for the domain.
-
-
-
-
-
-
Type CodeInterpreterThe type of the code interpreter tool. Always
code_interpreter.const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"
-
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
Type ImageGenerationThe type of the image generation tool. Always
image_generation.const ImageGenerationImageGeneration ImageGeneration = "image_generation"
-
Action stringWhether to generate a new image or edit an existing image. Default:
auto.-
const ToolImageGenerationActionGenerate ToolImageGenerationAction = "generate" -
const ToolImageGenerationActionEdit ToolImageGenerationAction = "edit" -
const ToolImageGenerationActionAuto ToolImageGenerationAction = "auto"
-
-
Background stringAllows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
const ToolImageGenerationBackgroundTransparent ToolImageGenerationBackground = "transparent" -
const ToolImageGenerationBackgroundOpaque ToolImageGenerationBackground = "opaque" -
const ToolImageGenerationBackgroundAuto ToolImageGenerationBackground = "auto"
-
-
InputFidelity stringControl how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
const ToolImageGenerationInputFidelityHigh ToolImageGenerationInputFidelity = "high" -
const ToolImageGenerationInputFidelityLow ToolImageGenerationInputFidelity = "low"
-
-
InputImageMask ToolImageGenerationInputImageMaskOptional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
FileID stringFile ID for the mask image.
-
ImageURL stringBase64-encoded mask image.
-
-
Model stringThe image generation model to use. Default:
gpt-image-1.-
string -
string-
const ToolImageGenerationModelGPTImage1 ToolImageGenerationModel = "gpt-image-1" -
const ToolImageGenerationModelGPTImage1Mini ToolImageGenerationModel = "gpt-image-1-mini" -
const ToolImageGenerationModelGPTImage2 ToolImageGenerationModel = "gpt-image-2" -
const ToolImageGenerationModelGPTImage2_2026_04_21 ToolImageGenerationModel = "gpt-image-2-2026-04-21" -
const ToolImageGenerationModelGPTImage1_5 ToolImageGenerationModel = "gpt-image-1.5" -
const ToolImageGenerationModelChatgptImageLatest ToolImageGenerationModel = "chatgpt-image-latest"
-
-
-
Moderation stringModeration level for the generated image. Default:
auto.-
const ToolImageGenerationModerationAuto ToolImageGenerationModeration = "auto" -
const ToolImageGenerationModerationLow ToolImageGenerationModeration = "low"
-
-
OutputCompression int64Compression level for the output image. Default: 100.
-
OutputFormat stringThe output format of the generated image. One of
png,webp, orjpeg. Default:png.-
const ToolImageGenerationOutputFormatPNG ToolImageGenerationOutputFormat = "png" -
const ToolImageGenerationOutputFormatWebP ToolImageGenerationOutputFormat = "webp" -
const ToolImageGenerationOutputFormatJPEG ToolImageGenerationOutputFormat = "jpeg"
-
-
PartialImages int64Number of partial images to generate in streaming mode, from 0 (default value) to 3.
-
Quality stringThe quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
const ToolImageGenerationQualityLow ToolImageGenerationQuality = "low" -
const ToolImageGenerationQualityMedium ToolImageGenerationQuality = "medium" -
const ToolImageGenerationQualityHigh ToolImageGenerationQuality = "high" -
const ToolImageGenerationQualityAuto ToolImageGenerationQuality = "auto"
-
-
Size stringThe size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
string -
string-
const ToolImageGenerationSize1024x1024 ToolImageGenerationSize = "1024x1024" -
const ToolImageGenerationSize1024x1536 ToolImageGenerationSize = "1024x1536" -
const ToolImageGenerationSize1536x1024 ToolImageGenerationSize = "1536x1024" -
const ToolImageGenerationSizeAuto ToolImageGenerationSize = "auto"
-
-
-
-
type ToolLocalShell struct{…}A tool that allows the model to execute shell commands in a local environment.
-
Type LocalShellThe type of the local shell tool. Always
local_shell.const LocalShellLocalShell LocalShell = "local_shell"
-
-
type FunctionShellTool struct{…}A tool that allows the model to execute shell commands.
-
Type ShellThe type of the shell tool. Always
shell.const ShellShell Shell = "shell"
-
Environment FunctionShellToolEnvironmentUnion-
type ContainerAuto struct{…}-
Type ContainerAutoAutomatically creates a container for this request
const ContainerAutoContainerAuto ContainerAuto = "container_auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit ContainerAutoMemoryLimitThe memory limit for the container.
-
const ContainerAutoMemoryLimit1g ContainerAutoMemoryLimit = "1g" -
const ContainerAutoMemoryLimit4g ContainerAutoMemoryLimit = "4g" -
const ContainerAutoMemoryLimit16g ContainerAutoMemoryLimit = "16g" -
const ContainerAutoMemoryLimit64g ContainerAutoMemoryLimit = "64g"
-
-
NetworkPolicy ContainerAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…} -
type ContainerNetworkPolicyAllowlist struct{…}
-
-
Skills []ContainerAutoSkillUnionAn optional list of skills referenced by id or inline data.
-
type SkillReference struct{…}-
SkillID stringThe ID of the referenced skill.
-
Type SkillReferenceReferences a skill created with the /v1/skills endpoint.
const SkillReferenceSkillReference SkillReference = "skill_reference"
-
Version stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
type InlineSkill struct{…}-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Source InlineSkillSourceInline skill payload
-
Data stringBase64-encoded skill zip bundle.
-
MediaType ApplicationZipThe media type of the inline skill payload. Must be
application/zip.const ApplicationZipApplicationZip ApplicationZip = "application/zip"
-
Type Base64The type of the inline skill source. Must be
base64.const Base64Base64 Base64 = "base64"
-
-
Type InlineDefines an inline skill for this request.
const InlineInline Inline = "inline"
-
-
-
-
type LocalEnvironment struct{…}-
Type LocalUse a local computer environment.
const LocalLocal Local = "local"
-
Skills []LocalSkillAn optional list of skills.
-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Path stringThe path to the directory containing the skill.
-
-
-
type ContainerReference struct{…}-
ContainerID stringThe ID of the referenced container.
-
Type ContainerReferenceReferences a container created with the /v1/containers endpoint
const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
Name stringThe name of the custom tool, used to identify it in tool calls.
-
Type CustomThe type of the custom tool. Always
custom.const CustomCustom Custom = "custom"
-
DeferLoading boolWhether this tool should be deferred and discovered via tool search.
-
Description stringOptional description of the custom tool, used to provide more context.
-
Format CustomToolInputFormatUnionThe input format for the custom tool. Default is unconstrained text.
-
type CustomToolInputFormatText struct{…}Unconstrained free-form text.
-
Type TextUnconstrained text format. Always
text.const TextText Text = "text"
-
-
type CustomToolInputFormatGrammar struct{…}A grammar defined by the user.
-
Definition stringThe grammar definition.
-
Syntax stringThe syntax of the grammar definition. One of
larkorregex.-
const CustomToolInputFormatGrammarSyntaxLark CustomToolInputFormatGrammarSyntax = "lark" -
const CustomToolInputFormatGrammarSyntaxRegex CustomToolInputFormatGrammarSyntax = "regex"
-
-
Type GrammarGrammar format. Always
grammar.const GrammarGrammar Grammar = "grammar"
-
-
-
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
Description stringA description of the namespace shown to the model.
-
Name stringThe namespace name used in tool calls (for example,
crm). -
Tools []NamespaceToolToolUnionThe function/custom tools available inside this namespace.
-
type NamespaceToolToolFunction struct{…}-
Name string -
Type Functionconst FunctionFunction Function = "function"
-
DeferLoading boolWhether this function should be deferred and discovered via tool search.
-
Description string -
Parameters any -
Strict bool
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
-
Type NamespaceThe type of the tool. Always
namespace.const NamespaceNamespace Namespace = "namespace"
-
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
Type ToolSearchThe type of the tool. Always
tool_search.const ToolSearchToolSearch ToolSearch = "tool_search"
-
Description stringDescription shown to the model for a client-executed tool search tool.
-
Execution ToolSearchToolExecutionWhether tool search is executed by the server or by the client.
-
const ToolSearchToolExecutionServer ToolSearchToolExecution = "server" -
const ToolSearchToolExecutionClient ToolSearchToolExecution = "client"
-
-
Parameters anyParameter schema for a client-executed tool search tool.
-
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
Type WebSearchPreviewToolTypeThe type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
const WebSearchPreviewToolTypeWebSearchPreview WebSearchPreviewToolType = "web_search_preview" -
const WebSearchPreviewToolTypeWebSearchPreview2025_03_11 WebSearchPreviewToolType = "web_search_preview_2025_03_11"
-
-
SearchContentTypes []string-
const WebSearchPreviewToolSearchContentTypeText WebSearchPreviewToolSearchContentType = "text" -
const WebSearchPreviewToolSearchContentTypeImage WebSearchPreviewToolSearchContentType = "image"
-
-
SearchContextSize WebSearchPreviewToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchPreviewToolSearchContextSizeLow WebSearchPreviewToolSearchContextSize = "low" -
const WebSearchPreviewToolSearchContextSizeMedium WebSearchPreviewToolSearchContextSize = "medium" -
const WebSearchPreviewToolSearchContextSizeHigh WebSearchPreviewToolSearchContextSize = "high"
-
-
UserLocation WebSearchPreviewToolUserLocationThe user's location.
-
Type ApproximateThe type of location approximation. Always
approximate.const ApproximateApproximate Approximate = "approximate"
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
Type ApplyPatchThe type of the tool. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
-
Type ToolSearchOutputThe item type. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
ID stringThe unique ID of this tool search output.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemParamExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemParamExecutionServer ResponseToolSearchOutputItemParamExecution = "server" -
const ResponseToolSearchOutputItemParamExecutionClient ResponseToolSearchOutputItemParamExecution = "client"
-
-
Status ResponseToolSearchOutputItemParamStatusThe status of the tool search output.
-
const ResponseToolSearchOutputItemParamStatusInProgress ResponseToolSearchOutputItemParamStatus = "in_progress" -
const ResponseToolSearchOutputItemParamStatusCompleted ResponseToolSearchOutputItemParamStatus = "completed" -
const ResponseToolSearchOutputItemParamStatusIncomplete ResponseToolSearchOutputItemParamStatus = "incomplete"
-
-
-
type ResponseInputItemAdditionalTools struct{…}-
Role DeveloperThe role that provided the additional tools. Only
developeris supported.const DeveloperDeveloper Developer = "developer"
-
Tools []ToolUnionA list of additional tools made available at this item.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type AdditionalToolsThe item type. Always
additional_tools.const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"
-
ID stringThe unique ID of this additional tools item.
-
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
ID stringThe unique identifier of the reasoning content.
-
Summary []ResponseReasoningItemSummaryReasoning summary content.
-
Text stringA summary of the reasoning output from the model so far.
-
Type SummaryTextThe type of the object. Always
summary_text.const SummaryTextSummaryText SummaryText = "summary_text"
-
-
Type ReasoningThe type of the object. Always
reasoning.const ReasoningReasoning Reasoning = "reasoning"
-
Content []ResponseReasoningItemContentReasoning text content.
-
Text stringThe reasoning text from the model.
-
Type ReasoningTextThe type of the reasoning text. Always
reasoning_text.const ReasoningTextReasoningText ReasoningText = "reasoning_text"
-
-
EncryptedContent stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
Status ResponseReasoningItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseReasoningItemStatusInProgress ResponseReasoningItemStatus = "in_progress" -
const ResponseReasoningItemStatusCompleted ResponseReasoningItemStatus = "completed" -
const ResponseReasoningItemStatusIncomplete ResponseReasoningItemStatus = "incomplete"
-
-
-
type ResponseCompactionItemParamResp struct{…}A compaction item generated by the
v1/responses/compactAPI.-
EncryptedContent stringThe encrypted content of the compaction summary.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
ID stringThe ID of the compaction item.
-
-
type ResponseInputItemImageGenerationCall struct{…}An image generation request made by the model.
-
ID stringThe unique ID of the image generation call.
-
Result stringThe generated image encoded in base64.
-
Status stringThe status of the image generation call.
-
const ResponseInputItemImageGenerationCallStatusInProgress ResponseInputItemImageGenerationCallStatus = "in_progress" -
const ResponseInputItemImageGenerationCallStatusCompleted ResponseInputItemImageGenerationCallStatus = "completed" -
const ResponseInputItemImageGenerationCallStatusGenerating ResponseInputItemImageGenerationCallStatus = "generating" -
const ResponseInputItemImageGenerationCallStatusFailed ResponseInputItemImageGenerationCallStatus = "failed"
-
-
Type ImageGenerationCallThe type of the image generation call. Always
image_generation_call.const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"
-
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
ID stringThe unique ID of the code interpreter tool call.
-
Code stringThe code to run, or null if not available.
-
ContainerID stringThe ID of the container used to run the code.
-
Outputs []ResponseCodeInterpreterToolCallOutputUnionThe outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
type ResponseCodeInterpreterToolCallOutputLogs struct{…}The logs output from the code interpreter.
-
Logs stringThe logs output from the code interpreter.
-
Type LogsThe type of the output. Always
logs.const LogsLogs Logs = "logs"
-
-
type ResponseCodeInterpreterToolCallOutputImage struct{…}The image output from the code interpreter.
-
Type ImageThe type of the output. Always
image.const ImageImage Image = "image"
-
URL stringThe URL of the image output from the code interpreter.
-
-
-
Status ResponseCodeInterpreterToolCallStatusThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
const ResponseCodeInterpreterToolCallStatusInProgress ResponseCodeInterpreterToolCallStatus = "in_progress" -
const ResponseCodeInterpreterToolCallStatusCompleted ResponseCodeInterpreterToolCallStatus = "completed" -
const ResponseCodeInterpreterToolCallStatusIncomplete ResponseCodeInterpreterToolCallStatus = "incomplete" -
const ResponseCodeInterpreterToolCallStatusInterpreting ResponseCodeInterpreterToolCallStatus = "interpreting" -
const ResponseCodeInterpreterToolCallStatusFailed ResponseCodeInterpreterToolCallStatus = "failed"
-
-
Type CodeInterpreterCallThe type of the code interpreter tool call. Always
code_interpreter_call.const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"
-
-
type ResponseInputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
ID stringThe unique ID of the local shell call.
-
Action ResponseInputItemLocalShellCallActionExecute a shell command on the server.
-
Command []stringThe command to run.
-
Env map[string, string]Environment variables to set for the command.
-
Type ExecThe type of the local shell action. Always
exec.const ExecExec Exec = "exec"
-
TimeoutMs int64Optional timeout in milliseconds for the command.
-
User stringOptional user to run the command as.
-
WorkingDirectory stringOptional working directory to run the command in.
-
-
CallID stringThe unique ID of the local shell tool call generated by the model.
-
Status stringThe status of the local shell call.
-
const ResponseInputItemLocalShellCallStatusInProgress ResponseInputItemLocalShellCallStatus = "in_progress" -
const ResponseInputItemLocalShellCallStatusCompleted ResponseInputItemLocalShellCallStatus = "completed" -
const ResponseInputItemLocalShellCallStatusIncomplete ResponseInputItemLocalShellCallStatus = "incomplete"
-
-
Type LocalShellCallThe type of the local shell call. Always
local_shell_call.const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"
-
-
type ResponseInputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
ID stringThe unique ID of the local shell tool call generated by the model.
-
Output stringA JSON string of the output of the local shell tool call.
-
Type LocalShellCallOutputThe type of the local shell tool call output. Always
local_shell_call_output.const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete.-
const ResponseInputItemLocalShellCallOutputStatusInProgress ResponseInputItemLocalShellCallOutputStatus = "in_progress" -
const ResponseInputItemLocalShellCallOutputStatusCompleted ResponseInputItemLocalShellCallOutputStatus = "completed" -
const ResponseInputItemLocalShellCallOutputStatusIncomplete ResponseInputItemLocalShellCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemShellCall struct{…}A tool representing a request to execute one or more shell commands.
-
Action ResponseInputItemShellCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []stringOrdered shell commands for the execution environment to run.
-
MaxOutputLength int64Maximum number of UTF-8 characters to capture from combined stdout and stderr output.
-
TimeoutMs int64Maximum wall-clock time in milliseconds to allow the shell commands to run.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Environment ResponseInputItemShellCallEnvironmentUnionThe environment to execute the shell commands in.
-
type LocalEnvironment struct{…} -
type ContainerReference struct{…}
-
-
Status stringThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseInputItemShellCallStatusInProgress ResponseInputItemShellCallStatus = "in_progress" -
const ResponseInputItemShellCallStatusCompleted ResponseInputItemShellCallStatus = "completed" -
const ResponseInputItemShellCallStatusIncomplete ResponseInputItemShellCallStatus = "incomplete"
-
-
-
type ResponseInputItemShellCallOutput struct{…}The streamed output items emitted by a shell tool call.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Output []ResponseFunctionShellCallOutputContentCaptured chunks of stdout and stderr output, along with their associated outcomes.
-
Outcome ResponseFunctionShellCallOutputContentOutcomeUnionThe exit or timeout outcome associated with this shell call.
-
type ResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellCallOutputContentOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64The exit code returned by the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringCaptured stderr output for the shell call.
-
Stdout stringCaptured stdout output for the shell call.
-
-
Type ShellCallOutputThe type of the item. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
ID stringThe unique ID of the shell tool call output. Populated when this item is returned via API.
-
MaxOutputLength int64The maximum number of UTF-8 characters captured for this shell call's combined output.
-
Status stringThe status of the shell call output.
-
const ResponseInputItemShellCallOutputStatusInProgress ResponseInputItemShellCallOutputStatus = "in_progress" -
const ResponseInputItemShellCallOutputStatusCompleted ResponseInputItemShellCallOutputStatus = "completed" -
const ResponseInputItemShellCallOutputStatusIncomplete ResponseInputItemShellCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemApplyPatchCall struct{…}A tool call representing a request to create, delete, or update files using diff patches.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseInputItemApplyPatchCallOperationUnionThe specific create, delete, or update instruction for the apply_patch tool call.
-
type ResponseInputItemApplyPatchCallOperationCreateFile struct{…}Instruction for creating a new file via the apply_patch tool.
-
Diff stringUnified diff content to apply when creating the file.
-
Path stringPath of the file to create relative to the workspace root.
-
Type CreateFileThe operation type. Always
create_file.const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseInputItemApplyPatchCallOperationDeleteFile struct{…}Instruction for deleting an existing file via the apply_patch tool.
-
Path stringPath of the file to delete relative to the workspace root.
-
Type DeleteFileThe operation type. Always
delete_file.const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseInputItemApplyPatchCallOperationUpdateFile struct{…}Instruction for updating an existing file via the apply_patch tool.
-
Diff stringUnified diff content to apply to the existing file.
-
Path stringPath of the file to update relative to the workspace root.
-
Type UpdateFileThe operation type. Always
update_file.const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status stringThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseInputItemApplyPatchCallStatusInProgress ResponseInputItemApplyPatchCallStatus = "in_progress" -
const ResponseInputItemApplyPatchCallStatusCompleted ResponseInputItemApplyPatchCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
-
type ResponseInputItemApplyPatchCallOutput struct{…}The streamed output emitted by an apply patch tool call.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status stringThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseInputItemApplyPatchCallOutputStatusCompleted ResponseInputItemApplyPatchCallOutputStatus = "completed" -
const ResponseInputItemApplyPatchCallOutputStatusFailed ResponseInputItemApplyPatchCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
Output stringOptional human-readable log text from the apply patch tool (e.g., patch results or errors).
-
-
type ResponseInputItemMcpListTools struct{…}A list of tools available on an MCP server.
-
ID stringThe unique ID of the list.
-
ServerLabel stringThe label of the MCP server.
-
Tools []ResponseInputItemMcpListToolsToolThe tools available on the server.
-
InputSchema anyThe JSON schema describing the tool's input.
-
Name stringThe name of the tool.
-
Annotations anyAdditional annotations about the tool.
-
Description stringThe description of the tool.
-
-
Type McpListToolsThe type of the item. Always
mcp_list_tools.const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
-
Error stringError message if the server could not list tools.
-
-
type ResponseInputItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
ID stringThe unique ID of the approval request.
-
Arguments stringA JSON string of arguments for the tool.
-
Name stringThe name of the tool to run.
-
ServerLabel stringThe label of the MCP server making the request.
-
Type McpApprovalRequestThe type of the item. Always
mcp_approval_request.const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"
-
-
type ResponseInputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
ApprovalRequestID stringThe ID of the approval request being answered.
-
Approve boolWhether the request was approved.
-
Type McpApprovalResponseThe type of the item. Always
mcp_approval_response.const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
-
ID stringThe unique ID of the approval response
-
Reason stringOptional reason for the decision.
-
-
type ResponseInputItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
ID stringThe unique ID of the tool call.
-
Arguments stringA JSON string of the arguments passed to the tool.
-
Name stringThe name of the tool that was run.
-
ServerLabel stringThe label of the MCP server running the tool.
-
Type McpCallThe type of the item. Always
mcp_call.const McpCallMcpCall McpCall = "mcp_call"
-
ApprovalRequestID stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
Error stringThe error from the tool call, if any.
-
Output stringThe output from the tool call.
-
Status stringThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
const ResponseInputItemMcpCallStatusInProgress ResponseInputItemMcpCallStatus = "in_progress" -
const ResponseInputItemMcpCallStatusCompleted ResponseInputItemMcpCallStatus = "completed" -
const ResponseInputItemMcpCallStatusIncomplete ResponseInputItemMcpCallStatus = "incomplete" -
const ResponseInputItemMcpCallStatusCalling ResponseInputItemMcpCallStatus = "calling" -
const ResponseInputItemMcpCallStatusFailed ResponseInputItemMcpCallStatus = "failed"
-
-
-
type ResponseCustomToolCallOutput struct{…}The output of a custom tool call from your code, being sent back to the model.
-
CallID stringThe call ID, used to map this custom tool call output to a custom tool call.
-
Output ResponseCustomToolCallOutputOutputUnionThe output from the custom tool call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseCustomToolCallOutputOutputOutputContentList []ResponseCustomToolCallOutputOutputOutputContentListItemUnionText, image, or file output of the custom tool call.
-
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
-
Type CustomToolCallOutputThe type of the custom tool call output. Always
custom_tool_call_output.const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"
-
ID stringThe unique ID of the custom tool call output in the OpenAI platform.
-
-
type ResponseCustomToolCall struct{…}A call to a custom tool created by the model.
-
CallID stringAn identifier used to map this custom tool call to a tool call output.
-
Input stringThe input for the custom tool call generated by the model.
-
Name stringThe name of the custom tool being called.
-
Type CustomToolCallThe type of the custom tool call. Always
custom_tool_call.const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"
-
ID stringThe unique ID of the custom tool call in the OpenAI platform.
-
Namespace stringThe namespace of the custom tool being called.
-
-
type ResponseInputItemCompactionTrigger struct{…}Compacts the current context. Must be the final input item.
-
Type CompactionTriggerThe type of the item. Always
compaction_trigger.const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"
-
-
type ResponseInputItemItemReference struct{…}An internal identifier for an item to reference.
-
ID stringThe ID of the item to reference.
-
Type stringThe type of item to reference. Always
item_reference.const ResponseInputItemItemReferenceTypeItemReference ResponseInputItemItemReferenceType = "item_reference"
-
-
-
-
Metadata MetadataSet of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
-
Model ResponsesModelModel ID used to generate the response, like
gpt-4ooro3. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models.-
string -
type ChatModel string-
const ChatModelGPT5_4 ChatModel = "gpt-5.4" -
const ChatModelGPT5_4Mini ChatModel = "gpt-5.4-mini" -
const ChatModelGPT5_4Nano ChatModel = "gpt-5.4-nano" -
const ChatModelGPT5_4Mini2026_03_17 ChatModel = "gpt-5.4-mini-2026-03-17" -
const ChatModelGPT5_4Nano2026_03_17 ChatModel = "gpt-5.4-nano-2026-03-17" -
const ChatModelGPT5_3ChatLatest ChatModel = "gpt-5.3-chat-latest" -
const ChatModelGPT5_2 ChatModel = "gpt-5.2" -
const ChatModelGPT5_2_2025_12_11 ChatModel = "gpt-5.2-2025-12-11" -
const ChatModelGPT5_2ChatLatest ChatModel = "gpt-5.2-chat-latest" -
const ChatModelGPT5_2Pro ChatModel = "gpt-5.2-pro" -
const ChatModelGPT5_2Pro2025_12_11 ChatModel = "gpt-5.2-pro-2025-12-11" -
const ChatModelGPT5_1 ChatModel = "gpt-5.1" -
const ChatModelGPT5_1_2025_11_13 ChatModel = "gpt-5.1-2025-11-13" -
const ChatModelGPT5_1Codex ChatModel = "gpt-5.1-codex" -
const ChatModelGPT5_1Mini ChatModel = "gpt-5.1-mini" -
const ChatModelGPT5_1ChatLatest ChatModel = "gpt-5.1-chat-latest" -
const ChatModelGPT5 ChatModel = "gpt-5" -
const ChatModelGPT5Mini ChatModel = "gpt-5-mini" -
const ChatModelGPT5Nano ChatModel = "gpt-5-nano" -
const ChatModelGPT5_2025_08_07 ChatModel = "gpt-5-2025-08-07" -
const ChatModelGPT5Mini2025_08_07 ChatModel = "gpt-5-mini-2025-08-07" -
const ChatModelGPT5Nano2025_08_07 ChatModel = "gpt-5-nano-2025-08-07" -
const ChatModelGPT5ChatLatest ChatModel = "gpt-5-chat-latest" -
const ChatModelGPT4_1 ChatModel = "gpt-4.1" -
const ChatModelGPT4_1Mini ChatModel = "gpt-4.1-mini" -
const ChatModelGPT4_1Nano ChatModel = "gpt-4.1-nano" -
const ChatModelGPT4_1_2025_04_14 ChatModel = "gpt-4.1-2025-04-14" -
const ChatModelGPT4_1Mini2025_04_14 ChatModel = "gpt-4.1-mini-2025-04-14" -
const ChatModelGPT4_1Nano2025_04_14 ChatModel = "gpt-4.1-nano-2025-04-14" -
const ChatModelO4Mini ChatModel = "o4-mini" -
const ChatModelO4Mini2025_04_16 ChatModel = "o4-mini-2025-04-16" -
const ChatModelO3 ChatModel = "o3" -
const ChatModelO3_2025_04_16 ChatModel = "o3-2025-04-16" -
const ChatModelO3Mini ChatModel = "o3-mini" -
const ChatModelO3Mini2025_01_31 ChatModel = "o3-mini-2025-01-31" -
const ChatModelO1 ChatModel = "o1" -
const ChatModelO1_2024_12_17 ChatModel = "o1-2024-12-17" -
const ChatModelO1Preview ChatModel = "o1-preview" -
const ChatModelO1Preview2024_09_12 ChatModel = "o1-preview-2024-09-12" -
const ChatModelO1Mini ChatModel = "o1-mini" -
const ChatModelO1Mini2024_09_12 ChatModel = "o1-mini-2024-09-12" -
const ChatModelGPT4o ChatModel = "gpt-4o" -
const ChatModelGPT4o2024_11_20 ChatModel = "gpt-4o-2024-11-20" -
const ChatModelGPT4o2024_08_06 ChatModel = "gpt-4o-2024-08-06" -
const ChatModelGPT4o2024_05_13 ChatModel = "gpt-4o-2024-05-13" -
const ChatModelGPT4oAudioPreview ChatModel = "gpt-4o-audio-preview" -
const ChatModelGPT4oAudioPreview2024_10_01 ChatModel = "gpt-4o-audio-preview-2024-10-01" -
const ChatModelGPT4oAudioPreview2024_12_17 ChatModel = "gpt-4o-audio-preview-2024-12-17" -
const ChatModelGPT4oAudioPreview2025_06_03 ChatModel = "gpt-4o-audio-preview-2025-06-03" -
const ChatModelGPT4oMiniAudioPreview ChatModel = "gpt-4o-mini-audio-preview" -
const ChatModelGPT4oMiniAudioPreview2024_12_17 ChatModel = "gpt-4o-mini-audio-preview-2024-12-17" -
const ChatModelGPT4oSearchPreview ChatModel = "gpt-4o-search-preview" -
const ChatModelGPT4oMiniSearchPreview ChatModel = "gpt-4o-mini-search-preview" -
const ChatModelGPT4oSearchPreview2025_03_11 ChatModel = "gpt-4o-search-preview-2025-03-11" -
const ChatModelGPT4oMiniSearchPreview2025_03_11 ChatModel = "gpt-4o-mini-search-preview-2025-03-11" -
const ChatModelChatgpt4oLatest ChatModel = "chatgpt-4o-latest" -
const ChatModelCodexMiniLatest ChatModel = "codex-mini-latest" -
const ChatModelGPT4oMini ChatModel = "gpt-4o-mini" -
const ChatModelGPT4oMini2024_07_18 ChatModel = "gpt-4o-mini-2024-07-18" -
const ChatModelGPT4Turbo ChatModel = "gpt-4-turbo" -
const ChatModelGPT4Turbo2024_04_09 ChatModel = "gpt-4-turbo-2024-04-09" -
const ChatModelGPT4_0125Preview ChatModel = "gpt-4-0125-preview" -
const ChatModelGPT4TurboPreview ChatModel = "gpt-4-turbo-preview" -
const ChatModelGPT4_1106Preview ChatModel = "gpt-4-1106-preview" -
const ChatModelGPT4VisionPreview ChatModel = "gpt-4-vision-preview" -
const ChatModelGPT4 ChatModel = "gpt-4" -
const ChatModelGPT4_0314 ChatModel = "gpt-4-0314" -
const ChatModelGPT4_0613 ChatModel = "gpt-4-0613" -
const ChatModelGPT4_32k ChatModel = "gpt-4-32k" -
const ChatModelGPT4_32k0314 ChatModel = "gpt-4-32k-0314" -
const ChatModelGPT4_32k0613 ChatModel = "gpt-4-32k-0613" -
const ChatModelGPT3_5Turbo ChatModel = "gpt-3.5-turbo" -
const ChatModelGPT3_5Turbo16k ChatModel = "gpt-3.5-turbo-16k" -
const ChatModelGPT3_5Turbo0301 ChatModel = "gpt-3.5-turbo-0301" -
const ChatModelGPT3_5Turbo0613 ChatModel = "gpt-3.5-turbo-0613" -
const ChatModelGPT3_5Turbo1106 ChatModel = "gpt-3.5-turbo-1106" -
const ChatModelGPT3_5Turbo0125 ChatModel = "gpt-3.5-turbo-0125" -
const ChatModelGPT3_5Turbo16k0613 ChatModel = "gpt-3.5-turbo-16k-0613"
-
-
type ResponsesModel string-
const ResponsesModelO1Pro ResponsesModel = "o1-pro" -
const ResponsesModelO1Pro2025_03_19 ResponsesModel = "o1-pro-2025-03-19" -
const ResponsesModelO3Pro ResponsesModel = "o3-pro" -
const ResponsesModelO3Pro2025_06_10 ResponsesModel = "o3-pro-2025-06-10" -
const ResponsesModelO3DeepResearch ResponsesModel = "o3-deep-research" -
const ResponsesModelO3DeepResearch2025_06_26 ResponsesModel = "o3-deep-research-2025-06-26" -
const ResponsesModelO4MiniDeepResearch ResponsesModel = "o4-mini-deep-research" -
const ResponsesModelO4MiniDeepResearch2025_06_26 ResponsesModel = "o4-mini-deep-research-2025-06-26" -
const ResponsesModelComputerUsePreview ResponsesModel = "computer-use-preview" -
const ResponsesModelComputerUsePreview2025_03_11 ResponsesModel = "computer-use-preview-2025-03-11" -
const ResponsesModelGPT5Codex ResponsesModel = "gpt-5-codex" -
const ResponsesModelGPT5Pro ResponsesModel = "gpt-5-pro" -
const ResponsesModelGPT5Pro2025_10_06 ResponsesModel = "gpt-5-pro-2025-10-06" -
const ResponsesModelGPT5_1CodexMax ResponsesModel = "gpt-5.1-codex-max"
-
-
-
Object ResponseThe object type of this resource - always set to
response.const ResponseResponse Response = "response"
-
Output []ResponseOutputItemUnionAn array of content items generated by the model.
-
The length and order of items in the
outputarray is dependent on the model's response. -
Rather than accessing the first item in the
outputarray and assuming it's anassistantmessage with the content generated by the model, you might consider using theoutput_textproperty where supported in SDKs. -
type ResponseOutputMessage struct{…}An output message from the model.
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
type ResponseFunctionToolCall struct{…}A tool call to run a function. See the function calling guide for more information.
-
type ResponseFunctionToolCallOutputItem struct{…}-
ID stringThe unique ID of the function call tool output.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseFunctionToolCallOutputItemOutputUnionThe output from the function call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseFunctionToolCallOutputItemOutputOutputContentList []ResponseFunctionToolCallOutputItemOutputOutputContentListItemUnionText, image, or file output of the function call.
-
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
-
Status ResponseFunctionToolCallOutputItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallOutputItemStatusInProgress ResponseFunctionToolCallOutputItemStatus = "in_progress" -
const ResponseFunctionToolCallOutputItemStatusCompleted ResponseFunctionToolCallOutputItemStatus = "completed" -
const ResponseFunctionToolCallOutputItemStatusIncomplete ResponseFunctionToolCallOutputItemStatus = "incomplete"
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
type ResponseComputerToolCallOutputItem struct{…}-
ID stringThe unique ID of the computer call tool output.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Status ResponseComputerToolCallOutputItemStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseComputerToolCallOutputItemStatusCompleted ResponseComputerToolCallOutputItemStatus = "completed" -
const ResponseComputerToolCallOutputItemStatusIncomplete ResponseComputerToolCallOutputItemStatus = "incomplete" -
const ResponseComputerToolCallOutputItemStatusFailed ResponseComputerToolCallOutputItemStatus = "failed" -
const ResponseComputerToolCallOutputItemStatusInProgress ResponseComputerToolCallOutputItemStatus = "in_progress"
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
AcknowledgedSafetyChecks []ResponseComputerToolCallOutputItemAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context. -
type ResponseToolSearchCall struct{…}-
ID stringThe unique ID of the tool search call item.
-
Arguments anyArguments used for the tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchCallExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchCallExecutionServer ResponseToolSearchCallExecution = "server" -
const ResponseToolSearchCallExecutionClient ResponseToolSearchCallExecution = "client"
-
-
Status ResponseToolSearchCallStatusThe status of the tool search call item that was recorded.
-
const ResponseToolSearchCallStatusInProgress ResponseToolSearchCallStatus = "in_progress" -
const ResponseToolSearchCallStatusCompleted ResponseToolSearchCallStatus = "completed" -
const ResponseToolSearchCallStatusIncomplete ResponseToolSearchCallStatus = "incomplete"
-
-
Type ToolSearchCallThe type of the item. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseToolSearchOutputItem struct{…}-
ID stringThe unique ID of the tool search output item.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemExecutionServer ResponseToolSearchOutputItemExecution = "server" -
const ResponseToolSearchOutputItemExecutionClient ResponseToolSearchOutputItemExecution = "client"
-
-
Status ResponseToolSearchOutputItemStatusThe status of the tool search output item that was recorded.
-
const ResponseToolSearchOutputItemStatusInProgress ResponseToolSearchOutputItemStatus = "in_progress" -
const ResponseToolSearchOutputItemStatusCompleted ResponseToolSearchOutputItemStatus = "completed" -
const ResponseToolSearchOutputItemStatusIncomplete ResponseToolSearchOutputItemStatus = "incomplete"
-
-
Tools []ToolUnionThe loaded tool definitions returned by tool search.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type ToolSearchOutputThe type of the item. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseOutputItemAdditionalTools struct{…}-
ID stringThe unique ID of the additional tools item.
-
Role stringThe role that provided the additional tools.
-
const ResponseOutputItemAdditionalToolsRoleUnknown ResponseOutputItemAdditionalToolsRole = "unknown" -
const ResponseOutputItemAdditionalToolsRoleUser ResponseOutputItemAdditionalToolsRole = "user" -
const ResponseOutputItemAdditionalToolsRoleAssistant ResponseOutputItemAdditionalToolsRole = "assistant" -
const ResponseOutputItemAdditionalToolsRoleSystem ResponseOutputItemAdditionalToolsRole = "system" -
const ResponseOutputItemAdditionalToolsRoleCritic ResponseOutputItemAdditionalToolsRole = "critic" -
const ResponseOutputItemAdditionalToolsRoleDiscriminator ResponseOutputItemAdditionalToolsRole = "discriminator" -
const ResponseOutputItemAdditionalToolsRoleDeveloper ResponseOutputItemAdditionalToolsRole = "developer" -
const ResponseOutputItemAdditionalToolsRoleTool ResponseOutputItemAdditionalToolsRole = "tool"
-
-
Tools []ToolUnionThe additional tool definitions made available at this item.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type AdditionalToolsThe type of the item. Always
additional_tools.const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"
-
-
type ResponseCompactionItem struct{…}A compaction item generated by the
v1/responses/compactAPI.-
ID stringThe unique ID of the compaction item.
-
EncryptedContent stringThe encrypted content that was produced by compaction.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseOutputItemImageGenerationCall struct{…}An image generation request made by the model.
-
ID stringThe unique ID of the image generation call.
-
Result stringThe generated image encoded in base64.
-
Status stringThe status of the image generation call.
-
const ResponseOutputItemImageGenerationCallStatusInProgress ResponseOutputItemImageGenerationCallStatus = "in_progress" -
const ResponseOutputItemImageGenerationCallStatusCompleted ResponseOutputItemImageGenerationCallStatus = "completed" -
const ResponseOutputItemImageGenerationCallStatusGenerating ResponseOutputItemImageGenerationCallStatus = "generating" -
const ResponseOutputItemImageGenerationCallStatusFailed ResponseOutputItemImageGenerationCallStatus = "failed"
-
-
Type ImageGenerationCallThe type of the image generation call. Always
image_generation_call.const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"
-
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
type ResponseOutputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
ID stringThe unique ID of the local shell call.
-
Action ResponseOutputItemLocalShellCallActionExecute a shell command on the server.
-
Command []stringThe command to run.
-
Env map[string, string]Environment variables to set for the command.
-
Type ExecThe type of the local shell action. Always
exec.const ExecExec Exec = "exec"
-
TimeoutMs int64Optional timeout in milliseconds for the command.
-
User stringOptional user to run the command as.
-
WorkingDirectory stringOptional working directory to run the command in.
-
-
CallID stringThe unique ID of the local shell tool call generated by the model.
-
Status stringThe status of the local shell call.
-
const ResponseOutputItemLocalShellCallStatusInProgress ResponseOutputItemLocalShellCallStatus = "in_progress" -
const ResponseOutputItemLocalShellCallStatusCompleted ResponseOutputItemLocalShellCallStatus = "completed" -
const ResponseOutputItemLocalShellCallStatusIncomplete ResponseOutputItemLocalShellCallStatus = "incomplete"
-
-
Type LocalShellCallThe type of the local shell call. Always
local_shell_call.const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"
-
-
type ResponseOutputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
ID stringThe unique ID of the local shell tool call generated by the model.
-
Output stringA JSON string of the output of the local shell tool call.
-
Type LocalShellCallOutputThe type of the local shell tool call output. Always
local_shell_call_output.const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete.-
const ResponseOutputItemLocalShellCallOutputStatusInProgress ResponseOutputItemLocalShellCallOutputStatus = "in_progress" -
const ResponseOutputItemLocalShellCallOutputStatusCompleted ResponseOutputItemLocalShellCallOutputStatus = "completed" -
const ResponseOutputItemLocalShellCallOutputStatusIncomplete ResponseOutputItemLocalShellCallOutputStatus = "incomplete"
-
-
-
type ResponseFunctionShellToolCall struct{…}A tool call that executes one or more shell commands in a managed environment.
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Action ResponseFunctionShellToolCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []string -
MaxOutputLength int64Optional maximum number of characters to return from each command.
-
TimeoutMs int64Optional timeout in milliseconds for the commands.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Environment ResponseFunctionShellToolCallEnvironmentUnionRepresents the use of a local environment to perform shell actions.
-
type ResponseLocalEnvironment struct{…}Represents the use of a local environment to perform shell actions.
-
Type LocalThe environment type. Always
local.const LocalLocal Local = "local"
-
-
type ResponseContainerReference struct{…}Represents a container created with /v1/containers.
-
ContainerID string -
Type ContainerReferenceThe environment type. Always
container_reference.const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
Status ResponseFunctionShellToolCallStatusThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallStatusInProgress ResponseFunctionShellToolCallStatus = "in_progress" -
const ResponseFunctionShellToolCallStatusCompleted ResponseFunctionShellToolCallStatus = "completed" -
const ResponseFunctionShellToolCallStatusIncomplete ResponseFunctionShellToolCallStatus = "incomplete"
-
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseFunctionShellToolCallOutput struct{…}The output of a shell tool call that was emitted.
-
ID stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
MaxOutputLength int64The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
Output []ResponseFunctionShellToolCallOutputOutputAn array of shell call output contents
-
Outcome ResponseFunctionShellToolCallOutputOutputOutcomeUnionRepresents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
type ResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64Exit code from the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringThe standard error output that was captured.
-
Stdout stringThe standard output that was captured.
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
Status ResponseFunctionShellToolCallOutputStatusThe status of the shell call output. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallOutputStatusInProgress ResponseFunctionShellToolCallOutputStatus = "in_progress" -
const ResponseFunctionShellToolCallOutputStatusCompleted ResponseFunctionShellToolCallOutputStatus = "completed" -
const ResponseFunctionShellToolCallOutputStatusIncomplete ResponseFunctionShellToolCallOutputStatus = "incomplete"
-
-
Type ShellCallOutputThe type of the shell call output. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseApplyPatchToolCall struct{…}A tool call that applies file diffs by creating, deleting, or updating files.
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseApplyPatchToolCallOperationUnionOne of the create_file, delete_file, or update_file operations applied via apply_patch.
-
type ResponseApplyPatchToolCallOperationCreateFile struct{…}Instruction describing how to create a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to create.
-
Type CreateFileCreate a new file with the provided diff.
const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseApplyPatchToolCallOperationDeleteFile struct{…}Instruction describing how to delete a file via the apply_patch tool.
-
Path stringPath of the file to delete.
-
Type DeleteFileDelete the specified file.
const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseApplyPatchToolCallOperationUpdateFile struct{…}Instruction describing how to update a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to update.
-
Type UpdateFileUpdate an existing file with the provided diff.
const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status ResponseApplyPatchToolCallStatusThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseApplyPatchToolCallStatusInProgress ResponseApplyPatchToolCallStatus = "in_progress" -
const ResponseApplyPatchToolCallStatusCompleted ResponseApplyPatchToolCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseApplyPatchToolCallOutput struct{…}The output emitted by an apply patch tool call.
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status ResponseApplyPatchToolCallOutputStatusThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseApplyPatchToolCallOutputStatusCompleted ResponseApplyPatchToolCallOutputStatus = "completed" -
const ResponseApplyPatchToolCallOutputStatusFailed ResponseApplyPatchToolCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
CreatedBy stringThe ID of the entity that created this tool call output.
-
Output stringOptional textual output returned by the apply patch tool.
-
-
type ResponseOutputItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
ID stringThe unique ID of the tool call.
-
Arguments stringA JSON string of the arguments passed to the tool.
-
Name stringThe name of the tool that was run.
-
ServerLabel stringThe label of the MCP server running the tool.
-
Type McpCallThe type of the item. Always
mcp_call.const McpCallMcpCall McpCall = "mcp_call"
-
ApprovalRequestID stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
Error stringThe error from the tool call, if any.
-
Output stringThe output from the tool call.
-
Status stringThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
const ResponseOutputItemMcpCallStatusInProgress ResponseOutputItemMcpCallStatus = "in_progress" -
const ResponseOutputItemMcpCallStatusCompleted ResponseOutputItemMcpCallStatus = "completed" -
const ResponseOutputItemMcpCallStatusIncomplete ResponseOutputItemMcpCallStatus = "incomplete" -
const ResponseOutputItemMcpCallStatusCalling ResponseOutputItemMcpCallStatus = "calling" -
const ResponseOutputItemMcpCallStatusFailed ResponseOutputItemMcpCallStatus = "failed"
-
-
-
type ResponseOutputItemMcpListTools struct{…}A list of tools available on an MCP server.
-
ID stringThe unique ID of the list.
-
ServerLabel stringThe label of the MCP server.
-
Tools []ResponseOutputItemMcpListToolsToolThe tools available on the server.
-
InputSchema anyThe JSON schema describing the tool's input.
-
Name stringThe name of the tool.
-
Annotations anyAdditional annotations about the tool.
-
Description stringThe description of the tool.
-
-
Type McpListToolsThe type of the item. Always
mcp_list_tools.const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
-
Error stringError message if the server could not list tools.
-
-
type ResponseOutputItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
ID stringThe unique ID of the approval request.
-
Arguments stringA JSON string of arguments for the tool.
-
Name stringThe name of the tool to run.
-
ServerLabel stringThe label of the MCP server making the request.
-
Type McpApprovalRequestThe type of the item. Always
mcp_approval_request.const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"
-
-
type ResponseOutputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
ID stringThe unique ID of the approval response
-
ApprovalRequestID stringThe ID of the approval request being answered.
-
Approve boolWhether the request was approved.
-
Type McpApprovalResponseThe type of the item. Always
mcp_approval_response.const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
-
Reason stringOptional reason for the decision.
-
-
type ResponseCustomToolCall struct{…}A call to a custom tool created by the model.
-
type ResponseCustomToolCallOutputItem struct{…}The output of a custom tool call from your code, being sent back to the model.
-
ID stringThe unique ID of the custom tool call output item.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseCustomToolCallOutputItemStatusInProgress ResponseCustomToolCallOutputItemStatus = "in_progress" -
const ResponseCustomToolCallOutputItemStatusCompleted ResponseCustomToolCallOutputItemStatus = "completed" -
const ResponseCustomToolCallOutputItemStatusIncomplete ResponseCustomToolCallOutputItemStatus = "incomplete"
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
-
ParallelToolCalls boolWhether to allow the model to run tool calls in parallel.
-
Temperature float64What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or
top_pbut not both. -
ToolChoice ResponseToolChoiceUnionHow the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call.-
type ToolChoiceOptions stringControls which (if any) tool is called by the model.
nonemeans the model will not call any tool and instead generates a message.automeans the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools.-
const ToolChoiceOptionsNone ToolChoiceOptions = "none" -
const ToolChoiceOptionsAuto ToolChoiceOptions = "auto" -
const ToolChoiceOptionsRequired ToolChoiceOptions = "required"
-
-
type ToolChoiceAllowed struct{…}Constrains the tools available to the model to a pre-defined set.
-
Mode ToolChoiceAllowedModeConstrains the tools available to the model to a pre-defined set.
autoallows the model to pick from among the allowed tools and generate a message.requiredrequires the model to call one or more of the allowed tools.-
const ToolChoiceAllowedModeAuto ToolChoiceAllowedMode = "auto" -
const ToolChoiceAllowedModeRequired ToolChoiceAllowedMode = "required"
-
-
Tools []map[string, any]A list of tool definitions that the model should be allowed to call.
For the Responses API, the list of tool definitions might look like:
[ { "type": "function", "name": "get_weather" }, { "type": "mcp", "server_label": "deepwiki" }, { "type": "image_generation" } ] -
Type AllowedToolsAllowed tool configuration type. Always
allowed_tools.const AllowedToolsAllowedTools AllowedTools = "allowed_tools"
-
-
type ToolChoiceTypes struct{…}Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
-
Type ToolChoiceTypesTypeThe type of hosted tool the model should to use. Learn more about built-in tools.
Allowed values are:
-
file_search -
web_search_preview -
computer -
computer_use_preview -
computer_use -
code_interpreter -
image_generation -
const ToolChoiceTypesTypeFileSearch ToolChoiceTypesType = "file_search" -
const ToolChoiceTypesTypeWebSearchPreview ToolChoiceTypesType = "web_search_preview" -
const ToolChoiceTypesTypeComputer ToolChoiceTypesType = "computer" -
const ToolChoiceTypesTypeComputerUsePreview ToolChoiceTypesType = "computer_use_preview" -
const ToolChoiceTypesTypeComputerUse ToolChoiceTypesType = "computer_use" -
const ToolChoiceTypesTypeWebSearchPreview2025_03_11 ToolChoiceTypesType = "web_search_preview_2025_03_11" -
const ToolChoiceTypesTypeImageGeneration ToolChoiceTypesType = "image_generation" -
const ToolChoiceTypesTypeCodeInterpreter ToolChoiceTypesType = "code_interpreter"
-
-
-
type ToolChoiceFunction struct{…}Use this option to force the model to call a specific function.
-
Name stringThe name of the function to call.
-
Type FunctionFor function calling, the type is always
function.const FunctionFunction Function = "function"
-
-
type ToolChoiceMcp struct{…}Use this option to force the model to call a specific tool on a remote MCP server.
-
ServerLabel stringThe label of the MCP server to use.
-
Type McpFor MCP tools, the type is always
mcp.const McpMcp Mcp = "mcp"
-
Name stringThe name of the tool to call on the server.
-
-
type ToolChoiceCustom struct{…}Use this option to force the model to call a specific custom tool.
-
Name stringThe name of the custom tool to call.
-
Type CustomFor custom tool calling, the type is always
custom.const CustomCustom Custom = "custom"
-
-
type ToolChoiceApplyPatch struct{…}Forces the model to call the apply_patch tool when executing a tool call.
-
Type ApplyPatchThe tool to call. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
type ToolChoiceShell struct{…}Forces the model to call the shell tool when a tool call is required.
-
Type ShellThe tool to call. Always
shell.const ShellShell Shell = "shell"
-
-
-
Tools []ToolUnionAn array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.We support the following categories of tools:
-
Built-in tools: Tools that are provided by OpenAI that extend the model's capabilities, like web search or file search. Learn more about built-in tools.
-
MCP Tools: Integrations with third-party systems via custom MCP servers or predefined connectors such as Google Drive and SharePoint. Learn more about MCP Tools.
-
Function calls (custom tools): Functions that are defined by you, enabling the model to call your own code with strongly typed arguments and outputs. Learn more about function calling. You can also use custom tools to call your own code.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
TopP float64An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
We generally recommend altering this or
temperaturebut not both. -
Background boolWhether to run the model response in the background. Learn more.
-
CompletedAt float64Unix timestamp (in seconds) of when this Response was completed. Only present when the status is
completed. -
Conversation ResponseConversationThe conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
-
ID stringThe unique ID of the conversation that this response was associated with.
-
-
MaxOutputTokens int64An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
MaxToolCalls int64The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored.
-
Moderation ResponseModerationModeration results for the response input and output, if moderated completions were requested.
-
Input ResponseModerationInputUnionModeration for the response input.
-
type ResponseModerationInputModerationResult struct{…}A moderation result produced for the response input or output.
-
Categories map[string, bool]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
CategoryAppliedInputTypes map[string, []string]Which modalities of input are reflected by the score for each category.
-
const ResponseModerationInputModerationResultCategoryAppliedInputTypeText ResponseModerationInputModerationResultCategoryAppliedInputType = "text" -
const ResponseModerationInputModerationResultCategoryAppliedInputTypeImage ResponseModerationInputModerationResultCategoryAppliedInputType = "image"
-
-
CategoryScores map[string, float64]A dictionary of moderation categories to scores.
-
Flagged boolA boolean indicating whether the content was flagged by any category.
-
Model stringThe moderation model that produced this result.
-
Type ModerationResultThe object type, which was always
moderation_resultfor successful moderation results.const ModerationResultModerationResult ModerationResult = "moderation_result"
-
-
type ResponseModerationInputError struct{…}An error produced while attempting moderation for the response input or output.
-
Code stringThe error code.
-
Message stringThe error message.
-
Type ErrorThe object type, which was always
errorfor moderation failures.const ErrorError Error = "error"
-
-
-
Output ResponseModerationOutputUnionModeration for the response output.
-
type ResponseModerationOutputModerationResult struct{…}A moderation result produced for the response input or output.
-
Categories map[string, bool]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
CategoryAppliedInputTypes map[string, []string]Which modalities of input are reflected by the score for each category.
-
const ResponseModerationOutputModerationResultCategoryAppliedInputTypeText ResponseModerationOutputModerationResultCategoryAppliedInputType = "text" -
const ResponseModerationOutputModerationResultCategoryAppliedInputTypeImage ResponseModerationOutputModerationResultCategoryAppliedInputType = "image"
-
-
CategoryScores map[string, float64]A dictionary of moderation categories to scores.
-
Flagged boolA boolean indicating whether the content was flagged by any category.
-
Model stringThe moderation model that produced this result.
-
Type ModerationResultThe object type, which was always
moderation_resultfor successful moderation results.const ModerationResultModerationResult ModerationResult = "moderation_result"
-
-
type ResponseModerationOutputError struct{…}An error produced while attempting moderation for the response input or output.
-
Code stringThe error code.
-
Message stringThe error message.
-
Type ErrorThe object type, which was always
errorfor moderation failures.const ErrorError Error = "error"
-
-
-
-
PreviousResponseID stringThe unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about conversation state. Cannot be used in conjunction with
conversation. -
Prompt ResponsePromptReference to a prompt template and its variables. Learn more.
-
ID stringThe unique identifier of the prompt template to use.
-
Variables map[string, ResponsePromptVariableUnion]Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files.
-
string -
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
Version stringOptional version of the prompt template.
-
-
PromptCacheKey stringUsed by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more. -
PromptCacheRetention ResponsePromptCacheRetentionThe retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. Forgpt-5.5,gpt-5.5-pro, and future models, only24his supported.For older models that support both
in_memoryand24h, the default depends on your organization's data retention policy:-
Organizations without ZDR enabled default to
24h. -
Organizations with ZDR enabled default to
in_memorywhenprompt_cache_retentionis not specified. -
const ResponsePromptCacheRetentionInMemory ResponsePromptCacheRetention = "in_memory" -
const ResponsePromptCacheRetention24h ResponsePromptCacheRetention = "24h"
-
-
Reasoning Reasoninggpt-5 and o-series models only
Configuration options for reasoning models.
-
Context ReasoningContextControls which reasoning items are rendered back to the model on later turns. When returned on a response, this is the effective reasoning context mode used for the response.
-
const ReasoningContextAuto ReasoningContext = "auto" -
const ReasoningContextCurrentTurn ReasoningContext = "current_turn" -
const ReasoningContextAllTurns ReasoningContext = "all_turns"
-
-
Effort ReasoningEffortConstrains effort on reasoning for reasoning models. Currently supported values are
none,minimal,low,medium,high, andxhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.-
gpt-5.1defaults tonone, which does not perform reasoning. The supported reasoning values forgpt-5.1arenone,low,medium, andhigh. Tool calls are supported for all reasoning values in gpt-5.1. -
All models before
gpt-5.1default tomediumreasoning effort, and do not supportnone. -
The
gpt-5-promodel defaults to (and only supports)highreasoning effort. -
xhighis supported for all models aftergpt-5.1-codex-max. -
const ReasoningEffortNone ReasoningEffort = "none" -
const ReasoningEffortMinimal ReasoningEffort = "minimal" -
const ReasoningEffortLow ReasoningEffort = "low" -
const ReasoningEffortMedium ReasoningEffort = "medium" -
const ReasoningEffortHigh ReasoningEffort = "high" -
const ReasoningEffortXhigh ReasoningEffort = "xhigh"
-
-
GenerateSummary ReasoningGenerateSummaryDeprecated: use
summaryinstead.A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.-
const ReasoningGenerateSummaryAuto ReasoningGenerateSummary = "auto" -
const ReasoningGenerateSummaryConcise ReasoningGenerateSummary = "concise" -
const ReasoningGenerateSummaryDetailed ReasoningGenerateSummary = "detailed"
-
-
Summary ReasoningSummaryA summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.conciseis supported forcomputer-use-previewmodels and all reasoning models aftergpt-5.-
const ReasoningSummaryAuto ReasoningSummary = "auto" -
const ReasoningSummaryConcise ReasoningSummary = "concise" -
const ReasoningSummaryDetailed ReasoningSummary = "detailed"
-
-
-
SafetyIdentifier stringA stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
ServiceTier ResponseServiceTierSpecifies the processing type used for serving the request.
- If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'.
- If set to 'default', then the request will be processed with the standard pricing and performance for the selected model.
- If set to 'flex' or 'priority', then the request will be processed with the corresponding service tier.
- When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.-
const ResponseServiceTierAuto ResponseServiceTier = "auto" -
const ResponseServiceTierDefault ResponseServiceTier = "default" -
const ResponseServiceTierFlex ResponseServiceTier = "flex" -
const ResponseServiceTierScale ResponseServiceTier = "scale" -
const ResponseServiceTierPriority ResponseServiceTier = "priority"
-
Status ResponseStatusThe status of the response generation. One of
completed,failed,in_progress,cancelled,queued, orincomplete.-
const ResponseStatusCompleted ResponseStatus = "completed" -
const ResponseStatusFailed ResponseStatus = "failed" -
const ResponseStatusInProgress ResponseStatus = "in_progress" -
const ResponseStatusCancelled ResponseStatus = "cancelled" -
const ResponseStatusQueued ResponseStatus = "queued" -
const ResponseStatusIncomplete ResponseStatus = "incomplete"
-
-
Text ResponseTextConfigConfiguration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
Format ResponseFormatTextConfigUnionAn object specifying the format that the model must output.
Configuring
{ "type": "json_schema" }enables Structured Outputs, which ensures the model will match your supplied JSON schema. Learn more in the Structured Outputs guide.The default format is
{ "type": "text" }with no additional options.Not recommended for gpt-4o and newer models:
Setting to
{ "type": "json_object" }enables the older JSON mode, which ensures the message the model generates is valid JSON. Usingjson_schemais preferred for models that support it.-
type ResponseFormatText struct{…}Default response format. Used to generate text responses.
-
Type TextThe type of response format being defined. Always
text.const TextText Text = "text"
-
-
type ResponseFormatTextJSONSchemaConfig struct{…}JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
Name stringThe name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
-
Schema map[string, any]The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
-
Type JSONSchemaThe type of response format being defined. Always
json_schema.const JSONSchemaJSONSchema JSONSchema = "json_schema"
-
Description stringA description of what the response format is for, used by the model to determine how to respond in the format.
-
Strict boolWhether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the
schemafield. Only a subset of JSON Schema is supported whenstrictistrue. To learn more, read the Structured Outputs guide.
-
-
type ResponseFormatJSONObject struct{…}JSON object response format. An older method of generating JSON responses. Using
json_schemais 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 JSONObjectThe type of response format being defined. Always
json_object.const JSONObjectJSONObject JSONObject = "json_object"
-
-
-
Verbosity ResponseTextConfigVerbosityConstrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses. Currently supported values are
low,medium, andhigh.-
const ResponseTextConfigVerbosityLow ResponseTextConfigVerbosity = "low" -
const ResponseTextConfigVerbosityMedium ResponseTextConfigVerbosity = "medium" -
const ResponseTextConfigVerbosityHigh ResponseTextConfigVerbosity = "high"
-
-
TopLogprobs int64An integer between 0 and 20 specifying the maximum number of most likely tokens to return at each token position, each with an associated log probability. In some cases, the number of returned tokens may be fewer than requested.
-
Truncation ResponseTruncationThe truncation strategy to use for the model response.
-
auto: If the input to this Response exceeds the model's context window size, the model will truncate the response to fit the context window by dropping items from the beginning of the conversation. -
disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error. -
const ResponseTruncationAuto ResponseTruncation = "auto" -
const ResponseTruncationDisabled ResponseTruncation = "disabled"
-
-
Usage ResponseUsageRepresents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
-
InputTokens int64The number of input tokens.
-
InputTokensDetails ResponseUsageInputTokensDetailsA detailed breakdown of the input tokens.
-
CachedTokens int64The number of tokens that were retrieved from the cache. More on prompt caching.
-
-
OutputTokens int64The number of output tokens.
-
OutputTokensDetails ResponseUsageOutputTokensDetailsA detailed breakdown of the output tokens.
-
ReasoningTokens int64The number of reasoning tokens.
-
-
TotalTokens int64The total number of tokens used.
-
-
User stringThis field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead to maintain caching optimizations. A stable identifier for your end-users. Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. Learn more.
-
Response Apply Patch Tool Call
-
type ResponseApplyPatchToolCall struct{…}A tool call that applies file diffs by creating, deleting, or updating files.
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseApplyPatchToolCallOperationUnionOne of the create_file, delete_file, or update_file operations applied via apply_patch.
-
type ResponseApplyPatchToolCallOperationCreateFile struct{…}Instruction describing how to create a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to create.
-
Type CreateFileCreate a new file with the provided diff.
const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseApplyPatchToolCallOperationDeleteFile struct{…}Instruction describing how to delete a file via the apply_patch tool.
-
Path stringPath of the file to delete.
-
Type DeleteFileDelete the specified file.
const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseApplyPatchToolCallOperationUpdateFile struct{…}Instruction describing how to update a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to update.
-
Type UpdateFileUpdate an existing file with the provided diff.
const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status ResponseApplyPatchToolCallStatusThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseApplyPatchToolCallStatusInProgress ResponseApplyPatchToolCallStatus = "in_progress" -
const ResponseApplyPatchToolCallStatusCompleted ResponseApplyPatchToolCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
Response Apply Patch Tool Call Output
-
type ResponseApplyPatchToolCallOutput struct{…}The output emitted by an apply patch tool call.
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status ResponseApplyPatchToolCallOutputStatusThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseApplyPatchToolCallOutputStatusCompleted ResponseApplyPatchToolCallOutputStatus = "completed" -
const ResponseApplyPatchToolCallOutputStatusFailed ResponseApplyPatchToolCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
CreatedBy stringThe ID of the entity that created this tool call output.
-
Output stringOptional textual output returned by the apply patch tool.
-
Response Audio Delta Event
-
type ResponseAudioDeltaEvent struct{…}Emitted when there is a partial audio response.
-
Delta stringA chunk of Base64 encoded response audio bytes.
-
SequenceNumber int64A sequence number for this chunk of the stream response.
-
Type ResponseAudioDeltaThe type of the event. Always
response.audio.delta.const ResponseAudioDeltaResponseAudioDelta ResponseAudioDelta = "response.audio.delta"
-
Response Audio Done Event
-
type ResponseAudioDoneEvent struct{…}Emitted when the audio response is complete.
-
SequenceNumber int64The sequence number of the delta.
-
Type ResponseAudioDoneThe type of the event. Always
response.audio.done.const ResponseAudioDoneResponseAudioDone ResponseAudioDone = "response.audio.done"
-
Response Audio Transcript Delta Event
-
type ResponseAudioTranscriptDeltaEvent struct{…}Emitted when there is a partial transcript of audio.
-
Delta stringThe partial transcript of the audio response.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseAudioTranscriptDeltaThe type of the event. Always
response.audio.transcript.delta.const ResponseAudioTranscriptDeltaResponseAudioTranscriptDelta ResponseAudioTranscriptDelta = "response.audio.transcript.delta"
-
Response Audio Transcript Done Event
-
type ResponseAudioTranscriptDoneEvent struct{…}Emitted when the full audio transcript is completed.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseAudioTranscriptDoneThe type of the event. Always
response.audio.transcript.done.const ResponseAudioTranscriptDoneResponseAudioTranscriptDone ResponseAudioTranscriptDone = "response.audio.transcript.done"
-
Response Code Interpreter Call Code Delta Event
-
type ResponseCodeInterpreterCallCodeDeltaEvent struct{…}Emitted when a partial code snippet is streamed by the code interpreter.
-
Delta stringThe partial code snippet being streamed by the code interpreter.
-
ItemID stringThe unique identifier of the code interpreter tool call item.
-
OutputIndex int64The index of the output item in the response for which the code is being streamed.
-
SequenceNumber int64The sequence number of this event, used to order streaming events.
-
Type ResponseCodeInterpreterCallCodeDeltaThe type of the event. Always
response.code_interpreter_call_code.delta.const ResponseCodeInterpreterCallCodeDeltaResponseCodeInterpreterCallCodeDelta ResponseCodeInterpreterCallCodeDelta = "response.code_interpreter_call_code.delta"
-
Response Code Interpreter Call Code Done Event
-
type ResponseCodeInterpreterCallCodeDoneEvent struct{…}Emitted when the code snippet is finalized by the code interpreter.
-
Code stringThe final code snippet output by the code interpreter.
-
ItemID stringThe unique identifier of the code interpreter tool call item.
-
OutputIndex int64The index of the output item in the response for which the code is finalized.
-
SequenceNumber int64The sequence number of this event, used to order streaming events.
-
Type ResponseCodeInterpreterCallCodeDoneThe type of the event. Always
response.code_interpreter_call_code.done.const ResponseCodeInterpreterCallCodeDoneResponseCodeInterpreterCallCodeDone ResponseCodeInterpreterCallCodeDone = "response.code_interpreter_call_code.done"
-
Response Code Interpreter Call Completed Event
-
type ResponseCodeInterpreterCallCompletedEvent struct{…}Emitted when the code interpreter call is completed.
-
ItemID stringThe unique identifier of the code interpreter tool call item.
-
OutputIndex int64The index of the output item in the response for which the code interpreter call is completed.
-
SequenceNumber int64The sequence number of this event, used to order streaming events.
-
Type ResponseCodeInterpreterCallCompletedThe type of the event. Always
response.code_interpreter_call.completed.const ResponseCodeInterpreterCallCompletedResponseCodeInterpreterCallCompleted ResponseCodeInterpreterCallCompleted = "response.code_interpreter_call.completed"
-
Response Code Interpreter Call In Progress Event
-
type ResponseCodeInterpreterCallInProgressEvent struct{…}Emitted when a code interpreter call is in progress.
-
ItemID stringThe unique identifier of the code interpreter tool call item.
-
OutputIndex int64The index of the output item in the response for which the code interpreter call is in progress.
-
SequenceNumber int64The sequence number of this event, used to order streaming events.
-
Type ResponseCodeInterpreterCallInProgressThe type of the event. Always
response.code_interpreter_call.in_progress.const ResponseCodeInterpreterCallInProgressResponseCodeInterpreterCallInProgress ResponseCodeInterpreterCallInProgress = "response.code_interpreter_call.in_progress"
-
Response Code Interpreter Call Interpreting Event
-
type ResponseCodeInterpreterCallInterpretingEvent struct{…}Emitted when the code interpreter is actively interpreting the code snippet.
-
ItemID stringThe unique identifier of the code interpreter tool call item.
-
OutputIndex int64The index of the output item in the response for which the code interpreter is interpreting code.
-
SequenceNumber int64The sequence number of this event, used to order streaming events.
-
Type ResponseCodeInterpreterCallInterpretingThe type of the event. Always
response.code_interpreter_call.interpreting.const ResponseCodeInterpreterCallInterpretingResponseCodeInterpreterCallInterpreting ResponseCodeInterpreterCallInterpreting = "response.code_interpreter_call.interpreting"
-
Response Code Interpreter Tool Call
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
ID stringThe unique ID of the code interpreter tool call.
-
Code stringThe code to run, or null if not available.
-
ContainerID stringThe ID of the container used to run the code.
-
Outputs []ResponseCodeInterpreterToolCallOutputUnionThe outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
type ResponseCodeInterpreterToolCallOutputLogs struct{…}The logs output from the code interpreter.
-
Logs stringThe logs output from the code interpreter.
-
Type LogsThe type of the output. Always
logs.const LogsLogs Logs = "logs"
-
-
type ResponseCodeInterpreterToolCallOutputImage struct{…}The image output from the code interpreter.
-
Type ImageThe type of the output. Always
image.const ImageImage Image = "image"
-
URL stringThe URL of the image output from the code interpreter.
-
-
-
Status ResponseCodeInterpreterToolCallStatusThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
const ResponseCodeInterpreterToolCallStatusInProgress ResponseCodeInterpreterToolCallStatus = "in_progress" -
const ResponseCodeInterpreterToolCallStatusCompleted ResponseCodeInterpreterToolCallStatus = "completed" -
const ResponseCodeInterpreterToolCallStatusIncomplete ResponseCodeInterpreterToolCallStatus = "incomplete" -
const ResponseCodeInterpreterToolCallStatusInterpreting ResponseCodeInterpreterToolCallStatus = "interpreting" -
const ResponseCodeInterpreterToolCallStatusFailed ResponseCodeInterpreterToolCallStatus = "failed"
-
-
Type CodeInterpreterCallThe type of the code interpreter tool call. Always
code_interpreter_call.const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"
-
Response Compaction Item
-
type ResponseCompactionItem struct{…}A compaction item generated by the
v1/responses/compactAPI.-
ID stringThe unique ID of the compaction item.
-
EncryptedContent stringThe encrypted content that was produced by compaction.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
CreatedBy stringThe identifier of the actor that created the item.
-
Response Compaction Item Param
-
type ResponseCompactionItemParamResp struct{…}A compaction item generated by the
v1/responses/compactAPI.-
EncryptedContent stringThe encrypted content of the compaction summary.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
ID stringThe ID of the compaction item.
-
Response Completed Event
-
type ResponseCompletedEvent struct{…}Emitted when the model response is complete.
-
Response ResponseProperties of the completed response.
-
ID stringUnique identifier for this Response.
-
CreatedAt float64Unix timestamp (in seconds) of when this Response was created.
-
Error ResponseErrorAn error object returned when the model fails to generate a Response.
-
Code ResponseErrorCodeThe error code for the response.
-
const ResponseErrorCodeServerError ResponseErrorCode = "server_error" -
const ResponseErrorCodeRateLimitExceeded ResponseErrorCode = "rate_limit_exceeded" -
const ResponseErrorCodeInvalidPrompt ResponseErrorCode = "invalid_prompt" -
const ResponseErrorCodeVectorStoreTimeout ResponseErrorCode = "vector_store_timeout" -
const ResponseErrorCodeInvalidImage ResponseErrorCode = "invalid_image" -
const ResponseErrorCodeInvalidImageFormat ResponseErrorCode = "invalid_image_format" -
const ResponseErrorCodeInvalidBase64Image ResponseErrorCode = "invalid_base64_image" -
const ResponseErrorCodeInvalidImageURL ResponseErrorCode = "invalid_image_url" -
const ResponseErrorCodeImageTooLarge ResponseErrorCode = "image_too_large" -
const ResponseErrorCodeImageTooSmall ResponseErrorCode = "image_too_small" -
const ResponseErrorCodeImageParseError ResponseErrorCode = "image_parse_error" -
const ResponseErrorCodeImageContentPolicyViolation ResponseErrorCode = "image_content_policy_violation" -
const ResponseErrorCodeInvalidImageMode ResponseErrorCode = "invalid_image_mode" -
const ResponseErrorCodeImageFileTooLarge ResponseErrorCode = "image_file_too_large" -
const ResponseErrorCodeUnsupportedImageMediaType ResponseErrorCode = "unsupported_image_media_type" -
const ResponseErrorCodeEmptyImageFile ResponseErrorCode = "empty_image_file" -
const ResponseErrorCodeFailedToDownloadImage ResponseErrorCode = "failed_to_download_image" -
const ResponseErrorCodeImageFileNotFound ResponseErrorCode = "image_file_not_found"
-
-
Message stringA human-readable description of the error.
-
-
IncompleteDetails ResponseIncompleteDetailsDetails about why the response is incomplete.
-
Reason stringThe reason why the response is incomplete.
-
const ResponseIncompleteDetailsReasonMaxOutputTokens ResponseIncompleteDetailsReason = "max_output_tokens" -
const ResponseIncompleteDetailsReasonContentFilter ResponseIncompleteDetailsReason = "content_filter"
-
-
-
Instructions ResponseInstructionsUnionA system (or developer) message inserted into the model's context.
When using along with
previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses.-
string -
type ResponseInstructionsInputItemList []ResponseInputItemUnionA list of one or many input items to the model, containing different content types.
-
type EasyInputMessage struct{…}A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.-
Content EasyInputMessageContentUnionText, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
-
string -
type ResponseInputMessageContentList []ResponseInputContentUnionA list of one or many input items to the model, containing different content types.
-
type ResponseInputText struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
Detail ResponseInputImageDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageDetailLow ResponseInputImageDetail = "low" -
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high" -
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto" -
const ResponseInputImageDetailOriginal ResponseInputImageDetail = "original"
-
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFile struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileDetailLow ResponseInputFileDetail = "low" -
const ResponseInputFileDetailHigh ResponseInputFileDetail = "high"
-
-
FileData stringThe content of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Role EasyInputMessageRoleThe role of the message input. One of
user,assistant,system, ordeveloper.-
const EasyInputMessageRoleUser EasyInputMessageRole = "user" -
const EasyInputMessageRoleAssistant EasyInputMessageRole = "assistant" -
const EasyInputMessageRoleSystem EasyInputMessageRole = "system" -
const EasyInputMessageRoleDeveloper EasyInputMessageRole = "developer"
-
-
Phase EasyInputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const EasyInputMessagePhaseCommentary EasyInputMessagePhase = "commentary" -
const EasyInputMessagePhaseFinalAnswer EasyInputMessagePhase = "final_answer"
-
-
Type EasyInputMessageTypeThe type of the message input. Always
message.const EasyInputMessageTypeMessage EasyInputMessageType = "message"
-
-
type ResponseInputItemMessage struct{…}A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole.-
Content ResponseInputMessageContentListA list of one or many input items to the model, containing different content types.
-
Role stringThe role of the message input. One of
user,system, ordeveloper.-
const ResponseInputItemMessageRoleUser ResponseInputItemMessageRole = "user" -
const ResponseInputItemMessageRoleSystem ResponseInputItemMessageRole = "system" -
const ResponseInputItemMessageRoleDeveloper ResponseInputItemMessageRole = "developer"
-
-
Status stringThe status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputItemMessageStatusInProgress ResponseInputItemMessageStatus = "in_progress" -
const ResponseInputItemMessageStatusCompleted ResponseInputItemMessageStatus = "completed" -
const ResponseInputItemMessageStatusIncomplete ResponseInputItemMessageStatus = "incomplete"
-
-
Type stringThe type of the message input. Always set to
message.const ResponseInputItemMessageTypeMessage ResponseInputItemMessageType = "message"
-
-
type ResponseOutputMessage struct{…}An output message from the model.
-
ID stringThe unique ID of the output message.
-
Content []ResponseOutputMessageContentUnionThe content of the output message.
-
type ResponseOutputText struct{…}A text output from the model.
-
Annotations []ResponseOutputTextAnnotationUnionThe annotations of the text output.
-
type ResponseOutputTextAnnotationFileCitation struct{…}A citation to a file.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the file cited.
-
Index int64The index of the file in the list of files.
-
Type FileCitationThe type of the file citation. Always
file_citation.const FileCitationFileCitation FileCitation = "file_citation"
-
-
type ResponseOutputTextAnnotationURLCitation struct{…}A citation for a web resource used to generate a model response.
-
EndIndex int64The index of the last character of the URL citation in the message.
-
StartIndex int64The index of the first character of the URL citation in the message.
-
Title stringThe title of the web resource.
-
Type URLCitationThe type of the URL citation. Always
url_citation.const URLCitationURLCitation URLCitation = "url_citation"
-
URL stringThe URL of the web resource.
-
-
type ResponseOutputTextAnnotationContainerFileCitation struct{…}A citation for a container file used to generate a model response.
-
ContainerID stringThe ID of the container file.
-
EndIndex int64The index of the last character of the container file citation in the message.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the container file cited.
-
StartIndex int64The index of the first character of the container file citation in the message.
-
Type ContainerFileCitationThe type of the container file citation. Always
container_file_citation.const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"
-
-
type ResponseOutputTextAnnotationFilePath struct{…}A path to a file.
-
FileID stringThe ID of the file.
-
Index int64The index of the file in the list of files.
-
Type FilePathThe type of the file path. Always
file_path.const FilePathFilePath FilePath = "file_path"
-
-
-
Text stringThe text output from the model.
-
Type OutputTextThe type of the output text. Always
output_text.const OutputTextOutputText OutputText = "output_text"
-
Logprobs []ResponseOutputTextLogprob-
Token string -
Bytes []int64 -
Logprob float64 -
TopLogprobs []ResponseOutputTextLogprobTopLogprob-
Token string -
Bytes []int64 -
Logprob float64
-
-
-
-
type ResponseOutputRefusal struct{…}A refusal from the model.
-
Refusal stringThe refusal explanation from the model.
-
Type RefusalThe type of the refusal. Always
refusal.const RefusalRefusal Refusal = "refusal"
-
-
-
Role AssistantThe role of the output message. Always
assistant.const AssistantAssistant Assistant = "assistant"
-
Status ResponseOutputMessageStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseOutputMessageStatusInProgress ResponseOutputMessageStatus = "in_progress" -
const ResponseOutputMessageStatusCompleted ResponseOutputMessageStatus = "completed" -
const ResponseOutputMessageStatusIncomplete ResponseOutputMessageStatus = "incomplete"
-
-
Type MessageThe type of the output message. Always
message.const MessageMessage Message = "message"
-
Phase ResponseOutputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const ResponseOutputMessagePhaseCommentary ResponseOutputMessagePhase = "commentary" -
const ResponseOutputMessagePhaseFinalAnswer ResponseOutputMessagePhase = "final_answer"
-
-
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
ID stringThe unique ID of the file search tool call.
-
Queries []stringThe queries used to search for files.
-
Status ResponseFileSearchToolCallStatusThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
const ResponseFileSearchToolCallStatusInProgress ResponseFileSearchToolCallStatus = "in_progress" -
const ResponseFileSearchToolCallStatusSearching ResponseFileSearchToolCallStatus = "searching" -
const ResponseFileSearchToolCallStatusCompleted ResponseFileSearchToolCallStatus = "completed" -
const ResponseFileSearchToolCallStatusIncomplete ResponseFileSearchToolCallStatus = "incomplete" -
const ResponseFileSearchToolCallStatusFailed ResponseFileSearchToolCallStatus = "failed"
-
-
Type FileSearchCallThe type of the file search tool call. Always
file_search_call.const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"
-
Results []ResponseFileSearchToolCallResultThe results of the file search tool call.
-
Attributes map[string, ResponseFileSearchToolCallResultAttributeUnion]Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.
-
string -
float64 -
bool
-
-
FileID stringThe unique ID of the file.
-
Filename stringThe name of the file.
-
Score float64The relevance score of the file - a value between 0 and 1.
-
Text stringThe text that was retrieved from the file.
-
-
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
ID stringThe unique ID of the computer call.
-
CallID stringAn identifier used when responding to the tool call with output.
-
PendingSafetyChecks []ResponseComputerToolCallPendingSafetyCheckThe pending safety checks for the computer call.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status ResponseComputerToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseComputerToolCallStatusInProgress ResponseComputerToolCallStatus = "in_progress" -
const ResponseComputerToolCallStatusCompleted ResponseComputerToolCallStatus = "completed" -
const ResponseComputerToolCallStatusIncomplete ResponseComputerToolCallStatus = "incomplete"
-
-
Type ResponseComputerToolCallTypeThe type of the computer call. Always
computer_call.const ResponseComputerToolCallTypeComputerCall ResponseComputerToolCallType = "computer_call"
-
Action ResponseComputerToolCallActionUnionA click action.
-
type ResponseComputerToolCallActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ResponseComputerToolCallActionClickButtonLeft ResponseComputerToolCallActionClickButton = "left" -
const ResponseComputerToolCallActionClickButtonRight ResponseComputerToolCallActionClickButton = "right" -
const ResponseComputerToolCallActionClickButtonWheel ResponseComputerToolCallActionClickButton = "wheel" -
const ResponseComputerToolCallActionClickButtonBack ResponseComputerToolCallActionClickButton = "back" -
const ResponseComputerToolCallActionClickButtonForward ResponseComputerToolCallActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ResponseComputerToolCallActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ResponseComputerToolCallActionDrag struct{…}A drag action.
-
Path []ResponseComputerToolCallActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ResponseComputerToolCallActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ResponseComputerToolCallActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ResponseComputerToolCallActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ResponseComputerToolCallActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ResponseComputerToolCallActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ResponseComputerToolCallActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
Actions ComputerActionListFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
type ComputerActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ComputerActionClickButtonLeft ComputerActionClickButton = "left" -
const ComputerActionClickButtonRight ComputerActionClickButton = "right" -
const ComputerActionClickButtonWheel ComputerActionClickButton = "wheel" -
const ComputerActionClickButtonBack ComputerActionClickButton = "back" -
const ComputerActionClickButtonForward ComputerActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ComputerActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ComputerActionDrag struct{…}A drag action.
-
Path []ComputerActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ComputerActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ComputerActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ComputerActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ComputerActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ComputerActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ComputerActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
-
type ResponseInputItemComputerCallOutput struct{…}The output of a computer tool call.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Type ComputerScreenshotSpecifies the event type. For a computer screenshot, this property is always set to
computer_screenshot.const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"
-
FileID stringThe identifier of an uploaded file that contains the screenshot.
-
ImageURL stringThe URL of the screenshot image.
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
ID stringThe ID of the computer tool call output.
-
AcknowledgedSafetyChecks []ResponseInputItemComputerCallOutputAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status stringThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseInputItemComputerCallOutputStatusInProgress ResponseInputItemComputerCallOutputStatus = "in_progress" -
const ResponseInputItemComputerCallOutputStatusCompleted ResponseInputItemComputerCallOutputStatus = "completed" -
const ResponseInputItemComputerCallOutputStatusIncomplete ResponseInputItemComputerCallOutputStatus = "incomplete"
-
-
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
ID stringThe unique ID of the web search tool call.
-
Action ResponseFunctionWebSearchActionUnionAn object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
type ResponseFunctionWebSearchActionSearch struct{…}Action type "search" - Performs a web search query.
-
Type SearchThe action type.
const SearchSearch Search = "search"
-
Queries []stringThe search queries.
-
Query stringThe search query.
-
Sources []ResponseFunctionWebSearchActionSearchSourceThe sources used in the search.
-
Type URLThe type of source. Always
url.const URLURL URL = "url"
-
URL stringThe URL of the source.
-
-
-
type ResponseFunctionWebSearchActionOpenPage struct{…}Action type "open_page" - Opens a specific URL from search results.
-
Type OpenPageThe action type.
const OpenPageOpenPage OpenPage = "open_page"
-
URL stringThe URL opened by the model.
-
-
type ResponseFunctionWebSearchActionFindInPage struct{…}Action type "find_in_page": Searches for a pattern within a loaded page.
-
Pattern stringThe pattern or text to search for within the page.
-
Type FindInPageThe action type.
const FindInPageFindInPage FindInPage = "find_in_page"
-
URL stringThe URL of the page searched for the pattern.
-
-
-
Status ResponseFunctionWebSearchStatusThe status of the web search tool call.
-
const ResponseFunctionWebSearchStatusInProgress ResponseFunctionWebSearchStatus = "in_progress" -
const ResponseFunctionWebSearchStatusSearching ResponseFunctionWebSearchStatus = "searching" -
const ResponseFunctionWebSearchStatusCompleted ResponseFunctionWebSearchStatus = "completed" -
const ResponseFunctionWebSearchStatusFailed ResponseFunctionWebSearchStatus = "failed"
-
-
Type WebSearchCallThe type of the web search tool call. Always
web_search_call.const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"
-
-
type ResponseFunctionToolCall struct{…}A tool call to run a function. See the function calling guide for more information.
-
Arguments stringA JSON string of the arguments to pass to the function.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Name stringThe name of the function to run.
-
Type FunctionCallThe type of the function tool call. Always
function_call.const FunctionCallFunctionCall FunctionCall = "function_call"
-
ID stringThe unique ID of the function tool call.
-
Namespace stringThe namespace of the function to run.
-
Status ResponseFunctionToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallStatusInProgress ResponseFunctionToolCallStatus = "in_progress" -
const ResponseFunctionToolCallStatusCompleted ResponseFunctionToolCallStatus = "completed" -
const ResponseFunctionToolCallStatusIncomplete ResponseFunctionToolCallStatus = "incomplete"
-
-
-
type ResponseInputItemFunctionCallOutput struct{…}The output of a function tool call.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseInputItemFunctionCallOutputOutputUnionText, image, or file output of the function tool call.
-
string -
type ResponseFunctionCallOutputItemList []ResponseFunctionCallOutputItemUnionAn array of content outputs (text, image, file) for the function tool call.
-
type ResponseInputTextContent struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImageContent struct{…}An image input to the model. Learn about image inputs
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
Detail ResponseInputImageContentDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageContentDetailLow ResponseInputImageContentDetail = "low" -
const ResponseInputImageContentDetailHigh ResponseInputImageContentDetail = "high" -
const ResponseInputImageContentDetailAuto ResponseInputImageContentDetail = "auto" -
const ResponseInputImageContentDetailOriginal ResponseInputImageContentDetail = "original"
-
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFileContent struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileContentDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileContentDetailLow ResponseInputFileContentDetail = "low" -
const ResponseInputFileContentDetailHigh ResponseInputFileContentDetail = "high"
-
-
FileData stringThe base64-encoded data of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
ID stringThe unique ID of the function tool call output. Populated when this item is returned via API.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputItemFunctionCallOutputStatusInProgress ResponseInputItemFunctionCallOutputStatus = "in_progress" -
const ResponseInputItemFunctionCallOutputStatusCompleted ResponseInputItemFunctionCallOutputStatus = "completed" -
const ResponseInputItemFunctionCallOutputStatusIncomplete ResponseInputItemFunctionCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemToolSearchCall struct{…}-
Arguments anyThe arguments supplied to the tool search call.
-
Type ToolSearchCallThe item type. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
ID stringThe unique ID of this tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution stringWhether tool search was executed by the server or by the client.
-
const ResponseInputItemToolSearchCallExecutionServer ResponseInputItemToolSearchCallExecution = "server" -
const ResponseInputItemToolSearchCallExecutionClient ResponseInputItemToolSearchCallExecution = "client"
-
-
Status stringThe status of the tool search call.
-
const ResponseInputItemToolSearchCallStatusInProgress ResponseInputItemToolSearchCallStatus = "in_progress" -
const ResponseInputItemToolSearchCallStatusCompleted ResponseInputItemToolSearchCallStatus = "completed" -
const ResponseInputItemToolSearchCallStatusIncomplete ResponseInputItemToolSearchCallStatus = "incomplete"
-
-
-
type ResponseToolSearchOutputItemParamResp struct{…}-
Tools []ToolUnionThe loaded tool definitions returned by the tool search output.
-
type FunctionTool struct{…}Defines a function in your own code the model can choose to call. Learn more about function calling.
-
Name stringThe name of the function to call.
-
Parameters map[string, any]A JSON schema object describing the parameters of the function.
-
Strict boolWhether to enforce strict parameter validation. Default
true. -
Type FunctionThe type of the function tool. Always
function.const FunctionFunction Function = "function"
-
DeferLoading boolWhether this function is deferred and loaded via tool search.
-
Description stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
type FileSearchTool struct{…}A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
Type FileSearchThe type of the file search tool. Always
file_search.const FileSearchFileSearch FileSearch = "file_search"
-
VectorStoreIDs []stringThe IDs of the vector stores to search.
-
Filters FileSearchToolFiltersUnionA filter to apply.
-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
Key stringThe key to compare against the value.
-
Type ComparisonFilterTypeSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
const ComparisonFilterTypeEq ComparisonFilterType = "eq" -
const ComparisonFilterTypeNe ComparisonFilterType = "ne" -
const ComparisonFilterTypeGt ComparisonFilterType = "gt" -
const ComparisonFilterTypeGte ComparisonFilterType = "gte" -
const ComparisonFilterTypeLt ComparisonFilterType = "lt" -
const ComparisonFilterTypeLte ComparisonFilterType = "lte" -
const ComparisonFilterTypeIn ComparisonFilterType = "in" -
const ComparisonFilterTypeNin ComparisonFilterType = "nin"
-
-
Value ComparisonFilterValueUnionThe value to compare against the attribute key; supports string, number, or boolean types.
-
string -
float64 -
bool -
type ComparisonFilterValueArray []ComparisonFilterValueArrayItemUnion-
string -
float64
-
-
-
-
type CompoundFilter struct{…}Combine multiple filters using
andoror.-
Filters []ComparisonFilterArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
-
Type CompoundFilterTypeType of operation:
andoror.-
const CompoundFilterTypeAnd CompoundFilterType = "and" -
const CompoundFilterTypeOr CompoundFilterType = "or"
-
-
-
-
MaxNumResults int64The maximum number of results to return. This number should be between 1 and 50 inclusive.
-
RankingOptions FileSearchToolRankingOptionsRanking options for search.
-
HybridSearch FileSearchToolRankingOptionsHybridSearchWeights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
EmbeddingWeight float64The weight of the embedding in the reciprocal ranking fusion.
-
TextWeight float64The weight of the text in the reciprocal ranking fusion.
-
-
Ranker stringThe ranker to use for the file search.
-
const FileSearchToolRankingOptionsRankerAuto FileSearchToolRankingOptionsRanker = "auto" -
const FileSearchToolRankingOptionsRankerDefault2024_11_15 FileSearchToolRankingOptionsRanker = "default-2024-11-15"
-
-
ScoreThreshold float64The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
Type ComputerThe type of the computer tool. Always
computer.const ComputerComputer Computer = "computer"
-
-
type ComputerUsePreviewTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
DisplayHeight int64The height of the computer display.
-
DisplayWidth int64The width of the computer display.
-
Environment ComputerUsePreviewToolEnvironmentThe type of computer environment to control.
-
const ComputerUsePreviewToolEnvironmentWindows ComputerUsePreviewToolEnvironment = "windows" -
const ComputerUsePreviewToolEnvironmentMac ComputerUsePreviewToolEnvironment = "mac" -
const ComputerUsePreviewToolEnvironmentLinux ComputerUsePreviewToolEnvironment = "linux" -
const ComputerUsePreviewToolEnvironmentUbuntu ComputerUsePreviewToolEnvironment = "ubuntu" -
const ComputerUsePreviewToolEnvironmentBrowser ComputerUsePreviewToolEnvironment = "browser"
-
-
Type ComputerUsePreviewThe type of the computer use tool. Always
computer_use_preview.const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"
-
-
type WebSearchTool struct{…}Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
Type WebSearchToolTypeThe type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
const WebSearchToolTypeWebSearch WebSearchToolType = "web_search" -
const WebSearchToolTypeWebSearch2025_08_26 WebSearchToolType = "web_search_2025_08_26"
-
-
Filters WebSearchToolFiltersFilters for the search.
-
AllowedDomains []stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
SearchContextSize WebSearchToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchToolSearchContextSizeLow WebSearchToolSearchContextSize = "low" -
const WebSearchToolSearchContextSizeMedium WebSearchToolSearchContextSize = "medium" -
const WebSearchToolSearchContextSizeHigh WebSearchToolSearchContextSize = "high"
-
-
UserLocation WebSearchToolUserLocationThe approximate location of the user.
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
Type stringThe type of location approximation. Always
approximate.const WebSearchToolUserLocationTypeApproximate WebSearchToolUserLocationType = "approximate"
-
-
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
ServerLabel stringA label for this MCP server, used to identify it in tool calls.
-
Type McpThe type of the MCP tool. Always
mcp.const McpMcp Mcp = "mcp"
-
AllowedTools ToolMcpAllowedToolsUnionList of allowed tool names or a filter object.
-
type ToolMcpAllowedToolsMcpAllowedTools []stringA string array of allowed tool names
-
type ToolMcpAllowedToolsMcpToolFilter struct{…}A filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
Authorization stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
ConnectorID stringIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
const ToolMcpConnectorIDConnectorDropbox ToolMcpConnectorID = "connector_dropbox" -
const ToolMcpConnectorIDConnectorGmail ToolMcpConnectorID = "connector_gmail" -
const ToolMcpConnectorIDConnectorGooglecalendar ToolMcpConnectorID = "connector_googlecalendar" -
const ToolMcpConnectorIDConnectorGoogledrive ToolMcpConnectorID = "connector_googledrive" -
const ToolMcpConnectorIDConnectorMicrosoftteams ToolMcpConnectorID = "connector_microsoftteams" -
const ToolMcpConnectorIDConnectorOutlookcalendar ToolMcpConnectorID = "connector_outlookcalendar" -
const ToolMcpConnectorIDConnectorOutlookemail ToolMcpConnectorID = "connector_outlookemail" -
const ToolMcpConnectorIDConnectorSharepoint ToolMcpConnectorID = "connector_sharepoint"
-
-
DeferLoading boolWhether this MCP tool is deferred and discovered via tool search.
-
Headers map[string, string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
RequireApproval ToolMcpRequireApprovalUnionSpecify which of the MCP server's tools require approval.
-
type ToolMcpRequireApprovalMcpToolApprovalFilter 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.-
Always ToolMcpRequireApprovalMcpToolApprovalFilterAlwaysA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
Never ToolMcpRequireApprovalMcpToolApprovalFilterNeverA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
type ToolMcpRequireApprovalMcpToolApprovalSetting stringSpecify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
const ToolMcpRequireApprovalMcpToolApprovalSettingAlways ToolMcpRequireApprovalMcpToolApprovalSetting = "always" -
const ToolMcpRequireApprovalMcpToolApprovalSettingNever ToolMcpRequireApprovalMcpToolApprovalSetting = "never"
-
-
-
ServerDescription stringOptional description of the MCP server, used to provide more context.
-
ServerURL stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
TunnelID stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
Container ToolCodeInterpreterContainerUnionThe code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
string -
type ToolCodeInterpreterContainerCodeInterpreterContainerAuto struct{…}Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
Type AutoAlways
auto.const AutoAuto Auto = "auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit stringThe memory limit for the code interpreter container.
-
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"
-
-
NetworkPolicy ToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…}-
Type DisabledDisable outbound network access. Always
disabled.const DisabledDisabled Disabled = "disabled"
-
-
type ContainerNetworkPolicyAllowlist struct{…}-
AllowedDomains []stringA list of allowed domains when type is
allowlist. -
Type AllowlistAllow outbound network access only to specified domains. Always
allowlist.const AllowlistAllowlist Allowlist = "allowlist"
-
DomainSecrets []ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
Domain stringThe domain associated with the secret.
-
Name stringThe name of the secret to inject for the domain.
-
Value stringThe secret value to inject for the domain.
-
-
-
-
-
-
Type CodeInterpreterThe type of the code interpreter tool. Always
code_interpreter.const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"
-
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
Type ImageGenerationThe type of the image generation tool. Always
image_generation.const ImageGenerationImageGeneration ImageGeneration = "image_generation"
-
Action stringWhether to generate a new image or edit an existing image. Default:
auto.-
const ToolImageGenerationActionGenerate ToolImageGenerationAction = "generate" -
const ToolImageGenerationActionEdit ToolImageGenerationAction = "edit" -
const ToolImageGenerationActionAuto ToolImageGenerationAction = "auto"
-
-
Background stringAllows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
const ToolImageGenerationBackgroundTransparent ToolImageGenerationBackground = "transparent" -
const ToolImageGenerationBackgroundOpaque ToolImageGenerationBackground = "opaque" -
const ToolImageGenerationBackgroundAuto ToolImageGenerationBackground = "auto"
-
-
InputFidelity stringControl how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
const ToolImageGenerationInputFidelityHigh ToolImageGenerationInputFidelity = "high" -
const ToolImageGenerationInputFidelityLow ToolImageGenerationInputFidelity = "low"
-
-
InputImageMask ToolImageGenerationInputImageMaskOptional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
FileID stringFile ID for the mask image.
-
ImageURL stringBase64-encoded mask image.
-
-
Model stringThe image generation model to use. Default:
gpt-image-1.-
string -
string-
const ToolImageGenerationModelGPTImage1 ToolImageGenerationModel = "gpt-image-1" -
const ToolImageGenerationModelGPTImage1Mini ToolImageGenerationModel = "gpt-image-1-mini" -
const ToolImageGenerationModelGPTImage2 ToolImageGenerationModel = "gpt-image-2" -
const ToolImageGenerationModelGPTImage2_2026_04_21 ToolImageGenerationModel = "gpt-image-2-2026-04-21" -
const ToolImageGenerationModelGPTImage1_5 ToolImageGenerationModel = "gpt-image-1.5" -
const ToolImageGenerationModelChatgptImageLatest ToolImageGenerationModel = "chatgpt-image-latest"
-
-
-
Moderation stringModeration level for the generated image. Default:
auto.-
const ToolImageGenerationModerationAuto ToolImageGenerationModeration = "auto" -
const ToolImageGenerationModerationLow ToolImageGenerationModeration = "low"
-
-
OutputCompression int64Compression level for the output image. Default: 100.
-
OutputFormat stringThe output format of the generated image. One of
png,webp, orjpeg. Default:png.-
const ToolImageGenerationOutputFormatPNG ToolImageGenerationOutputFormat = "png" -
const ToolImageGenerationOutputFormatWebP ToolImageGenerationOutputFormat = "webp" -
const ToolImageGenerationOutputFormatJPEG ToolImageGenerationOutputFormat = "jpeg"
-
-
PartialImages int64Number of partial images to generate in streaming mode, from 0 (default value) to 3.
-
Quality stringThe quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
const ToolImageGenerationQualityLow ToolImageGenerationQuality = "low" -
const ToolImageGenerationQualityMedium ToolImageGenerationQuality = "medium" -
const ToolImageGenerationQualityHigh ToolImageGenerationQuality = "high" -
const ToolImageGenerationQualityAuto ToolImageGenerationQuality = "auto"
-
-
Size stringThe size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
string -
string-
const ToolImageGenerationSize1024x1024 ToolImageGenerationSize = "1024x1024" -
const ToolImageGenerationSize1024x1536 ToolImageGenerationSize = "1024x1536" -
const ToolImageGenerationSize1536x1024 ToolImageGenerationSize = "1536x1024" -
const ToolImageGenerationSizeAuto ToolImageGenerationSize = "auto"
-
-
-
-
type ToolLocalShell struct{…}A tool that allows the model to execute shell commands in a local environment.
-
Type LocalShellThe type of the local shell tool. Always
local_shell.const LocalShellLocalShell LocalShell = "local_shell"
-
-
type FunctionShellTool struct{…}A tool that allows the model to execute shell commands.
-
Type ShellThe type of the shell tool. Always
shell.const ShellShell Shell = "shell"
-
Environment FunctionShellToolEnvironmentUnion-
type ContainerAuto struct{…}-
Type ContainerAutoAutomatically creates a container for this request
const ContainerAutoContainerAuto ContainerAuto = "container_auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit ContainerAutoMemoryLimitThe memory limit for the container.
-
const ContainerAutoMemoryLimit1g ContainerAutoMemoryLimit = "1g" -
const ContainerAutoMemoryLimit4g ContainerAutoMemoryLimit = "4g" -
const ContainerAutoMemoryLimit16g ContainerAutoMemoryLimit = "16g" -
const ContainerAutoMemoryLimit64g ContainerAutoMemoryLimit = "64g"
-
-
NetworkPolicy ContainerAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…} -
type ContainerNetworkPolicyAllowlist struct{…}
-
-
Skills []ContainerAutoSkillUnionAn optional list of skills referenced by id or inline data.
-
type SkillReference struct{…}-
SkillID stringThe ID of the referenced skill.
-
Type SkillReferenceReferences a skill created with the /v1/skills endpoint.
const SkillReferenceSkillReference SkillReference = "skill_reference"
-
Version stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
type InlineSkill struct{…}-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Source InlineSkillSourceInline skill payload
-
Data stringBase64-encoded skill zip bundle.
-
MediaType ApplicationZipThe media type of the inline skill payload. Must be
application/zip.const ApplicationZipApplicationZip ApplicationZip = "application/zip"
-
Type Base64The type of the inline skill source. Must be
base64.const Base64Base64 Base64 = "base64"
-
-
Type InlineDefines an inline skill for this request.
const InlineInline Inline = "inline"
-
-
-
-
type LocalEnvironment struct{…}-
Type LocalUse a local computer environment.
const LocalLocal Local = "local"
-
Skills []LocalSkillAn optional list of skills.
-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Path stringThe path to the directory containing the skill.
-
-
-
type ContainerReference struct{…}-
ContainerID stringThe ID of the referenced container.
-
Type ContainerReferenceReferences a container created with the /v1/containers endpoint
const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
Name stringThe name of the custom tool, used to identify it in tool calls.
-
Type CustomThe type of the custom tool. Always
custom.const CustomCustom Custom = "custom"
-
DeferLoading boolWhether this tool should be deferred and discovered via tool search.
-
Description stringOptional description of the custom tool, used to provide more context.
-
Format CustomToolInputFormatUnionThe input format for the custom tool. Default is unconstrained text.
-
type CustomToolInputFormatText struct{…}Unconstrained free-form text.
-
Type TextUnconstrained text format. Always
text.const TextText Text = "text"
-
-
type CustomToolInputFormatGrammar struct{…}A grammar defined by the user.
-
Definition stringThe grammar definition.
-
Syntax stringThe syntax of the grammar definition. One of
larkorregex.-
const CustomToolInputFormatGrammarSyntaxLark CustomToolInputFormatGrammarSyntax = "lark" -
const CustomToolInputFormatGrammarSyntaxRegex CustomToolInputFormatGrammarSyntax = "regex"
-
-
Type GrammarGrammar format. Always
grammar.const GrammarGrammar Grammar = "grammar"
-
-
-
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
Description stringA description of the namespace shown to the model.
-
Name stringThe namespace name used in tool calls (for example,
crm). -
Tools []NamespaceToolToolUnionThe function/custom tools available inside this namespace.
-
type NamespaceToolToolFunction struct{…}-
Name string -
Type Functionconst FunctionFunction Function = "function"
-
DeferLoading boolWhether this function should be deferred and discovered via tool search.
-
Description string -
Parameters any -
Strict bool
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
-
Type NamespaceThe type of the tool. Always
namespace.const NamespaceNamespace Namespace = "namespace"
-
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
Type ToolSearchThe type of the tool. Always
tool_search.const ToolSearchToolSearch ToolSearch = "tool_search"
-
Description stringDescription shown to the model for a client-executed tool search tool.
-
Execution ToolSearchToolExecutionWhether tool search is executed by the server or by the client.
-
const ToolSearchToolExecutionServer ToolSearchToolExecution = "server" -
const ToolSearchToolExecutionClient ToolSearchToolExecution = "client"
-
-
Parameters anyParameter schema for a client-executed tool search tool.
-
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
Type WebSearchPreviewToolTypeThe type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
const WebSearchPreviewToolTypeWebSearchPreview WebSearchPreviewToolType = "web_search_preview" -
const WebSearchPreviewToolTypeWebSearchPreview2025_03_11 WebSearchPreviewToolType = "web_search_preview_2025_03_11"
-
-
SearchContentTypes []string-
const WebSearchPreviewToolSearchContentTypeText WebSearchPreviewToolSearchContentType = "text" -
const WebSearchPreviewToolSearchContentTypeImage WebSearchPreviewToolSearchContentType = "image"
-
-
SearchContextSize WebSearchPreviewToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchPreviewToolSearchContextSizeLow WebSearchPreviewToolSearchContextSize = "low" -
const WebSearchPreviewToolSearchContextSizeMedium WebSearchPreviewToolSearchContextSize = "medium" -
const WebSearchPreviewToolSearchContextSizeHigh WebSearchPreviewToolSearchContextSize = "high"
-
-
UserLocation WebSearchPreviewToolUserLocationThe user's location.
-
Type ApproximateThe type of location approximation. Always
approximate.const ApproximateApproximate Approximate = "approximate"
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
Type ApplyPatchThe type of the tool. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
-
Type ToolSearchOutputThe item type. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
ID stringThe unique ID of this tool search output.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemParamExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemParamExecutionServer ResponseToolSearchOutputItemParamExecution = "server" -
const ResponseToolSearchOutputItemParamExecutionClient ResponseToolSearchOutputItemParamExecution = "client"
-
-
Status ResponseToolSearchOutputItemParamStatusThe status of the tool search output.
-
const ResponseToolSearchOutputItemParamStatusInProgress ResponseToolSearchOutputItemParamStatus = "in_progress" -
const ResponseToolSearchOutputItemParamStatusCompleted ResponseToolSearchOutputItemParamStatus = "completed" -
const ResponseToolSearchOutputItemParamStatusIncomplete ResponseToolSearchOutputItemParamStatus = "incomplete"
-
-
-
type ResponseInputItemAdditionalTools struct{…}-
Role DeveloperThe role that provided the additional tools. Only
developeris supported.const DeveloperDeveloper Developer = "developer"
-
Tools []ToolUnionA list of additional tools made available at this item.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type AdditionalToolsThe item type. Always
additional_tools.const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"
-
ID stringThe unique ID of this additional tools item.
-
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
ID stringThe unique identifier of the reasoning content.
-
Summary []ResponseReasoningItemSummaryReasoning summary content.
-
Text stringA summary of the reasoning output from the model so far.
-
Type SummaryTextThe type of the object. Always
summary_text.const SummaryTextSummaryText SummaryText = "summary_text"
-
-
Type ReasoningThe type of the object. Always
reasoning.const ReasoningReasoning Reasoning = "reasoning"
-
Content []ResponseReasoningItemContentReasoning text content.
-
Text stringThe reasoning text from the model.
-
Type ReasoningTextThe type of the reasoning text. Always
reasoning_text.const ReasoningTextReasoningText ReasoningText = "reasoning_text"
-
-
EncryptedContent stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
Status ResponseReasoningItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseReasoningItemStatusInProgress ResponseReasoningItemStatus = "in_progress" -
const ResponseReasoningItemStatusCompleted ResponseReasoningItemStatus = "completed" -
const ResponseReasoningItemStatusIncomplete ResponseReasoningItemStatus = "incomplete"
-
-
-
type ResponseCompactionItemParamResp struct{…}A compaction item generated by the
v1/responses/compactAPI.-
EncryptedContent stringThe encrypted content of the compaction summary.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
ID stringThe ID of the compaction item.
-
-
type ResponseInputItemImageGenerationCall struct{…}An image generation request made by the model.
-
ID stringThe unique ID of the image generation call.
-
Result stringThe generated image encoded in base64.
-
Status stringThe status of the image generation call.
-
const ResponseInputItemImageGenerationCallStatusInProgress ResponseInputItemImageGenerationCallStatus = "in_progress" -
const ResponseInputItemImageGenerationCallStatusCompleted ResponseInputItemImageGenerationCallStatus = "completed" -
const ResponseInputItemImageGenerationCallStatusGenerating ResponseInputItemImageGenerationCallStatus = "generating" -
const ResponseInputItemImageGenerationCallStatusFailed ResponseInputItemImageGenerationCallStatus = "failed"
-
-
Type ImageGenerationCallThe type of the image generation call. Always
image_generation_call.const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"
-
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
ID stringThe unique ID of the code interpreter tool call.
-
Code stringThe code to run, or null if not available.
-
ContainerID stringThe ID of the container used to run the code.
-
Outputs []ResponseCodeInterpreterToolCallOutputUnionThe outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
type ResponseCodeInterpreterToolCallOutputLogs struct{…}The logs output from the code interpreter.
-
Logs stringThe logs output from the code interpreter.
-
Type LogsThe type of the output. Always
logs.const LogsLogs Logs = "logs"
-
-
type ResponseCodeInterpreterToolCallOutputImage struct{…}The image output from the code interpreter.
-
Type ImageThe type of the output. Always
image.const ImageImage Image = "image"
-
URL stringThe URL of the image output from the code interpreter.
-
-
-
Status ResponseCodeInterpreterToolCallStatusThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
const ResponseCodeInterpreterToolCallStatusInProgress ResponseCodeInterpreterToolCallStatus = "in_progress" -
const ResponseCodeInterpreterToolCallStatusCompleted ResponseCodeInterpreterToolCallStatus = "completed" -
const ResponseCodeInterpreterToolCallStatusIncomplete ResponseCodeInterpreterToolCallStatus = "incomplete" -
const ResponseCodeInterpreterToolCallStatusInterpreting ResponseCodeInterpreterToolCallStatus = "interpreting" -
const ResponseCodeInterpreterToolCallStatusFailed ResponseCodeInterpreterToolCallStatus = "failed"
-
-
Type CodeInterpreterCallThe type of the code interpreter tool call. Always
code_interpreter_call.const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"
-
-
type ResponseInputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
ID stringThe unique ID of the local shell call.
-
Action ResponseInputItemLocalShellCallActionExecute a shell command on the server.
-
Command []stringThe command to run.
-
Env map[string, string]Environment variables to set for the command.
-
Type ExecThe type of the local shell action. Always
exec.const ExecExec Exec = "exec"
-
TimeoutMs int64Optional timeout in milliseconds for the command.
-
User stringOptional user to run the command as.
-
WorkingDirectory stringOptional working directory to run the command in.
-
-
CallID stringThe unique ID of the local shell tool call generated by the model.
-
Status stringThe status of the local shell call.
-
const ResponseInputItemLocalShellCallStatusInProgress ResponseInputItemLocalShellCallStatus = "in_progress" -
const ResponseInputItemLocalShellCallStatusCompleted ResponseInputItemLocalShellCallStatus = "completed" -
const ResponseInputItemLocalShellCallStatusIncomplete ResponseInputItemLocalShellCallStatus = "incomplete"
-
-
Type LocalShellCallThe type of the local shell call. Always
local_shell_call.const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"
-
-
type ResponseInputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
ID stringThe unique ID of the local shell tool call generated by the model.
-
Output stringA JSON string of the output of the local shell tool call.
-
Type LocalShellCallOutputThe type of the local shell tool call output. Always
local_shell_call_output.const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete.-
const ResponseInputItemLocalShellCallOutputStatusInProgress ResponseInputItemLocalShellCallOutputStatus = "in_progress" -
const ResponseInputItemLocalShellCallOutputStatusCompleted ResponseInputItemLocalShellCallOutputStatus = "completed" -
const ResponseInputItemLocalShellCallOutputStatusIncomplete ResponseInputItemLocalShellCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemShellCall struct{…}A tool representing a request to execute one or more shell commands.
-
Action ResponseInputItemShellCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []stringOrdered shell commands for the execution environment to run.
-
MaxOutputLength int64Maximum number of UTF-8 characters to capture from combined stdout and stderr output.
-
TimeoutMs int64Maximum wall-clock time in milliseconds to allow the shell commands to run.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Environment ResponseInputItemShellCallEnvironmentUnionThe environment to execute the shell commands in.
-
type LocalEnvironment struct{…} -
type ContainerReference struct{…}
-
-
Status stringThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseInputItemShellCallStatusInProgress ResponseInputItemShellCallStatus = "in_progress" -
const ResponseInputItemShellCallStatusCompleted ResponseInputItemShellCallStatus = "completed" -
const ResponseInputItemShellCallStatusIncomplete ResponseInputItemShellCallStatus = "incomplete"
-
-
-
type ResponseInputItemShellCallOutput struct{…}The streamed output items emitted by a shell tool call.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Output []ResponseFunctionShellCallOutputContentCaptured chunks of stdout and stderr output, along with their associated outcomes.
-
Outcome ResponseFunctionShellCallOutputContentOutcomeUnionThe exit or timeout outcome associated with this shell call.
-
type ResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellCallOutputContentOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64The exit code returned by the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringCaptured stderr output for the shell call.
-
Stdout stringCaptured stdout output for the shell call.
-
-
Type ShellCallOutputThe type of the item. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
ID stringThe unique ID of the shell tool call output. Populated when this item is returned via API.
-
MaxOutputLength int64The maximum number of UTF-8 characters captured for this shell call's combined output.
-
Status stringThe status of the shell call output.
-
const ResponseInputItemShellCallOutputStatusInProgress ResponseInputItemShellCallOutputStatus = "in_progress" -
const ResponseInputItemShellCallOutputStatusCompleted ResponseInputItemShellCallOutputStatus = "completed" -
const ResponseInputItemShellCallOutputStatusIncomplete ResponseInputItemShellCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemApplyPatchCall struct{…}A tool call representing a request to create, delete, or update files using diff patches.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseInputItemApplyPatchCallOperationUnionThe specific create, delete, or update instruction for the apply_patch tool call.
-
type ResponseInputItemApplyPatchCallOperationCreateFile struct{…}Instruction for creating a new file via the apply_patch tool.
-
Diff stringUnified diff content to apply when creating the file.
-
Path stringPath of the file to create relative to the workspace root.
-
Type CreateFileThe operation type. Always
create_file.const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseInputItemApplyPatchCallOperationDeleteFile struct{…}Instruction for deleting an existing file via the apply_patch tool.
-
Path stringPath of the file to delete relative to the workspace root.
-
Type DeleteFileThe operation type. Always
delete_file.const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseInputItemApplyPatchCallOperationUpdateFile struct{…}Instruction for updating an existing file via the apply_patch tool.
-
Diff stringUnified diff content to apply to the existing file.
-
Path stringPath of the file to update relative to the workspace root.
-
Type UpdateFileThe operation type. Always
update_file.const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status stringThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseInputItemApplyPatchCallStatusInProgress ResponseInputItemApplyPatchCallStatus = "in_progress" -
const ResponseInputItemApplyPatchCallStatusCompleted ResponseInputItemApplyPatchCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
-
type ResponseInputItemApplyPatchCallOutput struct{…}The streamed output emitted by an apply patch tool call.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status stringThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseInputItemApplyPatchCallOutputStatusCompleted ResponseInputItemApplyPatchCallOutputStatus = "completed" -
const ResponseInputItemApplyPatchCallOutputStatusFailed ResponseInputItemApplyPatchCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
Output stringOptional human-readable log text from the apply patch tool (e.g., patch results or errors).
-
-
type ResponseInputItemMcpListTools struct{…}A list of tools available on an MCP server.
-
ID stringThe unique ID of the list.
-
ServerLabel stringThe label of the MCP server.
-
Tools []ResponseInputItemMcpListToolsToolThe tools available on the server.
-
InputSchema anyThe JSON schema describing the tool's input.
-
Name stringThe name of the tool.
-
Annotations anyAdditional annotations about the tool.
-
Description stringThe description of the tool.
-
-
Type McpListToolsThe type of the item. Always
mcp_list_tools.const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
-
Error stringError message if the server could not list tools.
-
-
type ResponseInputItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
ID stringThe unique ID of the approval request.
-
Arguments stringA JSON string of arguments for the tool.
-
Name stringThe name of the tool to run.
-
ServerLabel stringThe label of the MCP server making the request.
-
Type McpApprovalRequestThe type of the item. Always
mcp_approval_request.const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"
-
-
type ResponseInputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
ApprovalRequestID stringThe ID of the approval request being answered.
-
Approve boolWhether the request was approved.
-
Type McpApprovalResponseThe type of the item. Always
mcp_approval_response.const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
-
ID stringThe unique ID of the approval response
-
Reason stringOptional reason for the decision.
-
-
type ResponseInputItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
ID stringThe unique ID of the tool call.
-
Arguments stringA JSON string of the arguments passed to the tool.
-
Name stringThe name of the tool that was run.
-
ServerLabel stringThe label of the MCP server running the tool.
-
Type McpCallThe type of the item. Always
mcp_call.const McpCallMcpCall McpCall = "mcp_call"
-
ApprovalRequestID stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
Error stringThe error from the tool call, if any.
-
Output stringThe output from the tool call.
-
Status stringThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
const ResponseInputItemMcpCallStatusInProgress ResponseInputItemMcpCallStatus = "in_progress" -
const ResponseInputItemMcpCallStatusCompleted ResponseInputItemMcpCallStatus = "completed" -
const ResponseInputItemMcpCallStatusIncomplete ResponseInputItemMcpCallStatus = "incomplete" -
const ResponseInputItemMcpCallStatusCalling ResponseInputItemMcpCallStatus = "calling" -
const ResponseInputItemMcpCallStatusFailed ResponseInputItemMcpCallStatus = "failed"
-
-
-
type ResponseCustomToolCallOutput struct{…}The output of a custom tool call from your code, being sent back to the model.
-
CallID stringThe call ID, used to map this custom tool call output to a custom tool call.
-
Output ResponseCustomToolCallOutputOutputUnionThe output from the custom tool call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseCustomToolCallOutputOutputOutputContentList []ResponseCustomToolCallOutputOutputOutputContentListItemUnionText, image, or file output of the custom tool call.
-
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
-
Type CustomToolCallOutputThe type of the custom tool call output. Always
custom_tool_call_output.const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"
-
ID stringThe unique ID of the custom tool call output in the OpenAI platform.
-
-
type ResponseCustomToolCall struct{…}A call to a custom tool created by the model.
-
CallID stringAn identifier used to map this custom tool call to a tool call output.
-
Input stringThe input for the custom tool call generated by the model.
-
Name stringThe name of the custom tool being called.
-
Type CustomToolCallThe type of the custom tool call. Always
custom_tool_call.const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"
-
ID stringThe unique ID of the custom tool call in the OpenAI platform.
-
Namespace stringThe namespace of the custom tool being called.
-
-
type ResponseInputItemCompactionTrigger struct{…}Compacts the current context. Must be the final input item.
-
Type CompactionTriggerThe type of the item. Always
compaction_trigger.const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"
-
-
type ResponseInputItemItemReference struct{…}An internal identifier for an item to reference.
-
ID stringThe ID of the item to reference.
-
Type stringThe type of item to reference. Always
item_reference.const ResponseInputItemItemReferenceTypeItemReference ResponseInputItemItemReferenceType = "item_reference"
-
-
-
-
Metadata MetadataSet of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
-
Model ResponsesModelModel ID used to generate the response, like
gpt-4ooro3. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models.-
string -
type ChatModel string-
const ChatModelGPT5_4 ChatModel = "gpt-5.4" -
const ChatModelGPT5_4Mini ChatModel = "gpt-5.4-mini" -
const ChatModelGPT5_4Nano ChatModel = "gpt-5.4-nano" -
const ChatModelGPT5_4Mini2026_03_17 ChatModel = "gpt-5.4-mini-2026-03-17" -
const ChatModelGPT5_4Nano2026_03_17 ChatModel = "gpt-5.4-nano-2026-03-17" -
const ChatModelGPT5_3ChatLatest ChatModel = "gpt-5.3-chat-latest" -
const ChatModelGPT5_2 ChatModel = "gpt-5.2" -
const ChatModelGPT5_2_2025_12_11 ChatModel = "gpt-5.2-2025-12-11" -
const ChatModelGPT5_2ChatLatest ChatModel = "gpt-5.2-chat-latest" -
const ChatModelGPT5_2Pro ChatModel = "gpt-5.2-pro" -
const ChatModelGPT5_2Pro2025_12_11 ChatModel = "gpt-5.2-pro-2025-12-11" -
const ChatModelGPT5_1 ChatModel = "gpt-5.1" -
const ChatModelGPT5_1_2025_11_13 ChatModel = "gpt-5.1-2025-11-13" -
const ChatModelGPT5_1Codex ChatModel = "gpt-5.1-codex" -
const ChatModelGPT5_1Mini ChatModel = "gpt-5.1-mini" -
const ChatModelGPT5_1ChatLatest ChatModel = "gpt-5.1-chat-latest" -
const ChatModelGPT5 ChatModel = "gpt-5" -
const ChatModelGPT5Mini ChatModel = "gpt-5-mini" -
const ChatModelGPT5Nano ChatModel = "gpt-5-nano" -
const ChatModelGPT5_2025_08_07 ChatModel = "gpt-5-2025-08-07" -
const ChatModelGPT5Mini2025_08_07 ChatModel = "gpt-5-mini-2025-08-07" -
const ChatModelGPT5Nano2025_08_07 ChatModel = "gpt-5-nano-2025-08-07" -
const ChatModelGPT5ChatLatest ChatModel = "gpt-5-chat-latest" -
const ChatModelGPT4_1 ChatModel = "gpt-4.1" -
const ChatModelGPT4_1Mini ChatModel = "gpt-4.1-mini" -
const ChatModelGPT4_1Nano ChatModel = "gpt-4.1-nano" -
const ChatModelGPT4_1_2025_04_14 ChatModel = "gpt-4.1-2025-04-14" -
const ChatModelGPT4_1Mini2025_04_14 ChatModel = "gpt-4.1-mini-2025-04-14" -
const ChatModelGPT4_1Nano2025_04_14 ChatModel = "gpt-4.1-nano-2025-04-14" -
const ChatModelO4Mini ChatModel = "o4-mini" -
const ChatModelO4Mini2025_04_16 ChatModel = "o4-mini-2025-04-16" -
const ChatModelO3 ChatModel = "o3" -
const ChatModelO3_2025_04_16 ChatModel = "o3-2025-04-16" -
const ChatModelO3Mini ChatModel = "o3-mini" -
const ChatModelO3Mini2025_01_31 ChatModel = "o3-mini-2025-01-31" -
const ChatModelO1 ChatModel = "o1" -
const ChatModelO1_2024_12_17 ChatModel = "o1-2024-12-17" -
const ChatModelO1Preview ChatModel = "o1-preview" -
const ChatModelO1Preview2024_09_12 ChatModel = "o1-preview-2024-09-12" -
const ChatModelO1Mini ChatModel = "o1-mini" -
const ChatModelO1Mini2024_09_12 ChatModel = "o1-mini-2024-09-12" -
const ChatModelGPT4o ChatModel = "gpt-4o" -
const ChatModelGPT4o2024_11_20 ChatModel = "gpt-4o-2024-11-20" -
const ChatModelGPT4o2024_08_06 ChatModel = "gpt-4o-2024-08-06" -
const ChatModelGPT4o2024_05_13 ChatModel = "gpt-4o-2024-05-13" -
const ChatModelGPT4oAudioPreview ChatModel = "gpt-4o-audio-preview" -
const ChatModelGPT4oAudioPreview2024_10_01 ChatModel = "gpt-4o-audio-preview-2024-10-01" -
const ChatModelGPT4oAudioPreview2024_12_17 ChatModel = "gpt-4o-audio-preview-2024-12-17" -
const ChatModelGPT4oAudioPreview2025_06_03 ChatModel = "gpt-4o-audio-preview-2025-06-03" -
const ChatModelGPT4oMiniAudioPreview ChatModel = "gpt-4o-mini-audio-preview" -
const ChatModelGPT4oMiniAudioPreview2024_12_17 ChatModel = "gpt-4o-mini-audio-preview-2024-12-17" -
const ChatModelGPT4oSearchPreview ChatModel = "gpt-4o-search-preview" -
const ChatModelGPT4oMiniSearchPreview ChatModel = "gpt-4o-mini-search-preview" -
const ChatModelGPT4oSearchPreview2025_03_11 ChatModel = "gpt-4o-search-preview-2025-03-11" -
const ChatModelGPT4oMiniSearchPreview2025_03_11 ChatModel = "gpt-4o-mini-search-preview-2025-03-11" -
const ChatModelChatgpt4oLatest ChatModel = "chatgpt-4o-latest" -
const ChatModelCodexMiniLatest ChatModel = "codex-mini-latest" -
const ChatModelGPT4oMini ChatModel = "gpt-4o-mini" -
const ChatModelGPT4oMini2024_07_18 ChatModel = "gpt-4o-mini-2024-07-18" -
const ChatModelGPT4Turbo ChatModel = "gpt-4-turbo" -
const ChatModelGPT4Turbo2024_04_09 ChatModel = "gpt-4-turbo-2024-04-09" -
const ChatModelGPT4_0125Preview ChatModel = "gpt-4-0125-preview" -
const ChatModelGPT4TurboPreview ChatModel = "gpt-4-turbo-preview" -
const ChatModelGPT4_1106Preview ChatModel = "gpt-4-1106-preview" -
const ChatModelGPT4VisionPreview ChatModel = "gpt-4-vision-preview" -
const ChatModelGPT4 ChatModel = "gpt-4" -
const ChatModelGPT4_0314 ChatModel = "gpt-4-0314" -
const ChatModelGPT4_0613 ChatModel = "gpt-4-0613" -
const ChatModelGPT4_32k ChatModel = "gpt-4-32k" -
const ChatModelGPT4_32k0314 ChatModel = "gpt-4-32k-0314" -
const ChatModelGPT4_32k0613 ChatModel = "gpt-4-32k-0613" -
const ChatModelGPT3_5Turbo ChatModel = "gpt-3.5-turbo" -
const ChatModelGPT3_5Turbo16k ChatModel = "gpt-3.5-turbo-16k" -
const ChatModelGPT3_5Turbo0301 ChatModel = "gpt-3.5-turbo-0301" -
const ChatModelGPT3_5Turbo0613 ChatModel = "gpt-3.5-turbo-0613" -
const ChatModelGPT3_5Turbo1106 ChatModel = "gpt-3.5-turbo-1106" -
const ChatModelGPT3_5Turbo0125 ChatModel = "gpt-3.5-turbo-0125" -
const ChatModelGPT3_5Turbo16k0613 ChatModel = "gpt-3.5-turbo-16k-0613"
-
-
type ResponsesModel string-
const ResponsesModelO1Pro ResponsesModel = "o1-pro" -
const ResponsesModelO1Pro2025_03_19 ResponsesModel = "o1-pro-2025-03-19" -
const ResponsesModelO3Pro ResponsesModel = "o3-pro" -
const ResponsesModelO3Pro2025_06_10 ResponsesModel = "o3-pro-2025-06-10" -
const ResponsesModelO3DeepResearch ResponsesModel = "o3-deep-research" -
const ResponsesModelO3DeepResearch2025_06_26 ResponsesModel = "o3-deep-research-2025-06-26" -
const ResponsesModelO4MiniDeepResearch ResponsesModel = "o4-mini-deep-research" -
const ResponsesModelO4MiniDeepResearch2025_06_26 ResponsesModel = "o4-mini-deep-research-2025-06-26" -
const ResponsesModelComputerUsePreview ResponsesModel = "computer-use-preview" -
const ResponsesModelComputerUsePreview2025_03_11 ResponsesModel = "computer-use-preview-2025-03-11" -
const ResponsesModelGPT5Codex ResponsesModel = "gpt-5-codex" -
const ResponsesModelGPT5Pro ResponsesModel = "gpt-5-pro" -
const ResponsesModelGPT5Pro2025_10_06 ResponsesModel = "gpt-5-pro-2025-10-06" -
const ResponsesModelGPT5_1CodexMax ResponsesModel = "gpt-5.1-codex-max"
-
-
-
Object ResponseThe object type of this resource - always set to
response.const ResponseResponse Response = "response"
-
Output []ResponseOutputItemUnionAn array of content items generated by the model.
-
The length and order of items in the
outputarray is dependent on the model's response. -
Rather than accessing the first item in the
outputarray and assuming it's anassistantmessage with the content generated by the model, you might consider using theoutput_textproperty where supported in SDKs. -
type ResponseOutputMessage struct{…}An output message from the model.
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
type ResponseFunctionToolCall struct{…}A tool call to run a function. See the function calling guide for more information.
-
type ResponseFunctionToolCallOutputItem struct{…}-
ID stringThe unique ID of the function call tool output.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseFunctionToolCallOutputItemOutputUnionThe output from the function call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseFunctionToolCallOutputItemOutputOutputContentList []ResponseFunctionToolCallOutputItemOutputOutputContentListItemUnionText, image, or file output of the function call.
-
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
-
Status ResponseFunctionToolCallOutputItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallOutputItemStatusInProgress ResponseFunctionToolCallOutputItemStatus = "in_progress" -
const ResponseFunctionToolCallOutputItemStatusCompleted ResponseFunctionToolCallOutputItemStatus = "completed" -
const ResponseFunctionToolCallOutputItemStatusIncomplete ResponseFunctionToolCallOutputItemStatus = "incomplete"
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
type ResponseComputerToolCallOutputItem struct{…}-
ID stringThe unique ID of the computer call tool output.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Status ResponseComputerToolCallOutputItemStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseComputerToolCallOutputItemStatusCompleted ResponseComputerToolCallOutputItemStatus = "completed" -
const ResponseComputerToolCallOutputItemStatusIncomplete ResponseComputerToolCallOutputItemStatus = "incomplete" -
const ResponseComputerToolCallOutputItemStatusFailed ResponseComputerToolCallOutputItemStatus = "failed" -
const ResponseComputerToolCallOutputItemStatusInProgress ResponseComputerToolCallOutputItemStatus = "in_progress"
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
AcknowledgedSafetyChecks []ResponseComputerToolCallOutputItemAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context. -
type ResponseToolSearchCall struct{…}-
ID stringThe unique ID of the tool search call item.
-
Arguments anyArguments used for the tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchCallExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchCallExecutionServer ResponseToolSearchCallExecution = "server" -
const ResponseToolSearchCallExecutionClient ResponseToolSearchCallExecution = "client"
-
-
Status ResponseToolSearchCallStatusThe status of the tool search call item that was recorded.
-
const ResponseToolSearchCallStatusInProgress ResponseToolSearchCallStatus = "in_progress" -
const ResponseToolSearchCallStatusCompleted ResponseToolSearchCallStatus = "completed" -
const ResponseToolSearchCallStatusIncomplete ResponseToolSearchCallStatus = "incomplete"
-
-
Type ToolSearchCallThe type of the item. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseToolSearchOutputItem struct{…}-
ID stringThe unique ID of the tool search output item.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemExecutionServer ResponseToolSearchOutputItemExecution = "server" -
const ResponseToolSearchOutputItemExecutionClient ResponseToolSearchOutputItemExecution = "client"
-
-
Status ResponseToolSearchOutputItemStatusThe status of the tool search output item that was recorded.
-
const ResponseToolSearchOutputItemStatusInProgress ResponseToolSearchOutputItemStatus = "in_progress" -
const ResponseToolSearchOutputItemStatusCompleted ResponseToolSearchOutputItemStatus = "completed" -
const ResponseToolSearchOutputItemStatusIncomplete ResponseToolSearchOutputItemStatus = "incomplete"
-
-
Tools []ToolUnionThe loaded tool definitions returned by tool search.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type ToolSearchOutputThe type of the item. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseOutputItemAdditionalTools struct{…}-
ID stringThe unique ID of the additional tools item.
-
Role stringThe role that provided the additional tools.
-
const ResponseOutputItemAdditionalToolsRoleUnknown ResponseOutputItemAdditionalToolsRole = "unknown" -
const ResponseOutputItemAdditionalToolsRoleUser ResponseOutputItemAdditionalToolsRole = "user" -
const ResponseOutputItemAdditionalToolsRoleAssistant ResponseOutputItemAdditionalToolsRole = "assistant" -
const ResponseOutputItemAdditionalToolsRoleSystem ResponseOutputItemAdditionalToolsRole = "system" -
const ResponseOutputItemAdditionalToolsRoleCritic ResponseOutputItemAdditionalToolsRole = "critic" -
const ResponseOutputItemAdditionalToolsRoleDiscriminator ResponseOutputItemAdditionalToolsRole = "discriminator" -
const ResponseOutputItemAdditionalToolsRoleDeveloper ResponseOutputItemAdditionalToolsRole = "developer" -
const ResponseOutputItemAdditionalToolsRoleTool ResponseOutputItemAdditionalToolsRole = "tool"
-
-
Tools []ToolUnionThe additional tool definitions made available at this item.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type AdditionalToolsThe type of the item. Always
additional_tools.const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"
-
-
type ResponseCompactionItem struct{…}A compaction item generated by the
v1/responses/compactAPI.-
ID stringThe unique ID of the compaction item.
-
EncryptedContent stringThe encrypted content that was produced by compaction.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseOutputItemImageGenerationCall struct{…}An image generation request made by the model.
-
ID stringThe unique ID of the image generation call.
-
Result stringThe generated image encoded in base64.
-
Status stringThe status of the image generation call.
-
const ResponseOutputItemImageGenerationCallStatusInProgress ResponseOutputItemImageGenerationCallStatus = "in_progress" -
const ResponseOutputItemImageGenerationCallStatusCompleted ResponseOutputItemImageGenerationCallStatus = "completed" -
const ResponseOutputItemImageGenerationCallStatusGenerating ResponseOutputItemImageGenerationCallStatus = "generating" -
const ResponseOutputItemImageGenerationCallStatusFailed ResponseOutputItemImageGenerationCallStatus = "failed"
-
-
Type ImageGenerationCallThe type of the image generation call. Always
image_generation_call.const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"
-
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
type ResponseOutputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
ID stringThe unique ID of the local shell call.
-
Action ResponseOutputItemLocalShellCallActionExecute a shell command on the server.
-
Command []stringThe command to run.
-
Env map[string, string]Environment variables to set for the command.
-
Type ExecThe type of the local shell action. Always
exec.const ExecExec Exec = "exec"
-
TimeoutMs int64Optional timeout in milliseconds for the command.
-
User stringOptional user to run the command as.
-
WorkingDirectory stringOptional working directory to run the command in.
-
-
CallID stringThe unique ID of the local shell tool call generated by the model.
-
Status stringThe status of the local shell call.
-
const ResponseOutputItemLocalShellCallStatusInProgress ResponseOutputItemLocalShellCallStatus = "in_progress" -
const ResponseOutputItemLocalShellCallStatusCompleted ResponseOutputItemLocalShellCallStatus = "completed" -
const ResponseOutputItemLocalShellCallStatusIncomplete ResponseOutputItemLocalShellCallStatus = "incomplete"
-
-
Type LocalShellCallThe type of the local shell call. Always
local_shell_call.const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"
-
-
type ResponseOutputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
ID stringThe unique ID of the local shell tool call generated by the model.
-
Output stringA JSON string of the output of the local shell tool call.
-
Type LocalShellCallOutputThe type of the local shell tool call output. Always
local_shell_call_output.const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete.-
const ResponseOutputItemLocalShellCallOutputStatusInProgress ResponseOutputItemLocalShellCallOutputStatus = "in_progress" -
const ResponseOutputItemLocalShellCallOutputStatusCompleted ResponseOutputItemLocalShellCallOutputStatus = "completed" -
const ResponseOutputItemLocalShellCallOutputStatusIncomplete ResponseOutputItemLocalShellCallOutputStatus = "incomplete"
-
-
-
type ResponseFunctionShellToolCall struct{…}A tool call that executes one or more shell commands in a managed environment.
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Action ResponseFunctionShellToolCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []string -
MaxOutputLength int64Optional maximum number of characters to return from each command.
-
TimeoutMs int64Optional timeout in milliseconds for the commands.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Environment ResponseFunctionShellToolCallEnvironmentUnionRepresents the use of a local environment to perform shell actions.
-
type ResponseLocalEnvironment struct{…}Represents the use of a local environment to perform shell actions.
-
Type LocalThe environment type. Always
local.const LocalLocal Local = "local"
-
-
type ResponseContainerReference struct{…}Represents a container created with /v1/containers.
-
ContainerID string -
Type ContainerReferenceThe environment type. Always
container_reference.const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
Status ResponseFunctionShellToolCallStatusThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallStatusInProgress ResponseFunctionShellToolCallStatus = "in_progress" -
const ResponseFunctionShellToolCallStatusCompleted ResponseFunctionShellToolCallStatus = "completed" -
const ResponseFunctionShellToolCallStatusIncomplete ResponseFunctionShellToolCallStatus = "incomplete"
-
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseFunctionShellToolCallOutput struct{…}The output of a shell tool call that was emitted.
-
ID stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
MaxOutputLength int64The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
Output []ResponseFunctionShellToolCallOutputOutputAn array of shell call output contents
-
Outcome ResponseFunctionShellToolCallOutputOutputOutcomeUnionRepresents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
type ResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64Exit code from the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringThe standard error output that was captured.
-
Stdout stringThe standard output that was captured.
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
Status ResponseFunctionShellToolCallOutputStatusThe status of the shell call output. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallOutputStatusInProgress ResponseFunctionShellToolCallOutputStatus = "in_progress" -
const ResponseFunctionShellToolCallOutputStatusCompleted ResponseFunctionShellToolCallOutputStatus = "completed" -
const ResponseFunctionShellToolCallOutputStatusIncomplete ResponseFunctionShellToolCallOutputStatus = "incomplete"
-
-
Type ShellCallOutputThe type of the shell call output. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseApplyPatchToolCall struct{…}A tool call that applies file diffs by creating, deleting, or updating files.
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseApplyPatchToolCallOperationUnionOne of the create_file, delete_file, or update_file operations applied via apply_patch.
-
type ResponseApplyPatchToolCallOperationCreateFile struct{…}Instruction describing how to create a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to create.
-
Type CreateFileCreate a new file with the provided diff.
const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseApplyPatchToolCallOperationDeleteFile struct{…}Instruction describing how to delete a file via the apply_patch tool.
-
Path stringPath of the file to delete.
-
Type DeleteFileDelete the specified file.
const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseApplyPatchToolCallOperationUpdateFile struct{…}Instruction describing how to update a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to update.
-
Type UpdateFileUpdate an existing file with the provided diff.
const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status ResponseApplyPatchToolCallStatusThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseApplyPatchToolCallStatusInProgress ResponseApplyPatchToolCallStatus = "in_progress" -
const ResponseApplyPatchToolCallStatusCompleted ResponseApplyPatchToolCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseApplyPatchToolCallOutput struct{…}The output emitted by an apply patch tool call.
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status ResponseApplyPatchToolCallOutputStatusThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseApplyPatchToolCallOutputStatusCompleted ResponseApplyPatchToolCallOutputStatus = "completed" -
const ResponseApplyPatchToolCallOutputStatusFailed ResponseApplyPatchToolCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
CreatedBy stringThe ID of the entity that created this tool call output.
-
Output stringOptional textual output returned by the apply patch tool.
-
-
type ResponseOutputItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
ID stringThe unique ID of the tool call.
-
Arguments stringA JSON string of the arguments passed to the tool.
-
Name stringThe name of the tool that was run.
-
ServerLabel stringThe label of the MCP server running the tool.
-
Type McpCallThe type of the item. Always
mcp_call.const McpCallMcpCall McpCall = "mcp_call"
-
ApprovalRequestID stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
Error stringThe error from the tool call, if any.
-
Output stringThe output from the tool call.
-
Status stringThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
const ResponseOutputItemMcpCallStatusInProgress ResponseOutputItemMcpCallStatus = "in_progress" -
const ResponseOutputItemMcpCallStatusCompleted ResponseOutputItemMcpCallStatus = "completed" -
const ResponseOutputItemMcpCallStatusIncomplete ResponseOutputItemMcpCallStatus = "incomplete" -
const ResponseOutputItemMcpCallStatusCalling ResponseOutputItemMcpCallStatus = "calling" -
const ResponseOutputItemMcpCallStatusFailed ResponseOutputItemMcpCallStatus = "failed"
-
-
-
type ResponseOutputItemMcpListTools struct{…}A list of tools available on an MCP server.
-
ID stringThe unique ID of the list.
-
ServerLabel stringThe label of the MCP server.
-
Tools []ResponseOutputItemMcpListToolsToolThe tools available on the server.
-
InputSchema anyThe JSON schema describing the tool's input.
-
Name stringThe name of the tool.
-
Annotations anyAdditional annotations about the tool.
-
Description stringThe description of the tool.
-
-
Type McpListToolsThe type of the item. Always
mcp_list_tools.const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
-
Error stringError message if the server could not list tools.
-
-
type ResponseOutputItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
ID stringThe unique ID of the approval request.
-
Arguments stringA JSON string of arguments for the tool.
-
Name stringThe name of the tool to run.
-
ServerLabel stringThe label of the MCP server making the request.
-
Type McpApprovalRequestThe type of the item. Always
mcp_approval_request.const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"
-
-
type ResponseOutputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
ID stringThe unique ID of the approval response
-
ApprovalRequestID stringThe ID of the approval request being answered.
-
Approve boolWhether the request was approved.
-
Type McpApprovalResponseThe type of the item. Always
mcp_approval_response.const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
-
Reason stringOptional reason for the decision.
-
-
type ResponseCustomToolCall struct{…}A call to a custom tool created by the model.
-
type ResponseCustomToolCallOutputItem struct{…}The output of a custom tool call from your code, being sent back to the model.
-
ID stringThe unique ID of the custom tool call output item.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseCustomToolCallOutputItemStatusInProgress ResponseCustomToolCallOutputItemStatus = "in_progress" -
const ResponseCustomToolCallOutputItemStatusCompleted ResponseCustomToolCallOutputItemStatus = "completed" -
const ResponseCustomToolCallOutputItemStatusIncomplete ResponseCustomToolCallOutputItemStatus = "incomplete"
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
-
ParallelToolCalls boolWhether to allow the model to run tool calls in parallel.
-
Temperature float64What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or
top_pbut not both. -
ToolChoice ResponseToolChoiceUnionHow the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call.-
type ToolChoiceOptions stringControls which (if any) tool is called by the model.
nonemeans the model will not call any tool and instead generates a message.automeans the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools.-
const ToolChoiceOptionsNone ToolChoiceOptions = "none" -
const ToolChoiceOptionsAuto ToolChoiceOptions = "auto" -
const ToolChoiceOptionsRequired ToolChoiceOptions = "required"
-
-
type ToolChoiceAllowed struct{…}Constrains the tools available to the model to a pre-defined set.
-
Mode ToolChoiceAllowedModeConstrains the tools available to the model to a pre-defined set.
autoallows the model to pick from among the allowed tools and generate a message.requiredrequires the model to call one or more of the allowed tools.-
const ToolChoiceAllowedModeAuto ToolChoiceAllowedMode = "auto" -
const ToolChoiceAllowedModeRequired ToolChoiceAllowedMode = "required"
-
-
Tools []map[string, any]A list of tool definitions that the model should be allowed to call.
For the Responses API, the list of tool definitions might look like:
[ { "type": "function", "name": "get_weather" }, { "type": "mcp", "server_label": "deepwiki" }, { "type": "image_generation" } ] -
Type AllowedToolsAllowed tool configuration type. Always
allowed_tools.const AllowedToolsAllowedTools AllowedTools = "allowed_tools"
-
-
type ToolChoiceTypes struct{…}Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
-
Type ToolChoiceTypesTypeThe type of hosted tool the model should to use. Learn more about built-in tools.
Allowed values are:
-
file_search -
web_search_preview -
computer -
computer_use_preview -
computer_use -
code_interpreter -
image_generation -
const ToolChoiceTypesTypeFileSearch ToolChoiceTypesType = "file_search" -
const ToolChoiceTypesTypeWebSearchPreview ToolChoiceTypesType = "web_search_preview" -
const ToolChoiceTypesTypeComputer ToolChoiceTypesType = "computer" -
const ToolChoiceTypesTypeComputerUsePreview ToolChoiceTypesType = "computer_use_preview" -
const ToolChoiceTypesTypeComputerUse ToolChoiceTypesType = "computer_use" -
const ToolChoiceTypesTypeWebSearchPreview2025_03_11 ToolChoiceTypesType = "web_search_preview_2025_03_11" -
const ToolChoiceTypesTypeImageGeneration ToolChoiceTypesType = "image_generation" -
const ToolChoiceTypesTypeCodeInterpreter ToolChoiceTypesType = "code_interpreter"
-
-
-
type ToolChoiceFunction struct{…}Use this option to force the model to call a specific function.
-
Name stringThe name of the function to call.
-
Type FunctionFor function calling, the type is always
function.const FunctionFunction Function = "function"
-
-
type ToolChoiceMcp struct{…}Use this option to force the model to call a specific tool on a remote MCP server.
-
ServerLabel stringThe label of the MCP server to use.
-
Type McpFor MCP tools, the type is always
mcp.const McpMcp Mcp = "mcp"
-
Name stringThe name of the tool to call on the server.
-
-
type ToolChoiceCustom struct{…}Use this option to force the model to call a specific custom tool.
-
Name stringThe name of the custom tool to call.
-
Type CustomFor custom tool calling, the type is always
custom.const CustomCustom Custom = "custom"
-
-
type ToolChoiceApplyPatch struct{…}Forces the model to call the apply_patch tool when executing a tool call.
-
Type ApplyPatchThe tool to call. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
type ToolChoiceShell struct{…}Forces the model to call the shell tool when a tool call is required.
-
Type ShellThe tool to call. Always
shell.const ShellShell Shell = "shell"
-
-
-
Tools []ToolUnionAn array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.We support the following categories of tools:
-
Built-in tools: Tools that are provided by OpenAI that extend the model's capabilities, like web search or file search. Learn more about built-in tools.
-
MCP Tools: Integrations with third-party systems via custom MCP servers or predefined connectors such as Google Drive and SharePoint. Learn more about MCP Tools.
-
Function calls (custom tools): Functions that are defined by you, enabling the model to call your own code with strongly typed arguments and outputs. Learn more about function calling. You can also use custom tools to call your own code.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
TopP float64An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
We generally recommend altering this or
temperaturebut not both. -
Background boolWhether to run the model response in the background. Learn more.
-
CompletedAt float64Unix timestamp (in seconds) of when this Response was completed. Only present when the status is
completed. -
Conversation ResponseConversationThe conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
-
ID stringThe unique ID of the conversation that this response was associated with.
-
-
MaxOutputTokens int64An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
MaxToolCalls int64The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored.
-
Moderation ResponseModerationModeration results for the response input and output, if moderated completions were requested.
-
Input ResponseModerationInputUnionModeration for the response input.
-
type ResponseModerationInputModerationResult struct{…}A moderation result produced for the response input or output.
-
Categories map[string, bool]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
CategoryAppliedInputTypes map[string, []string]Which modalities of input are reflected by the score for each category.
-
const ResponseModerationInputModerationResultCategoryAppliedInputTypeText ResponseModerationInputModerationResultCategoryAppliedInputType = "text" -
const ResponseModerationInputModerationResultCategoryAppliedInputTypeImage ResponseModerationInputModerationResultCategoryAppliedInputType = "image"
-
-
CategoryScores map[string, float64]A dictionary of moderation categories to scores.
-
Flagged boolA boolean indicating whether the content was flagged by any category.
-
Model stringThe moderation model that produced this result.
-
Type ModerationResultThe object type, which was always
moderation_resultfor successful moderation results.const ModerationResultModerationResult ModerationResult = "moderation_result"
-
-
type ResponseModerationInputError struct{…}An error produced while attempting moderation for the response input or output.
-
Code stringThe error code.
-
Message stringThe error message.
-
Type ErrorThe object type, which was always
errorfor moderation failures.const ErrorError Error = "error"
-
-
-
Output ResponseModerationOutputUnionModeration for the response output.
-
type ResponseModerationOutputModerationResult struct{…}A moderation result produced for the response input or output.
-
Categories map[string, bool]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
CategoryAppliedInputTypes map[string, []string]Which modalities of input are reflected by the score for each category.
-
const ResponseModerationOutputModerationResultCategoryAppliedInputTypeText ResponseModerationOutputModerationResultCategoryAppliedInputType = "text" -
const ResponseModerationOutputModerationResultCategoryAppliedInputTypeImage ResponseModerationOutputModerationResultCategoryAppliedInputType = "image"
-
-
CategoryScores map[string, float64]A dictionary of moderation categories to scores.
-
Flagged boolA boolean indicating whether the content was flagged by any category.
-
Model stringThe moderation model that produced this result.
-
Type ModerationResultThe object type, which was always
moderation_resultfor successful moderation results.const ModerationResultModerationResult ModerationResult = "moderation_result"
-
-
type ResponseModerationOutputError struct{…}An error produced while attempting moderation for the response input or output.
-
Code stringThe error code.
-
Message stringThe error message.
-
Type ErrorThe object type, which was always
errorfor moderation failures.const ErrorError Error = "error"
-
-
-
-
PreviousResponseID stringThe unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about conversation state. Cannot be used in conjunction with
conversation. -
Prompt ResponsePromptReference to a prompt template and its variables. Learn more.
-
ID stringThe unique identifier of the prompt template to use.
-
Variables map[string, ResponsePromptVariableUnion]Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files.
-
string -
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
Version stringOptional version of the prompt template.
-
-
PromptCacheKey stringUsed by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more. -
PromptCacheRetention ResponsePromptCacheRetentionThe retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. Forgpt-5.5,gpt-5.5-pro, and future models, only24his supported.For older models that support both
in_memoryand24h, the default depends on your organization's data retention policy:-
Organizations without ZDR enabled default to
24h. -
Organizations with ZDR enabled default to
in_memorywhenprompt_cache_retentionis not specified. -
const ResponsePromptCacheRetentionInMemory ResponsePromptCacheRetention = "in_memory" -
const ResponsePromptCacheRetention24h ResponsePromptCacheRetention = "24h"
-
-
Reasoning Reasoninggpt-5 and o-series models only
Configuration options for reasoning models.
-
Context ReasoningContextControls which reasoning items are rendered back to the model on later turns. When returned on a response, this is the effective reasoning context mode used for the response.
-
const ReasoningContextAuto ReasoningContext = "auto" -
const ReasoningContextCurrentTurn ReasoningContext = "current_turn" -
const ReasoningContextAllTurns ReasoningContext = "all_turns"
-
-
Effort ReasoningEffortConstrains effort on reasoning for reasoning models. Currently supported values are
none,minimal,low,medium,high, andxhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.-
gpt-5.1defaults tonone, which does not perform reasoning. The supported reasoning values forgpt-5.1arenone,low,medium, andhigh. Tool calls are supported for all reasoning values in gpt-5.1. -
All models before
gpt-5.1default tomediumreasoning effort, and do not supportnone. -
The
gpt-5-promodel defaults to (and only supports)highreasoning effort. -
xhighis supported for all models aftergpt-5.1-codex-max. -
const ReasoningEffortNone ReasoningEffort = "none" -
const ReasoningEffortMinimal ReasoningEffort = "minimal" -
const ReasoningEffortLow ReasoningEffort = "low" -
const ReasoningEffortMedium ReasoningEffort = "medium" -
const ReasoningEffortHigh ReasoningEffort = "high" -
const ReasoningEffortXhigh ReasoningEffort = "xhigh"
-
-
GenerateSummary ReasoningGenerateSummaryDeprecated: use
summaryinstead.A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.-
const ReasoningGenerateSummaryAuto ReasoningGenerateSummary = "auto" -
const ReasoningGenerateSummaryConcise ReasoningGenerateSummary = "concise" -
const ReasoningGenerateSummaryDetailed ReasoningGenerateSummary = "detailed"
-
-
Summary ReasoningSummaryA summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.conciseis supported forcomputer-use-previewmodels and all reasoning models aftergpt-5.-
const ReasoningSummaryAuto ReasoningSummary = "auto" -
const ReasoningSummaryConcise ReasoningSummary = "concise" -
const ReasoningSummaryDetailed ReasoningSummary = "detailed"
-
-
-
SafetyIdentifier stringA stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
ServiceTier ResponseServiceTierSpecifies the processing type used for serving the request.
- If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'.
- If set to 'default', then the request will be processed with the standard pricing and performance for the selected model.
- If set to 'flex' or 'priority', then the request will be processed with the corresponding service tier.
- When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.-
const ResponseServiceTierAuto ResponseServiceTier = "auto" -
const ResponseServiceTierDefault ResponseServiceTier = "default" -
const ResponseServiceTierFlex ResponseServiceTier = "flex" -
const ResponseServiceTierScale ResponseServiceTier = "scale" -
const ResponseServiceTierPriority ResponseServiceTier = "priority"
-
Status ResponseStatusThe status of the response generation. One of
completed,failed,in_progress,cancelled,queued, orincomplete.-
const ResponseStatusCompleted ResponseStatus = "completed" -
const ResponseStatusFailed ResponseStatus = "failed" -
const ResponseStatusInProgress ResponseStatus = "in_progress" -
const ResponseStatusCancelled ResponseStatus = "cancelled" -
const ResponseStatusQueued ResponseStatus = "queued" -
const ResponseStatusIncomplete ResponseStatus = "incomplete"
-
-
Text ResponseTextConfigConfiguration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
Format ResponseFormatTextConfigUnionAn object specifying the format that the model must output.
Configuring
{ "type": "json_schema" }enables Structured Outputs, which ensures the model will match your supplied JSON schema. Learn more in the Structured Outputs guide.The default format is
{ "type": "text" }with no additional options.Not recommended for gpt-4o and newer models:
Setting to
{ "type": "json_object" }enables the older JSON mode, which ensures the message the model generates is valid JSON. Usingjson_schemais preferred for models that support it.-
type ResponseFormatText struct{…}Default response format. Used to generate text responses.
-
Type TextThe type of response format being defined. Always
text.const TextText Text = "text"
-
-
type ResponseFormatTextJSONSchemaConfig struct{…}JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
Name stringThe name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
-
Schema map[string, any]The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
-
Type JSONSchemaThe type of response format being defined. Always
json_schema.const JSONSchemaJSONSchema JSONSchema = "json_schema"
-
Description stringA description of what the response format is for, used by the model to determine how to respond in the format.
-
Strict boolWhether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the
schemafield. Only a subset of JSON Schema is supported whenstrictistrue. To learn more, read the Structured Outputs guide.
-
-
type ResponseFormatJSONObject struct{…}JSON object response format. An older method of generating JSON responses. Using
json_schemais 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 JSONObjectThe type of response format being defined. Always
json_object.const JSONObjectJSONObject JSONObject = "json_object"
-
-
-
Verbosity ResponseTextConfigVerbosityConstrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses. Currently supported values are
low,medium, andhigh.-
const ResponseTextConfigVerbosityLow ResponseTextConfigVerbosity = "low" -
const ResponseTextConfigVerbosityMedium ResponseTextConfigVerbosity = "medium" -
const ResponseTextConfigVerbosityHigh ResponseTextConfigVerbosity = "high"
-
-
TopLogprobs int64An integer between 0 and 20 specifying the maximum number of most likely tokens to return at each token position, each with an associated log probability. In some cases, the number of returned tokens may be fewer than requested.
-
Truncation ResponseTruncationThe truncation strategy to use for the model response.
-
auto: If the input to this Response exceeds the model's context window size, the model will truncate the response to fit the context window by dropping items from the beginning of the conversation. -
disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error. -
const ResponseTruncationAuto ResponseTruncation = "auto" -
const ResponseTruncationDisabled ResponseTruncation = "disabled"
-
-
Usage ResponseUsageRepresents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
-
InputTokens int64The number of input tokens.
-
InputTokensDetails ResponseUsageInputTokensDetailsA detailed breakdown of the input tokens.
-
CachedTokens int64The number of tokens that were retrieved from the cache. More on prompt caching.
-
-
OutputTokens int64The number of output tokens.
-
OutputTokensDetails ResponseUsageOutputTokensDetailsA detailed breakdown of the output tokens.
-
ReasoningTokens int64The number of reasoning tokens.
-
-
TotalTokens int64The total number of tokens used.
-
-
User stringThis field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead to maintain caching optimizations. A stable identifier for your end-users. Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. Learn more.
-
-
SequenceNumber int64The sequence number for this event.
-
Type ResponseCompletedThe type of the event. Always
response.completed.const ResponseCompletedResponseCompleted ResponseCompleted = "response.completed"
-
Response Computer Tool Call
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
ID stringThe unique ID of the computer call.
-
CallID stringAn identifier used when responding to the tool call with output.
-
PendingSafetyChecks []ResponseComputerToolCallPendingSafetyCheckThe pending safety checks for the computer call.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status ResponseComputerToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseComputerToolCallStatusInProgress ResponseComputerToolCallStatus = "in_progress" -
const ResponseComputerToolCallStatusCompleted ResponseComputerToolCallStatus = "completed" -
const ResponseComputerToolCallStatusIncomplete ResponseComputerToolCallStatus = "incomplete"
-
-
Type ResponseComputerToolCallTypeThe type of the computer call. Always
computer_call.const ResponseComputerToolCallTypeComputerCall ResponseComputerToolCallType = "computer_call"
-
Action ResponseComputerToolCallActionUnionA click action.
-
type ResponseComputerToolCallActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ResponseComputerToolCallActionClickButtonLeft ResponseComputerToolCallActionClickButton = "left" -
const ResponseComputerToolCallActionClickButtonRight ResponseComputerToolCallActionClickButton = "right" -
const ResponseComputerToolCallActionClickButtonWheel ResponseComputerToolCallActionClickButton = "wheel" -
const ResponseComputerToolCallActionClickButtonBack ResponseComputerToolCallActionClickButton = "back" -
const ResponseComputerToolCallActionClickButtonForward ResponseComputerToolCallActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ResponseComputerToolCallActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ResponseComputerToolCallActionDrag struct{…}A drag action.
-
Path []ResponseComputerToolCallActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ResponseComputerToolCallActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ResponseComputerToolCallActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ResponseComputerToolCallActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ResponseComputerToolCallActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ResponseComputerToolCallActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ResponseComputerToolCallActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
Actions ComputerActionListFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
type ComputerActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ComputerActionClickButtonLeft ComputerActionClickButton = "left" -
const ComputerActionClickButtonRight ComputerActionClickButton = "right" -
const ComputerActionClickButtonWheel ComputerActionClickButton = "wheel" -
const ComputerActionClickButtonBack ComputerActionClickButton = "back" -
const ComputerActionClickButtonForward ComputerActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ComputerActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ComputerActionDrag struct{…}A drag action.
-
Path []ComputerActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ComputerActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ComputerActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ComputerActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ComputerActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ComputerActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ComputerActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
Response Computer Tool Call Output Item
-
type ResponseComputerToolCallOutputItem struct{…}-
ID stringThe unique ID of the computer call tool output.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Type ComputerScreenshotSpecifies the event type. For a computer screenshot, this property is always set to
computer_screenshot.const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"
-
FileID stringThe identifier of an uploaded file that contains the screenshot.
-
ImageURL stringThe URL of the screenshot image.
-
-
Status ResponseComputerToolCallOutputItemStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseComputerToolCallOutputItemStatusCompleted ResponseComputerToolCallOutputItemStatus = "completed" -
const ResponseComputerToolCallOutputItemStatusIncomplete ResponseComputerToolCallOutputItemStatus = "incomplete" -
const ResponseComputerToolCallOutputItemStatusFailed ResponseComputerToolCallOutputItemStatus = "failed" -
const ResponseComputerToolCallOutputItemStatusInProgress ResponseComputerToolCallOutputItemStatus = "in_progress"
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
AcknowledgedSafetyChecks []ResponseComputerToolCallOutputItemAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
Response Computer Tool Call Output Screenshot
-
type ResponseComputerToolCallOutputScreenshot struct{…}A computer screenshot image used with the computer use tool.
-
Type ComputerScreenshotSpecifies the event type. For a computer screenshot, this property is always set to
computer_screenshot.const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"
-
FileID stringThe identifier of an uploaded file that contains the screenshot.
-
ImageURL stringThe URL of the screenshot image.
-
Response Container Reference
-
type ResponseContainerReference struct{…}Represents a container created with /v1/containers.
-
ContainerID string -
Type ContainerReferenceThe environment type. Always
container_reference.const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
Response Content
-
type ResponseContentUnion interface{…}Multi-modal input and output contents.
-
type ResponseInputText struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
Detail ResponseInputImageDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageDetailLow ResponseInputImageDetail = "low" -
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high" -
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto" -
const ResponseInputImageDetailOriginal ResponseInputImageDetail = "original"
-
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFile struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileDetailLow ResponseInputFileDetail = "low" -
const ResponseInputFileDetailHigh ResponseInputFileDetail = "high"
-
-
FileData stringThe content of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
type ResponseOutputText struct{…}A text output from the model.
-
Annotations []ResponseOutputTextAnnotationUnionThe annotations of the text output.
-
type ResponseOutputTextAnnotationFileCitation struct{…}A citation to a file.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the file cited.
-
Index int64The index of the file in the list of files.
-
Type FileCitationThe type of the file citation. Always
file_citation.const FileCitationFileCitation FileCitation = "file_citation"
-
-
type ResponseOutputTextAnnotationURLCitation struct{…}A citation for a web resource used to generate a model response.
-
EndIndex int64The index of the last character of the URL citation in the message.
-
StartIndex int64The index of the first character of the URL citation in the message.
-
Title stringThe title of the web resource.
-
Type URLCitationThe type of the URL citation. Always
url_citation.const URLCitationURLCitation URLCitation = "url_citation"
-
URL stringThe URL of the web resource.
-
-
type ResponseOutputTextAnnotationContainerFileCitation struct{…}A citation for a container file used to generate a model response.
-
ContainerID stringThe ID of the container file.
-
EndIndex int64The index of the last character of the container file citation in the message.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the container file cited.
-
StartIndex int64The index of the first character of the container file citation in the message.
-
Type ContainerFileCitationThe type of the container file citation. Always
container_file_citation.const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"
-
-
type ResponseOutputTextAnnotationFilePath struct{…}A path to a file.
-
FileID stringThe ID of the file.
-
Index int64The index of the file in the list of files.
-
Type FilePathThe type of the file path. Always
file_path.const FilePathFilePath FilePath = "file_path"
-
-
-
Text stringThe text output from the model.
-
Type OutputTextThe type of the output text. Always
output_text.const OutputTextOutputText OutputText = "output_text"
-
Logprobs []ResponseOutputTextLogprob-
Token string -
Bytes []int64 -
Logprob float64 -
TopLogprobs []ResponseOutputTextLogprobTopLogprob-
Token string -
Bytes []int64 -
Logprob float64
-
-
-
-
type ResponseOutputRefusal struct{…}A refusal from the model.
-
Refusal stringThe refusal explanation from the model.
-
Type RefusalThe type of the refusal. Always
refusal.const RefusalRefusal Refusal = "refusal"
-
-
ResponseContentReasoningTextContent-
Text stringThe reasoning text from the model.
-
Type ReasoningTextThe type of the reasoning text. Always
reasoning_text.const ReasoningTextReasoningText ReasoningText = "reasoning_text"
-
-
Response Content Part Added Event
-
type ResponseContentPartAddedEvent struct{…}Emitted when a new content part is added.
-
ContentIndex int64The index of the content part that was added.
-
ItemID stringThe ID of the output item that the content part was added to.
-
OutputIndex int64The index of the output item that the content part was added to.
-
Part ResponseContentPartAddedEventPartUnionThe content part that was added.
-
type ResponseOutputText struct{…}A text output from the model.
-
Annotations []ResponseOutputTextAnnotationUnionThe annotations of the text output.
-
type ResponseOutputTextAnnotationFileCitation struct{…}A citation to a file.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the file cited.
-
Index int64The index of the file in the list of files.
-
Type FileCitationThe type of the file citation. Always
file_citation.const FileCitationFileCitation FileCitation = "file_citation"
-
-
type ResponseOutputTextAnnotationURLCitation struct{…}A citation for a web resource used to generate a model response.
-
EndIndex int64The index of the last character of the URL citation in the message.
-
StartIndex int64The index of the first character of the URL citation in the message.
-
Title stringThe title of the web resource.
-
Type URLCitationThe type of the URL citation. Always
url_citation.const URLCitationURLCitation URLCitation = "url_citation"
-
URL stringThe URL of the web resource.
-
-
type ResponseOutputTextAnnotationContainerFileCitation struct{…}A citation for a container file used to generate a model response.
-
ContainerID stringThe ID of the container file.
-
EndIndex int64The index of the last character of the container file citation in the message.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the container file cited.
-
StartIndex int64The index of the first character of the container file citation in the message.
-
Type ContainerFileCitationThe type of the container file citation. Always
container_file_citation.const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"
-
-
type ResponseOutputTextAnnotationFilePath struct{…}A path to a file.
-
FileID stringThe ID of the file.
-
Index int64The index of the file in the list of files.
-
Type FilePathThe type of the file path. Always
file_path.const FilePathFilePath FilePath = "file_path"
-
-
-
Text stringThe text output from the model.
-
Type OutputTextThe type of the output text. Always
output_text.const OutputTextOutputText OutputText = "output_text"
-
Logprobs []ResponseOutputTextLogprob-
Token string -
Bytes []int64 -
Logprob float64 -
TopLogprobs []ResponseOutputTextLogprobTopLogprob-
Token string -
Bytes []int64 -
Logprob float64
-
-
-
-
type ResponseOutputRefusal struct{…}A refusal from the model.
-
Refusal stringThe refusal explanation from the model.
-
Type RefusalThe type of the refusal. Always
refusal.const RefusalRefusal Refusal = "refusal"
-
-
type ResponseContentPartAddedEventPartReasoningText struct{…}Reasoning text from the model.
-
Text stringThe reasoning text from the model.
-
Type ReasoningTextThe type of the reasoning text. Always
reasoning_text.const ReasoningTextReasoningText ReasoningText = "reasoning_text"
-
-
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseContentPartAddedThe type of the event. Always
response.content_part.added.const ResponseContentPartAddedResponseContentPartAdded ResponseContentPartAdded = "response.content_part.added"
-
Response Content Part Done Event
-
type ResponseContentPartDoneEvent struct{…}Emitted when a content part is done.
-
ContentIndex int64The index of the content part that is done.
-
ItemID stringThe ID of the output item that the content part was added to.
-
OutputIndex int64The index of the output item that the content part was added to.
-
Part ResponseContentPartDoneEventPartUnionThe content part that is done.
-
type ResponseOutputText struct{…}A text output from the model.
-
Annotations []ResponseOutputTextAnnotationUnionThe annotations of the text output.
-
type ResponseOutputTextAnnotationFileCitation struct{…}A citation to a file.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the file cited.
-
Index int64The index of the file in the list of files.
-
Type FileCitationThe type of the file citation. Always
file_citation.const FileCitationFileCitation FileCitation = "file_citation"
-
-
type ResponseOutputTextAnnotationURLCitation struct{…}A citation for a web resource used to generate a model response.
-
EndIndex int64The index of the last character of the URL citation in the message.
-
StartIndex int64The index of the first character of the URL citation in the message.
-
Title stringThe title of the web resource.
-
Type URLCitationThe type of the URL citation. Always
url_citation.const URLCitationURLCitation URLCitation = "url_citation"
-
URL stringThe URL of the web resource.
-
-
type ResponseOutputTextAnnotationContainerFileCitation struct{…}A citation for a container file used to generate a model response.
-
ContainerID stringThe ID of the container file.
-
EndIndex int64The index of the last character of the container file citation in the message.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the container file cited.
-
StartIndex int64The index of the first character of the container file citation in the message.
-
Type ContainerFileCitationThe type of the container file citation. Always
container_file_citation.const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"
-
-
type ResponseOutputTextAnnotationFilePath struct{…}A path to a file.
-
FileID stringThe ID of the file.
-
Index int64The index of the file in the list of files.
-
Type FilePathThe type of the file path. Always
file_path.const FilePathFilePath FilePath = "file_path"
-
-
-
Text stringThe text output from the model.
-
Type OutputTextThe type of the output text. Always
output_text.const OutputTextOutputText OutputText = "output_text"
-
Logprobs []ResponseOutputTextLogprob-
Token string -
Bytes []int64 -
Logprob float64 -
TopLogprobs []ResponseOutputTextLogprobTopLogprob-
Token string -
Bytes []int64 -
Logprob float64
-
-
-
-
type ResponseOutputRefusal struct{…}A refusal from the model.
-
Refusal stringThe refusal explanation from the model.
-
Type RefusalThe type of the refusal. Always
refusal.const RefusalRefusal Refusal = "refusal"
-
-
type ResponseContentPartDoneEventPartReasoningText struct{…}Reasoning text from the model.
-
Text stringThe reasoning text from the model.
-
Type ReasoningTextThe type of the reasoning text. Always
reasoning_text.const ReasoningTextReasoningText ReasoningText = "reasoning_text"
-
-
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseContentPartDoneThe type of the event. Always
response.content_part.done.const ResponseContentPartDoneResponseContentPartDone ResponseContentPartDone = "response.content_part.done"
-
Response Conversation Param
-
type ResponseConversationParamResp struct{…}The conversation that this response belongs to.
-
ID stringThe unique ID of the conversation.
-
Response Created Event
-
type ResponseCreatedEvent struct{…}An event that is emitted when a response is created.
-
Response ResponseThe response that was created.
-
ID stringUnique identifier for this Response.
-
CreatedAt float64Unix timestamp (in seconds) of when this Response was created.
-
Error ResponseErrorAn error object returned when the model fails to generate a Response.
-
Code ResponseErrorCodeThe error code for the response.
-
const ResponseErrorCodeServerError ResponseErrorCode = "server_error" -
const ResponseErrorCodeRateLimitExceeded ResponseErrorCode = "rate_limit_exceeded" -
const ResponseErrorCodeInvalidPrompt ResponseErrorCode = "invalid_prompt" -
const ResponseErrorCodeVectorStoreTimeout ResponseErrorCode = "vector_store_timeout" -
const ResponseErrorCodeInvalidImage ResponseErrorCode = "invalid_image" -
const ResponseErrorCodeInvalidImageFormat ResponseErrorCode = "invalid_image_format" -
const ResponseErrorCodeInvalidBase64Image ResponseErrorCode = "invalid_base64_image" -
const ResponseErrorCodeInvalidImageURL ResponseErrorCode = "invalid_image_url" -
const ResponseErrorCodeImageTooLarge ResponseErrorCode = "image_too_large" -
const ResponseErrorCodeImageTooSmall ResponseErrorCode = "image_too_small" -
const ResponseErrorCodeImageParseError ResponseErrorCode = "image_parse_error" -
const ResponseErrorCodeImageContentPolicyViolation ResponseErrorCode = "image_content_policy_violation" -
const ResponseErrorCodeInvalidImageMode ResponseErrorCode = "invalid_image_mode" -
const ResponseErrorCodeImageFileTooLarge ResponseErrorCode = "image_file_too_large" -
const ResponseErrorCodeUnsupportedImageMediaType ResponseErrorCode = "unsupported_image_media_type" -
const ResponseErrorCodeEmptyImageFile ResponseErrorCode = "empty_image_file" -
const ResponseErrorCodeFailedToDownloadImage ResponseErrorCode = "failed_to_download_image" -
const ResponseErrorCodeImageFileNotFound ResponseErrorCode = "image_file_not_found"
-
-
Message stringA human-readable description of the error.
-
-
IncompleteDetails ResponseIncompleteDetailsDetails about why the response is incomplete.
-
Reason stringThe reason why the response is incomplete.
-
const ResponseIncompleteDetailsReasonMaxOutputTokens ResponseIncompleteDetailsReason = "max_output_tokens" -
const ResponseIncompleteDetailsReasonContentFilter ResponseIncompleteDetailsReason = "content_filter"
-
-
-
Instructions ResponseInstructionsUnionA system (or developer) message inserted into the model's context.
When using along with
previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses.-
string -
type ResponseInstructionsInputItemList []ResponseInputItemUnionA list of one or many input items to the model, containing different content types.
-
type EasyInputMessage struct{…}A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.-
Content EasyInputMessageContentUnionText, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
-
string -
type ResponseInputMessageContentList []ResponseInputContentUnionA list of one or many input items to the model, containing different content types.
-
type ResponseInputText struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
Detail ResponseInputImageDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageDetailLow ResponseInputImageDetail = "low" -
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high" -
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto" -
const ResponseInputImageDetailOriginal ResponseInputImageDetail = "original"
-
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFile struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileDetailLow ResponseInputFileDetail = "low" -
const ResponseInputFileDetailHigh ResponseInputFileDetail = "high"
-
-
FileData stringThe content of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Role EasyInputMessageRoleThe role of the message input. One of
user,assistant,system, ordeveloper.-
const EasyInputMessageRoleUser EasyInputMessageRole = "user" -
const EasyInputMessageRoleAssistant EasyInputMessageRole = "assistant" -
const EasyInputMessageRoleSystem EasyInputMessageRole = "system" -
const EasyInputMessageRoleDeveloper EasyInputMessageRole = "developer"
-
-
Phase EasyInputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const EasyInputMessagePhaseCommentary EasyInputMessagePhase = "commentary" -
const EasyInputMessagePhaseFinalAnswer EasyInputMessagePhase = "final_answer"
-
-
Type EasyInputMessageTypeThe type of the message input. Always
message.const EasyInputMessageTypeMessage EasyInputMessageType = "message"
-
-
type ResponseInputItemMessage struct{…}A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole.-
Content ResponseInputMessageContentListA list of one or many input items to the model, containing different content types.
-
Role stringThe role of the message input. One of
user,system, ordeveloper.-
const ResponseInputItemMessageRoleUser ResponseInputItemMessageRole = "user" -
const ResponseInputItemMessageRoleSystem ResponseInputItemMessageRole = "system" -
const ResponseInputItemMessageRoleDeveloper ResponseInputItemMessageRole = "developer"
-
-
Status stringThe status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputItemMessageStatusInProgress ResponseInputItemMessageStatus = "in_progress" -
const ResponseInputItemMessageStatusCompleted ResponseInputItemMessageStatus = "completed" -
const ResponseInputItemMessageStatusIncomplete ResponseInputItemMessageStatus = "incomplete"
-
-
Type stringThe type of the message input. Always set to
message.const ResponseInputItemMessageTypeMessage ResponseInputItemMessageType = "message"
-
-
type ResponseOutputMessage struct{…}An output message from the model.
-
ID stringThe unique ID of the output message.
-
Content []ResponseOutputMessageContentUnionThe content of the output message.
-
type ResponseOutputText struct{…}A text output from the model.
-
Annotations []ResponseOutputTextAnnotationUnionThe annotations of the text output.
-
type ResponseOutputTextAnnotationFileCitation struct{…}A citation to a file.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the file cited.
-
Index int64The index of the file in the list of files.
-
Type FileCitationThe type of the file citation. Always
file_citation.const FileCitationFileCitation FileCitation = "file_citation"
-
-
type ResponseOutputTextAnnotationURLCitation struct{…}A citation for a web resource used to generate a model response.
-
EndIndex int64The index of the last character of the URL citation in the message.
-
StartIndex int64The index of the first character of the URL citation in the message.
-
Title stringThe title of the web resource.
-
Type URLCitationThe type of the URL citation. Always
url_citation.const URLCitationURLCitation URLCitation = "url_citation"
-
URL stringThe URL of the web resource.
-
-
type ResponseOutputTextAnnotationContainerFileCitation struct{…}A citation for a container file used to generate a model response.
-
ContainerID stringThe ID of the container file.
-
EndIndex int64The index of the last character of the container file citation in the message.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the container file cited.
-
StartIndex int64The index of the first character of the container file citation in the message.
-
Type ContainerFileCitationThe type of the container file citation. Always
container_file_citation.const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"
-
-
type ResponseOutputTextAnnotationFilePath struct{…}A path to a file.
-
FileID stringThe ID of the file.
-
Index int64The index of the file in the list of files.
-
Type FilePathThe type of the file path. Always
file_path.const FilePathFilePath FilePath = "file_path"
-
-
-
Text stringThe text output from the model.
-
Type OutputTextThe type of the output text. Always
output_text.const OutputTextOutputText OutputText = "output_text"
-
Logprobs []ResponseOutputTextLogprob-
Token string -
Bytes []int64 -
Logprob float64 -
TopLogprobs []ResponseOutputTextLogprobTopLogprob-
Token string -
Bytes []int64 -
Logprob float64
-
-
-
-
type ResponseOutputRefusal struct{…}A refusal from the model.
-
Refusal stringThe refusal explanation from the model.
-
Type RefusalThe type of the refusal. Always
refusal.const RefusalRefusal Refusal = "refusal"
-
-
-
Role AssistantThe role of the output message. Always
assistant.const AssistantAssistant Assistant = "assistant"
-
Status ResponseOutputMessageStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseOutputMessageStatusInProgress ResponseOutputMessageStatus = "in_progress" -
const ResponseOutputMessageStatusCompleted ResponseOutputMessageStatus = "completed" -
const ResponseOutputMessageStatusIncomplete ResponseOutputMessageStatus = "incomplete"
-
-
Type MessageThe type of the output message. Always
message.const MessageMessage Message = "message"
-
Phase ResponseOutputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const ResponseOutputMessagePhaseCommentary ResponseOutputMessagePhase = "commentary" -
const ResponseOutputMessagePhaseFinalAnswer ResponseOutputMessagePhase = "final_answer"
-
-
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
ID stringThe unique ID of the file search tool call.
-
Queries []stringThe queries used to search for files.
-
Status ResponseFileSearchToolCallStatusThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
const ResponseFileSearchToolCallStatusInProgress ResponseFileSearchToolCallStatus = "in_progress" -
const ResponseFileSearchToolCallStatusSearching ResponseFileSearchToolCallStatus = "searching" -
const ResponseFileSearchToolCallStatusCompleted ResponseFileSearchToolCallStatus = "completed" -
const ResponseFileSearchToolCallStatusIncomplete ResponseFileSearchToolCallStatus = "incomplete" -
const ResponseFileSearchToolCallStatusFailed ResponseFileSearchToolCallStatus = "failed"
-
-
Type FileSearchCallThe type of the file search tool call. Always
file_search_call.const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"
-
Results []ResponseFileSearchToolCallResultThe results of the file search tool call.
-
Attributes map[string, ResponseFileSearchToolCallResultAttributeUnion]Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.
-
string -
float64 -
bool
-
-
FileID stringThe unique ID of the file.
-
Filename stringThe name of the file.
-
Score float64The relevance score of the file - a value between 0 and 1.
-
Text stringThe text that was retrieved from the file.
-
-
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
ID stringThe unique ID of the computer call.
-
CallID stringAn identifier used when responding to the tool call with output.
-
PendingSafetyChecks []ResponseComputerToolCallPendingSafetyCheckThe pending safety checks for the computer call.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status ResponseComputerToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseComputerToolCallStatusInProgress ResponseComputerToolCallStatus = "in_progress" -
const ResponseComputerToolCallStatusCompleted ResponseComputerToolCallStatus = "completed" -
const ResponseComputerToolCallStatusIncomplete ResponseComputerToolCallStatus = "incomplete"
-
-
Type ResponseComputerToolCallTypeThe type of the computer call. Always
computer_call.const ResponseComputerToolCallTypeComputerCall ResponseComputerToolCallType = "computer_call"
-
Action ResponseComputerToolCallActionUnionA click action.
-
type ResponseComputerToolCallActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ResponseComputerToolCallActionClickButtonLeft ResponseComputerToolCallActionClickButton = "left" -
const ResponseComputerToolCallActionClickButtonRight ResponseComputerToolCallActionClickButton = "right" -
const ResponseComputerToolCallActionClickButtonWheel ResponseComputerToolCallActionClickButton = "wheel" -
const ResponseComputerToolCallActionClickButtonBack ResponseComputerToolCallActionClickButton = "back" -
const ResponseComputerToolCallActionClickButtonForward ResponseComputerToolCallActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ResponseComputerToolCallActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ResponseComputerToolCallActionDrag struct{…}A drag action.
-
Path []ResponseComputerToolCallActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ResponseComputerToolCallActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ResponseComputerToolCallActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ResponseComputerToolCallActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ResponseComputerToolCallActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ResponseComputerToolCallActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ResponseComputerToolCallActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
Actions ComputerActionListFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
type ComputerActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ComputerActionClickButtonLeft ComputerActionClickButton = "left" -
const ComputerActionClickButtonRight ComputerActionClickButton = "right" -
const ComputerActionClickButtonWheel ComputerActionClickButton = "wheel" -
const ComputerActionClickButtonBack ComputerActionClickButton = "back" -
const ComputerActionClickButtonForward ComputerActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ComputerActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ComputerActionDrag struct{…}A drag action.
-
Path []ComputerActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ComputerActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ComputerActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ComputerActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ComputerActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ComputerActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ComputerActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
-
type ResponseInputItemComputerCallOutput struct{…}The output of a computer tool call.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Type ComputerScreenshotSpecifies the event type. For a computer screenshot, this property is always set to
computer_screenshot.const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"
-
FileID stringThe identifier of an uploaded file that contains the screenshot.
-
ImageURL stringThe URL of the screenshot image.
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
ID stringThe ID of the computer tool call output.
-
AcknowledgedSafetyChecks []ResponseInputItemComputerCallOutputAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status stringThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseInputItemComputerCallOutputStatusInProgress ResponseInputItemComputerCallOutputStatus = "in_progress" -
const ResponseInputItemComputerCallOutputStatusCompleted ResponseInputItemComputerCallOutputStatus = "completed" -
const ResponseInputItemComputerCallOutputStatusIncomplete ResponseInputItemComputerCallOutputStatus = "incomplete"
-
-
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
ID stringThe unique ID of the web search tool call.
-
Action ResponseFunctionWebSearchActionUnionAn object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
type ResponseFunctionWebSearchActionSearch struct{…}Action type "search" - Performs a web search query.
-
Type SearchThe action type.
const SearchSearch Search = "search"
-
Queries []stringThe search queries.
-
Query stringThe search query.
-
Sources []ResponseFunctionWebSearchActionSearchSourceThe sources used in the search.
-
Type URLThe type of source. Always
url.const URLURL URL = "url"
-
URL stringThe URL of the source.
-
-
-
type ResponseFunctionWebSearchActionOpenPage struct{…}Action type "open_page" - Opens a specific URL from search results.
-
Type OpenPageThe action type.
const OpenPageOpenPage OpenPage = "open_page"
-
URL stringThe URL opened by the model.
-
-
type ResponseFunctionWebSearchActionFindInPage struct{…}Action type "find_in_page": Searches for a pattern within a loaded page.
-
Pattern stringThe pattern or text to search for within the page.
-
Type FindInPageThe action type.
const FindInPageFindInPage FindInPage = "find_in_page"
-
URL stringThe URL of the page searched for the pattern.
-
-
-
Status ResponseFunctionWebSearchStatusThe status of the web search tool call.
-
const ResponseFunctionWebSearchStatusInProgress ResponseFunctionWebSearchStatus = "in_progress" -
const ResponseFunctionWebSearchStatusSearching ResponseFunctionWebSearchStatus = "searching" -
const ResponseFunctionWebSearchStatusCompleted ResponseFunctionWebSearchStatus = "completed" -
const ResponseFunctionWebSearchStatusFailed ResponseFunctionWebSearchStatus = "failed"
-
-
Type WebSearchCallThe type of the web search tool call. Always
web_search_call.const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"
-
-
type ResponseFunctionToolCall struct{…}A tool call to run a function. See the function calling guide for more information.
-
Arguments stringA JSON string of the arguments to pass to the function.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Name stringThe name of the function to run.
-
Type FunctionCallThe type of the function tool call. Always
function_call.const FunctionCallFunctionCall FunctionCall = "function_call"
-
ID stringThe unique ID of the function tool call.
-
Namespace stringThe namespace of the function to run.
-
Status ResponseFunctionToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallStatusInProgress ResponseFunctionToolCallStatus = "in_progress" -
const ResponseFunctionToolCallStatusCompleted ResponseFunctionToolCallStatus = "completed" -
const ResponseFunctionToolCallStatusIncomplete ResponseFunctionToolCallStatus = "incomplete"
-
-
-
type ResponseInputItemFunctionCallOutput struct{…}The output of a function tool call.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseInputItemFunctionCallOutputOutputUnionText, image, or file output of the function tool call.
-
string -
type ResponseFunctionCallOutputItemList []ResponseFunctionCallOutputItemUnionAn array of content outputs (text, image, file) for the function tool call.
-
type ResponseInputTextContent struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImageContent struct{…}An image input to the model. Learn about image inputs
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
Detail ResponseInputImageContentDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageContentDetailLow ResponseInputImageContentDetail = "low" -
const ResponseInputImageContentDetailHigh ResponseInputImageContentDetail = "high" -
const ResponseInputImageContentDetailAuto ResponseInputImageContentDetail = "auto" -
const ResponseInputImageContentDetailOriginal ResponseInputImageContentDetail = "original"
-
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFileContent struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileContentDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileContentDetailLow ResponseInputFileContentDetail = "low" -
const ResponseInputFileContentDetailHigh ResponseInputFileContentDetail = "high"
-
-
FileData stringThe base64-encoded data of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
ID stringThe unique ID of the function tool call output. Populated when this item is returned via API.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputItemFunctionCallOutputStatusInProgress ResponseInputItemFunctionCallOutputStatus = "in_progress" -
const ResponseInputItemFunctionCallOutputStatusCompleted ResponseInputItemFunctionCallOutputStatus = "completed" -
const ResponseInputItemFunctionCallOutputStatusIncomplete ResponseInputItemFunctionCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemToolSearchCall struct{…}-
Arguments anyThe arguments supplied to the tool search call.
-
Type ToolSearchCallThe item type. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
ID stringThe unique ID of this tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution stringWhether tool search was executed by the server or by the client.
-
const ResponseInputItemToolSearchCallExecutionServer ResponseInputItemToolSearchCallExecution = "server" -
const ResponseInputItemToolSearchCallExecutionClient ResponseInputItemToolSearchCallExecution = "client"
-
-
Status stringThe status of the tool search call.
-
const ResponseInputItemToolSearchCallStatusInProgress ResponseInputItemToolSearchCallStatus = "in_progress" -
const ResponseInputItemToolSearchCallStatusCompleted ResponseInputItemToolSearchCallStatus = "completed" -
const ResponseInputItemToolSearchCallStatusIncomplete ResponseInputItemToolSearchCallStatus = "incomplete"
-
-
-
type ResponseToolSearchOutputItemParamResp struct{…}-
Tools []ToolUnionThe loaded tool definitions returned by the tool search output.
-
type FunctionTool struct{…}Defines a function in your own code the model can choose to call. Learn more about function calling.
-
Name stringThe name of the function to call.
-
Parameters map[string, any]A JSON schema object describing the parameters of the function.
-
Strict boolWhether to enforce strict parameter validation. Default
true. -
Type FunctionThe type of the function tool. Always
function.const FunctionFunction Function = "function"
-
DeferLoading boolWhether this function is deferred and loaded via tool search.
-
Description stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
type FileSearchTool struct{…}A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
Type FileSearchThe type of the file search tool. Always
file_search.const FileSearchFileSearch FileSearch = "file_search"
-
VectorStoreIDs []stringThe IDs of the vector stores to search.
-
Filters FileSearchToolFiltersUnionA filter to apply.
-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
Key stringThe key to compare against the value.
-
Type ComparisonFilterTypeSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
const ComparisonFilterTypeEq ComparisonFilterType = "eq" -
const ComparisonFilterTypeNe ComparisonFilterType = "ne" -
const ComparisonFilterTypeGt ComparisonFilterType = "gt" -
const ComparisonFilterTypeGte ComparisonFilterType = "gte" -
const ComparisonFilterTypeLt ComparisonFilterType = "lt" -
const ComparisonFilterTypeLte ComparisonFilterType = "lte" -
const ComparisonFilterTypeIn ComparisonFilterType = "in" -
const ComparisonFilterTypeNin ComparisonFilterType = "nin"
-
-
Value ComparisonFilterValueUnionThe value to compare against the attribute key; supports string, number, or boolean types.
-
string -
float64 -
bool -
type ComparisonFilterValueArray []ComparisonFilterValueArrayItemUnion-
string -
float64
-
-
-
-
type CompoundFilter struct{…}Combine multiple filters using
andoror.-
Filters []ComparisonFilterArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
-
Type CompoundFilterTypeType of operation:
andoror.-
const CompoundFilterTypeAnd CompoundFilterType = "and" -
const CompoundFilterTypeOr CompoundFilterType = "or"
-
-
-
-
MaxNumResults int64The maximum number of results to return. This number should be between 1 and 50 inclusive.
-
RankingOptions FileSearchToolRankingOptionsRanking options for search.
-
HybridSearch FileSearchToolRankingOptionsHybridSearchWeights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
EmbeddingWeight float64The weight of the embedding in the reciprocal ranking fusion.
-
TextWeight float64The weight of the text in the reciprocal ranking fusion.
-
-
Ranker stringThe ranker to use for the file search.
-
const FileSearchToolRankingOptionsRankerAuto FileSearchToolRankingOptionsRanker = "auto" -
const FileSearchToolRankingOptionsRankerDefault2024_11_15 FileSearchToolRankingOptionsRanker = "default-2024-11-15"
-
-
ScoreThreshold float64The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
Type ComputerThe type of the computer tool. Always
computer.const ComputerComputer Computer = "computer"
-
-
type ComputerUsePreviewTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
DisplayHeight int64The height of the computer display.
-
DisplayWidth int64The width of the computer display.
-
Environment ComputerUsePreviewToolEnvironmentThe type of computer environment to control.
-
const ComputerUsePreviewToolEnvironmentWindows ComputerUsePreviewToolEnvironment = "windows" -
const ComputerUsePreviewToolEnvironmentMac ComputerUsePreviewToolEnvironment = "mac" -
const ComputerUsePreviewToolEnvironmentLinux ComputerUsePreviewToolEnvironment = "linux" -
const ComputerUsePreviewToolEnvironmentUbuntu ComputerUsePreviewToolEnvironment = "ubuntu" -
const ComputerUsePreviewToolEnvironmentBrowser ComputerUsePreviewToolEnvironment = "browser"
-
-
Type ComputerUsePreviewThe type of the computer use tool. Always
computer_use_preview.const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"
-
-
type WebSearchTool struct{…}Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
Type WebSearchToolTypeThe type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
const WebSearchToolTypeWebSearch WebSearchToolType = "web_search" -
const WebSearchToolTypeWebSearch2025_08_26 WebSearchToolType = "web_search_2025_08_26"
-
-
Filters WebSearchToolFiltersFilters for the search.
-
AllowedDomains []stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
SearchContextSize WebSearchToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchToolSearchContextSizeLow WebSearchToolSearchContextSize = "low" -
const WebSearchToolSearchContextSizeMedium WebSearchToolSearchContextSize = "medium" -
const WebSearchToolSearchContextSizeHigh WebSearchToolSearchContextSize = "high"
-
-
UserLocation WebSearchToolUserLocationThe approximate location of the user.
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
Type stringThe type of location approximation. Always
approximate.const WebSearchToolUserLocationTypeApproximate WebSearchToolUserLocationType = "approximate"
-
-
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
ServerLabel stringA label for this MCP server, used to identify it in tool calls.
-
Type McpThe type of the MCP tool. Always
mcp.const McpMcp Mcp = "mcp"
-
AllowedTools ToolMcpAllowedToolsUnionList of allowed tool names or a filter object.
-
type ToolMcpAllowedToolsMcpAllowedTools []stringA string array of allowed tool names
-
type ToolMcpAllowedToolsMcpToolFilter struct{…}A filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
Authorization stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
ConnectorID stringIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
const ToolMcpConnectorIDConnectorDropbox ToolMcpConnectorID = "connector_dropbox" -
const ToolMcpConnectorIDConnectorGmail ToolMcpConnectorID = "connector_gmail" -
const ToolMcpConnectorIDConnectorGooglecalendar ToolMcpConnectorID = "connector_googlecalendar" -
const ToolMcpConnectorIDConnectorGoogledrive ToolMcpConnectorID = "connector_googledrive" -
const ToolMcpConnectorIDConnectorMicrosoftteams ToolMcpConnectorID = "connector_microsoftteams" -
const ToolMcpConnectorIDConnectorOutlookcalendar ToolMcpConnectorID = "connector_outlookcalendar" -
const ToolMcpConnectorIDConnectorOutlookemail ToolMcpConnectorID = "connector_outlookemail" -
const ToolMcpConnectorIDConnectorSharepoint ToolMcpConnectorID = "connector_sharepoint"
-
-
DeferLoading boolWhether this MCP tool is deferred and discovered via tool search.
-
Headers map[string, string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
RequireApproval ToolMcpRequireApprovalUnionSpecify which of the MCP server's tools require approval.
-
type ToolMcpRequireApprovalMcpToolApprovalFilter 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.-
Always ToolMcpRequireApprovalMcpToolApprovalFilterAlwaysA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
Never ToolMcpRequireApprovalMcpToolApprovalFilterNeverA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
type ToolMcpRequireApprovalMcpToolApprovalSetting stringSpecify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
const ToolMcpRequireApprovalMcpToolApprovalSettingAlways ToolMcpRequireApprovalMcpToolApprovalSetting = "always" -
const ToolMcpRequireApprovalMcpToolApprovalSettingNever ToolMcpRequireApprovalMcpToolApprovalSetting = "never"
-
-
-
ServerDescription stringOptional description of the MCP server, used to provide more context.
-
ServerURL stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
TunnelID stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
Container ToolCodeInterpreterContainerUnionThe code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
string -
type ToolCodeInterpreterContainerCodeInterpreterContainerAuto struct{…}Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
Type AutoAlways
auto.const AutoAuto Auto = "auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit stringThe memory limit for the code interpreter container.
-
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"
-
-
NetworkPolicy ToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…}-
Type DisabledDisable outbound network access. Always
disabled.const DisabledDisabled Disabled = "disabled"
-
-
type ContainerNetworkPolicyAllowlist struct{…}-
AllowedDomains []stringA list of allowed domains when type is
allowlist. -
Type AllowlistAllow outbound network access only to specified domains. Always
allowlist.const AllowlistAllowlist Allowlist = "allowlist"
-
DomainSecrets []ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
Domain stringThe domain associated with the secret.
-
Name stringThe name of the secret to inject for the domain.
-
Value stringThe secret value to inject for the domain.
-
-
-
-
-
-
Type CodeInterpreterThe type of the code interpreter tool. Always
code_interpreter.const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"
-
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
Type ImageGenerationThe type of the image generation tool. Always
image_generation.const ImageGenerationImageGeneration ImageGeneration = "image_generation"
-
Action stringWhether to generate a new image or edit an existing image. Default:
auto.-
const ToolImageGenerationActionGenerate ToolImageGenerationAction = "generate" -
const ToolImageGenerationActionEdit ToolImageGenerationAction = "edit" -
const ToolImageGenerationActionAuto ToolImageGenerationAction = "auto"
-
-
Background stringAllows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
const ToolImageGenerationBackgroundTransparent ToolImageGenerationBackground = "transparent" -
const ToolImageGenerationBackgroundOpaque ToolImageGenerationBackground = "opaque" -
const ToolImageGenerationBackgroundAuto ToolImageGenerationBackground = "auto"
-
-
InputFidelity stringControl how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
const ToolImageGenerationInputFidelityHigh ToolImageGenerationInputFidelity = "high" -
const ToolImageGenerationInputFidelityLow ToolImageGenerationInputFidelity = "low"
-
-
InputImageMask ToolImageGenerationInputImageMaskOptional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
FileID stringFile ID for the mask image.
-
ImageURL stringBase64-encoded mask image.
-
-
Model stringThe image generation model to use. Default:
gpt-image-1.-
string -
string-
const ToolImageGenerationModelGPTImage1 ToolImageGenerationModel = "gpt-image-1" -
const ToolImageGenerationModelGPTImage1Mini ToolImageGenerationModel = "gpt-image-1-mini" -
const ToolImageGenerationModelGPTImage2 ToolImageGenerationModel = "gpt-image-2" -
const ToolImageGenerationModelGPTImage2_2026_04_21 ToolImageGenerationModel = "gpt-image-2-2026-04-21" -
const ToolImageGenerationModelGPTImage1_5 ToolImageGenerationModel = "gpt-image-1.5" -
const ToolImageGenerationModelChatgptImageLatest ToolImageGenerationModel = "chatgpt-image-latest"
-
-
-
Moderation stringModeration level for the generated image. Default:
auto.-
const ToolImageGenerationModerationAuto ToolImageGenerationModeration = "auto" -
const ToolImageGenerationModerationLow ToolImageGenerationModeration = "low"
-
-
OutputCompression int64Compression level for the output image. Default: 100.
-
OutputFormat stringThe output format of the generated image. One of
png,webp, orjpeg. Default:png.-
const ToolImageGenerationOutputFormatPNG ToolImageGenerationOutputFormat = "png" -
const ToolImageGenerationOutputFormatWebP ToolImageGenerationOutputFormat = "webp" -
const ToolImageGenerationOutputFormatJPEG ToolImageGenerationOutputFormat = "jpeg"
-
-
PartialImages int64Number of partial images to generate in streaming mode, from 0 (default value) to 3.
-
Quality stringThe quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
const ToolImageGenerationQualityLow ToolImageGenerationQuality = "low" -
const ToolImageGenerationQualityMedium ToolImageGenerationQuality = "medium" -
const ToolImageGenerationQualityHigh ToolImageGenerationQuality = "high" -
const ToolImageGenerationQualityAuto ToolImageGenerationQuality = "auto"
-
-
Size stringThe size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
string -
string-
const ToolImageGenerationSize1024x1024 ToolImageGenerationSize = "1024x1024" -
const ToolImageGenerationSize1024x1536 ToolImageGenerationSize = "1024x1536" -
const ToolImageGenerationSize1536x1024 ToolImageGenerationSize = "1536x1024" -
const ToolImageGenerationSizeAuto ToolImageGenerationSize = "auto"
-
-
-
-
type ToolLocalShell struct{…}A tool that allows the model to execute shell commands in a local environment.
-
Type LocalShellThe type of the local shell tool. Always
local_shell.const LocalShellLocalShell LocalShell = "local_shell"
-
-
type FunctionShellTool struct{…}A tool that allows the model to execute shell commands.
-
Type ShellThe type of the shell tool. Always
shell.const ShellShell Shell = "shell"
-
Environment FunctionShellToolEnvironmentUnion-
type ContainerAuto struct{…}-
Type ContainerAutoAutomatically creates a container for this request
const ContainerAutoContainerAuto ContainerAuto = "container_auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit ContainerAutoMemoryLimitThe memory limit for the container.
-
const ContainerAutoMemoryLimit1g ContainerAutoMemoryLimit = "1g" -
const ContainerAutoMemoryLimit4g ContainerAutoMemoryLimit = "4g" -
const ContainerAutoMemoryLimit16g ContainerAutoMemoryLimit = "16g" -
const ContainerAutoMemoryLimit64g ContainerAutoMemoryLimit = "64g"
-
-
NetworkPolicy ContainerAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…} -
type ContainerNetworkPolicyAllowlist struct{…}
-
-
Skills []ContainerAutoSkillUnionAn optional list of skills referenced by id or inline data.
-
type SkillReference struct{…}-
SkillID stringThe ID of the referenced skill.
-
Type SkillReferenceReferences a skill created with the /v1/skills endpoint.
const SkillReferenceSkillReference SkillReference = "skill_reference"
-
Version stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
type InlineSkill struct{…}-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Source InlineSkillSourceInline skill payload
-
Data stringBase64-encoded skill zip bundle.
-
MediaType ApplicationZipThe media type of the inline skill payload. Must be
application/zip.const ApplicationZipApplicationZip ApplicationZip = "application/zip"
-
Type Base64The type of the inline skill source. Must be
base64.const Base64Base64 Base64 = "base64"
-
-
Type InlineDefines an inline skill for this request.
const InlineInline Inline = "inline"
-
-
-
-
type LocalEnvironment struct{…}-
Type LocalUse a local computer environment.
const LocalLocal Local = "local"
-
Skills []LocalSkillAn optional list of skills.
-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Path stringThe path to the directory containing the skill.
-
-
-
type ContainerReference struct{…}-
ContainerID stringThe ID of the referenced container.
-
Type ContainerReferenceReferences a container created with the /v1/containers endpoint
const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
Name stringThe name of the custom tool, used to identify it in tool calls.
-
Type CustomThe type of the custom tool. Always
custom.const CustomCustom Custom = "custom"
-
DeferLoading boolWhether this tool should be deferred and discovered via tool search.
-
Description stringOptional description of the custom tool, used to provide more context.
-
Format CustomToolInputFormatUnionThe input format for the custom tool. Default is unconstrained text.
-
type CustomToolInputFormatText struct{…}Unconstrained free-form text.
-
Type TextUnconstrained text format. Always
text.const TextText Text = "text"
-
-
type CustomToolInputFormatGrammar struct{…}A grammar defined by the user.
-
Definition stringThe grammar definition.
-
Syntax stringThe syntax of the grammar definition. One of
larkorregex.-
const CustomToolInputFormatGrammarSyntaxLark CustomToolInputFormatGrammarSyntax = "lark" -
const CustomToolInputFormatGrammarSyntaxRegex CustomToolInputFormatGrammarSyntax = "regex"
-
-
Type GrammarGrammar format. Always
grammar.const GrammarGrammar Grammar = "grammar"
-
-
-
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
Description stringA description of the namespace shown to the model.
-
Name stringThe namespace name used in tool calls (for example,
crm). -
Tools []NamespaceToolToolUnionThe function/custom tools available inside this namespace.
-
type NamespaceToolToolFunction struct{…}-
Name string -
Type Functionconst FunctionFunction Function = "function"
-
DeferLoading boolWhether this function should be deferred and discovered via tool search.
-
Description string -
Parameters any -
Strict bool
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
-
Type NamespaceThe type of the tool. Always
namespace.const NamespaceNamespace Namespace = "namespace"
-
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
Type ToolSearchThe type of the tool. Always
tool_search.const ToolSearchToolSearch ToolSearch = "tool_search"
-
Description stringDescription shown to the model for a client-executed tool search tool.
-
Execution ToolSearchToolExecutionWhether tool search is executed by the server or by the client.
-
const ToolSearchToolExecutionServer ToolSearchToolExecution = "server" -
const ToolSearchToolExecutionClient ToolSearchToolExecution = "client"
-
-
Parameters anyParameter schema for a client-executed tool search tool.
-
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
Type WebSearchPreviewToolTypeThe type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
const WebSearchPreviewToolTypeWebSearchPreview WebSearchPreviewToolType = "web_search_preview" -
const WebSearchPreviewToolTypeWebSearchPreview2025_03_11 WebSearchPreviewToolType = "web_search_preview_2025_03_11"
-
-
SearchContentTypes []string-
const WebSearchPreviewToolSearchContentTypeText WebSearchPreviewToolSearchContentType = "text" -
const WebSearchPreviewToolSearchContentTypeImage WebSearchPreviewToolSearchContentType = "image"
-
-
SearchContextSize WebSearchPreviewToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchPreviewToolSearchContextSizeLow WebSearchPreviewToolSearchContextSize = "low" -
const WebSearchPreviewToolSearchContextSizeMedium WebSearchPreviewToolSearchContextSize = "medium" -
const WebSearchPreviewToolSearchContextSizeHigh WebSearchPreviewToolSearchContextSize = "high"
-
-
UserLocation WebSearchPreviewToolUserLocationThe user's location.
-
Type ApproximateThe type of location approximation. Always
approximate.const ApproximateApproximate Approximate = "approximate"
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
Type ApplyPatchThe type of the tool. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
-
Type ToolSearchOutputThe item type. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
ID stringThe unique ID of this tool search output.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemParamExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemParamExecutionServer ResponseToolSearchOutputItemParamExecution = "server" -
const ResponseToolSearchOutputItemParamExecutionClient ResponseToolSearchOutputItemParamExecution = "client"
-
-
Status ResponseToolSearchOutputItemParamStatusThe status of the tool search output.
-
const ResponseToolSearchOutputItemParamStatusInProgress ResponseToolSearchOutputItemParamStatus = "in_progress" -
const ResponseToolSearchOutputItemParamStatusCompleted ResponseToolSearchOutputItemParamStatus = "completed" -
const ResponseToolSearchOutputItemParamStatusIncomplete ResponseToolSearchOutputItemParamStatus = "incomplete"
-
-
-
type ResponseInputItemAdditionalTools struct{…}-
Role DeveloperThe role that provided the additional tools. Only
developeris supported.const DeveloperDeveloper Developer = "developer"
-
Tools []ToolUnionA list of additional tools made available at this item.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type AdditionalToolsThe item type. Always
additional_tools.const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"
-
ID stringThe unique ID of this additional tools item.
-
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
ID stringThe unique identifier of the reasoning content.
-
Summary []ResponseReasoningItemSummaryReasoning summary content.
-
Text stringA summary of the reasoning output from the model so far.
-
Type SummaryTextThe type of the object. Always
summary_text.const SummaryTextSummaryText SummaryText = "summary_text"
-
-
Type ReasoningThe type of the object. Always
reasoning.const ReasoningReasoning Reasoning = "reasoning"
-
Content []ResponseReasoningItemContentReasoning text content.
-
Text stringThe reasoning text from the model.
-
Type ReasoningTextThe type of the reasoning text. Always
reasoning_text.const ReasoningTextReasoningText ReasoningText = "reasoning_text"
-
-
EncryptedContent stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
Status ResponseReasoningItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseReasoningItemStatusInProgress ResponseReasoningItemStatus = "in_progress" -
const ResponseReasoningItemStatusCompleted ResponseReasoningItemStatus = "completed" -
const ResponseReasoningItemStatusIncomplete ResponseReasoningItemStatus = "incomplete"
-
-
-
type ResponseCompactionItemParamResp struct{…}A compaction item generated by the
v1/responses/compactAPI.-
EncryptedContent stringThe encrypted content of the compaction summary.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
ID stringThe ID of the compaction item.
-
-
type ResponseInputItemImageGenerationCall struct{…}An image generation request made by the model.
-
ID stringThe unique ID of the image generation call.
-
Result stringThe generated image encoded in base64.
-
Status stringThe status of the image generation call.
-
const ResponseInputItemImageGenerationCallStatusInProgress ResponseInputItemImageGenerationCallStatus = "in_progress" -
const ResponseInputItemImageGenerationCallStatusCompleted ResponseInputItemImageGenerationCallStatus = "completed" -
const ResponseInputItemImageGenerationCallStatusGenerating ResponseInputItemImageGenerationCallStatus = "generating" -
const ResponseInputItemImageGenerationCallStatusFailed ResponseInputItemImageGenerationCallStatus = "failed"
-
-
Type ImageGenerationCallThe type of the image generation call. Always
image_generation_call.const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"
-
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
ID stringThe unique ID of the code interpreter tool call.
-
Code stringThe code to run, or null if not available.
-
ContainerID stringThe ID of the container used to run the code.
-
Outputs []ResponseCodeInterpreterToolCallOutputUnionThe outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
type ResponseCodeInterpreterToolCallOutputLogs struct{…}The logs output from the code interpreter.
-
Logs stringThe logs output from the code interpreter.
-
Type LogsThe type of the output. Always
logs.const LogsLogs Logs = "logs"
-
-
type ResponseCodeInterpreterToolCallOutputImage struct{…}The image output from the code interpreter.
-
Type ImageThe type of the output. Always
image.const ImageImage Image = "image"
-
URL stringThe URL of the image output from the code interpreter.
-
-
-
Status ResponseCodeInterpreterToolCallStatusThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
const ResponseCodeInterpreterToolCallStatusInProgress ResponseCodeInterpreterToolCallStatus = "in_progress" -
const ResponseCodeInterpreterToolCallStatusCompleted ResponseCodeInterpreterToolCallStatus = "completed" -
const ResponseCodeInterpreterToolCallStatusIncomplete ResponseCodeInterpreterToolCallStatus = "incomplete" -
const ResponseCodeInterpreterToolCallStatusInterpreting ResponseCodeInterpreterToolCallStatus = "interpreting" -
const ResponseCodeInterpreterToolCallStatusFailed ResponseCodeInterpreterToolCallStatus = "failed"
-
-
Type CodeInterpreterCallThe type of the code interpreter tool call. Always
code_interpreter_call.const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"
-
-
type ResponseInputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
ID stringThe unique ID of the local shell call.
-
Action ResponseInputItemLocalShellCallActionExecute a shell command on the server.
-
Command []stringThe command to run.
-
Env map[string, string]Environment variables to set for the command.
-
Type ExecThe type of the local shell action. Always
exec.const ExecExec Exec = "exec"
-
TimeoutMs int64Optional timeout in milliseconds for the command.
-
User stringOptional user to run the command as.
-
WorkingDirectory stringOptional working directory to run the command in.
-
-
CallID stringThe unique ID of the local shell tool call generated by the model.
-
Status stringThe status of the local shell call.
-
const ResponseInputItemLocalShellCallStatusInProgress ResponseInputItemLocalShellCallStatus = "in_progress" -
const ResponseInputItemLocalShellCallStatusCompleted ResponseInputItemLocalShellCallStatus = "completed" -
const ResponseInputItemLocalShellCallStatusIncomplete ResponseInputItemLocalShellCallStatus = "incomplete"
-
-
Type LocalShellCallThe type of the local shell call. Always
local_shell_call.const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"
-
-
type ResponseInputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
ID stringThe unique ID of the local shell tool call generated by the model.
-
Output stringA JSON string of the output of the local shell tool call.
-
Type LocalShellCallOutputThe type of the local shell tool call output. Always
local_shell_call_output.const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete.-
const ResponseInputItemLocalShellCallOutputStatusInProgress ResponseInputItemLocalShellCallOutputStatus = "in_progress" -
const ResponseInputItemLocalShellCallOutputStatusCompleted ResponseInputItemLocalShellCallOutputStatus = "completed" -
const ResponseInputItemLocalShellCallOutputStatusIncomplete ResponseInputItemLocalShellCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemShellCall struct{…}A tool representing a request to execute one or more shell commands.
-
Action ResponseInputItemShellCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []stringOrdered shell commands for the execution environment to run.
-
MaxOutputLength int64Maximum number of UTF-8 characters to capture from combined stdout and stderr output.
-
TimeoutMs int64Maximum wall-clock time in milliseconds to allow the shell commands to run.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Environment ResponseInputItemShellCallEnvironmentUnionThe environment to execute the shell commands in.
-
type LocalEnvironment struct{…} -
type ContainerReference struct{…}
-
-
Status stringThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseInputItemShellCallStatusInProgress ResponseInputItemShellCallStatus = "in_progress" -
const ResponseInputItemShellCallStatusCompleted ResponseInputItemShellCallStatus = "completed" -
const ResponseInputItemShellCallStatusIncomplete ResponseInputItemShellCallStatus = "incomplete"
-
-
-
type ResponseInputItemShellCallOutput struct{…}The streamed output items emitted by a shell tool call.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Output []ResponseFunctionShellCallOutputContentCaptured chunks of stdout and stderr output, along with their associated outcomes.
-
Outcome ResponseFunctionShellCallOutputContentOutcomeUnionThe exit or timeout outcome associated with this shell call.
-
type ResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellCallOutputContentOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64The exit code returned by the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringCaptured stderr output for the shell call.
-
Stdout stringCaptured stdout output for the shell call.
-
-
Type ShellCallOutputThe type of the item. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
ID stringThe unique ID of the shell tool call output. Populated when this item is returned via API.
-
MaxOutputLength int64The maximum number of UTF-8 characters captured for this shell call's combined output.
-
Status stringThe status of the shell call output.
-
const ResponseInputItemShellCallOutputStatusInProgress ResponseInputItemShellCallOutputStatus = "in_progress" -
const ResponseInputItemShellCallOutputStatusCompleted ResponseInputItemShellCallOutputStatus = "completed" -
const ResponseInputItemShellCallOutputStatusIncomplete ResponseInputItemShellCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemApplyPatchCall struct{…}A tool call representing a request to create, delete, or update files using diff patches.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseInputItemApplyPatchCallOperationUnionThe specific create, delete, or update instruction for the apply_patch tool call.
-
type ResponseInputItemApplyPatchCallOperationCreateFile struct{…}Instruction for creating a new file via the apply_patch tool.
-
Diff stringUnified diff content to apply when creating the file.
-
Path stringPath of the file to create relative to the workspace root.
-
Type CreateFileThe operation type. Always
create_file.const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseInputItemApplyPatchCallOperationDeleteFile struct{…}Instruction for deleting an existing file via the apply_patch tool.
-
Path stringPath of the file to delete relative to the workspace root.
-
Type DeleteFileThe operation type. Always
delete_file.const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseInputItemApplyPatchCallOperationUpdateFile struct{…}Instruction for updating an existing file via the apply_patch tool.
-
Diff stringUnified diff content to apply to the existing file.
-
Path stringPath of the file to update relative to the workspace root.
-
Type UpdateFileThe operation type. Always
update_file.const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status stringThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseInputItemApplyPatchCallStatusInProgress ResponseInputItemApplyPatchCallStatus = "in_progress" -
const ResponseInputItemApplyPatchCallStatusCompleted ResponseInputItemApplyPatchCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
-
type ResponseInputItemApplyPatchCallOutput struct{…}The streamed output emitted by an apply patch tool call.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status stringThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseInputItemApplyPatchCallOutputStatusCompleted ResponseInputItemApplyPatchCallOutputStatus = "completed" -
const ResponseInputItemApplyPatchCallOutputStatusFailed ResponseInputItemApplyPatchCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
Output stringOptional human-readable log text from the apply patch tool (e.g., patch results or errors).
-
-
type ResponseInputItemMcpListTools struct{…}A list of tools available on an MCP server.
-
ID stringThe unique ID of the list.
-
ServerLabel stringThe label of the MCP server.
-
Tools []ResponseInputItemMcpListToolsToolThe tools available on the server.
-
InputSchema anyThe JSON schema describing the tool's input.
-
Name stringThe name of the tool.
-
Annotations anyAdditional annotations about the tool.
-
Description stringThe description of the tool.
-
-
Type McpListToolsThe type of the item. Always
mcp_list_tools.const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
-
Error stringError message if the server could not list tools.
-
-
type ResponseInputItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
ID stringThe unique ID of the approval request.
-
Arguments stringA JSON string of arguments for the tool.
-
Name stringThe name of the tool to run.
-
ServerLabel stringThe label of the MCP server making the request.
-
Type McpApprovalRequestThe type of the item. Always
mcp_approval_request.const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"
-
-
type ResponseInputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
ApprovalRequestID stringThe ID of the approval request being answered.
-
Approve boolWhether the request was approved.
-
Type McpApprovalResponseThe type of the item. Always
mcp_approval_response.const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
-
ID stringThe unique ID of the approval response
-
Reason stringOptional reason for the decision.
-
-
type ResponseInputItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
ID stringThe unique ID of the tool call.
-
Arguments stringA JSON string of the arguments passed to the tool.
-
Name stringThe name of the tool that was run.
-
ServerLabel stringThe label of the MCP server running the tool.
-
Type McpCallThe type of the item. Always
mcp_call.const McpCallMcpCall McpCall = "mcp_call"
-
ApprovalRequestID stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
Error stringThe error from the tool call, if any.
-
Output stringThe output from the tool call.
-
Status stringThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
const ResponseInputItemMcpCallStatusInProgress ResponseInputItemMcpCallStatus = "in_progress" -
const ResponseInputItemMcpCallStatusCompleted ResponseInputItemMcpCallStatus = "completed" -
const ResponseInputItemMcpCallStatusIncomplete ResponseInputItemMcpCallStatus = "incomplete" -
const ResponseInputItemMcpCallStatusCalling ResponseInputItemMcpCallStatus = "calling" -
const ResponseInputItemMcpCallStatusFailed ResponseInputItemMcpCallStatus = "failed"
-
-
-
type ResponseCustomToolCallOutput struct{…}The output of a custom tool call from your code, being sent back to the model.
-
CallID stringThe call ID, used to map this custom tool call output to a custom tool call.
-
Output ResponseCustomToolCallOutputOutputUnionThe output from the custom tool call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseCustomToolCallOutputOutputOutputContentList []ResponseCustomToolCallOutputOutputOutputContentListItemUnionText, image, or file output of the custom tool call.
-
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
-
Type CustomToolCallOutputThe type of the custom tool call output. Always
custom_tool_call_output.const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"
-
ID stringThe unique ID of the custom tool call output in the OpenAI platform.
-
-
type ResponseCustomToolCall struct{…}A call to a custom tool created by the model.
-
CallID stringAn identifier used to map this custom tool call to a tool call output.
-
Input stringThe input for the custom tool call generated by the model.
-
Name stringThe name of the custom tool being called.
-
Type CustomToolCallThe type of the custom tool call. Always
custom_tool_call.const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"
-
ID stringThe unique ID of the custom tool call in the OpenAI platform.
-
Namespace stringThe namespace of the custom tool being called.
-
-
type ResponseInputItemCompactionTrigger struct{…}Compacts the current context. Must be the final input item.
-
Type CompactionTriggerThe type of the item. Always
compaction_trigger.const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"
-
-
type ResponseInputItemItemReference struct{…}An internal identifier for an item to reference.
-
ID stringThe ID of the item to reference.
-
Type stringThe type of item to reference. Always
item_reference.const ResponseInputItemItemReferenceTypeItemReference ResponseInputItemItemReferenceType = "item_reference"
-
-
-
-
Metadata MetadataSet of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
-
Model ResponsesModelModel ID used to generate the response, like
gpt-4ooro3. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models.-
string -
type ChatModel string-
const ChatModelGPT5_4 ChatModel = "gpt-5.4" -
const ChatModelGPT5_4Mini ChatModel = "gpt-5.4-mini" -
const ChatModelGPT5_4Nano ChatModel = "gpt-5.4-nano" -
const ChatModelGPT5_4Mini2026_03_17 ChatModel = "gpt-5.4-mini-2026-03-17" -
const ChatModelGPT5_4Nano2026_03_17 ChatModel = "gpt-5.4-nano-2026-03-17" -
const ChatModelGPT5_3ChatLatest ChatModel = "gpt-5.3-chat-latest" -
const ChatModelGPT5_2 ChatModel = "gpt-5.2" -
const ChatModelGPT5_2_2025_12_11 ChatModel = "gpt-5.2-2025-12-11" -
const ChatModelGPT5_2ChatLatest ChatModel = "gpt-5.2-chat-latest" -
const ChatModelGPT5_2Pro ChatModel = "gpt-5.2-pro" -
const ChatModelGPT5_2Pro2025_12_11 ChatModel = "gpt-5.2-pro-2025-12-11" -
const ChatModelGPT5_1 ChatModel = "gpt-5.1" -
const ChatModelGPT5_1_2025_11_13 ChatModel = "gpt-5.1-2025-11-13" -
const ChatModelGPT5_1Codex ChatModel = "gpt-5.1-codex" -
const ChatModelGPT5_1Mini ChatModel = "gpt-5.1-mini" -
const ChatModelGPT5_1ChatLatest ChatModel = "gpt-5.1-chat-latest" -
const ChatModelGPT5 ChatModel = "gpt-5" -
const ChatModelGPT5Mini ChatModel = "gpt-5-mini" -
const ChatModelGPT5Nano ChatModel = "gpt-5-nano" -
const ChatModelGPT5_2025_08_07 ChatModel = "gpt-5-2025-08-07" -
const ChatModelGPT5Mini2025_08_07 ChatModel = "gpt-5-mini-2025-08-07" -
const ChatModelGPT5Nano2025_08_07 ChatModel = "gpt-5-nano-2025-08-07" -
const ChatModelGPT5ChatLatest ChatModel = "gpt-5-chat-latest" -
const ChatModelGPT4_1 ChatModel = "gpt-4.1" -
const ChatModelGPT4_1Mini ChatModel = "gpt-4.1-mini" -
const ChatModelGPT4_1Nano ChatModel = "gpt-4.1-nano" -
const ChatModelGPT4_1_2025_04_14 ChatModel = "gpt-4.1-2025-04-14" -
const ChatModelGPT4_1Mini2025_04_14 ChatModel = "gpt-4.1-mini-2025-04-14" -
const ChatModelGPT4_1Nano2025_04_14 ChatModel = "gpt-4.1-nano-2025-04-14" -
const ChatModelO4Mini ChatModel = "o4-mini" -
const ChatModelO4Mini2025_04_16 ChatModel = "o4-mini-2025-04-16" -
const ChatModelO3 ChatModel = "o3" -
const ChatModelO3_2025_04_16 ChatModel = "o3-2025-04-16" -
const ChatModelO3Mini ChatModel = "o3-mini" -
const ChatModelO3Mini2025_01_31 ChatModel = "o3-mini-2025-01-31" -
const ChatModelO1 ChatModel = "o1" -
const ChatModelO1_2024_12_17 ChatModel = "o1-2024-12-17" -
const ChatModelO1Preview ChatModel = "o1-preview" -
const ChatModelO1Preview2024_09_12 ChatModel = "o1-preview-2024-09-12" -
const ChatModelO1Mini ChatModel = "o1-mini" -
const ChatModelO1Mini2024_09_12 ChatModel = "o1-mini-2024-09-12" -
const ChatModelGPT4o ChatModel = "gpt-4o" -
const ChatModelGPT4o2024_11_20 ChatModel = "gpt-4o-2024-11-20" -
const ChatModelGPT4o2024_08_06 ChatModel = "gpt-4o-2024-08-06" -
const ChatModelGPT4o2024_05_13 ChatModel = "gpt-4o-2024-05-13" -
const ChatModelGPT4oAudioPreview ChatModel = "gpt-4o-audio-preview" -
const ChatModelGPT4oAudioPreview2024_10_01 ChatModel = "gpt-4o-audio-preview-2024-10-01" -
const ChatModelGPT4oAudioPreview2024_12_17 ChatModel = "gpt-4o-audio-preview-2024-12-17" -
const ChatModelGPT4oAudioPreview2025_06_03 ChatModel = "gpt-4o-audio-preview-2025-06-03" -
const ChatModelGPT4oMiniAudioPreview ChatModel = "gpt-4o-mini-audio-preview" -
const ChatModelGPT4oMiniAudioPreview2024_12_17 ChatModel = "gpt-4o-mini-audio-preview-2024-12-17" -
const ChatModelGPT4oSearchPreview ChatModel = "gpt-4o-search-preview" -
const ChatModelGPT4oMiniSearchPreview ChatModel = "gpt-4o-mini-search-preview" -
const ChatModelGPT4oSearchPreview2025_03_11 ChatModel = "gpt-4o-search-preview-2025-03-11" -
const ChatModelGPT4oMiniSearchPreview2025_03_11 ChatModel = "gpt-4o-mini-search-preview-2025-03-11" -
const ChatModelChatgpt4oLatest ChatModel = "chatgpt-4o-latest" -
const ChatModelCodexMiniLatest ChatModel = "codex-mini-latest" -
const ChatModelGPT4oMini ChatModel = "gpt-4o-mini" -
const ChatModelGPT4oMini2024_07_18 ChatModel = "gpt-4o-mini-2024-07-18" -
const ChatModelGPT4Turbo ChatModel = "gpt-4-turbo" -
const ChatModelGPT4Turbo2024_04_09 ChatModel = "gpt-4-turbo-2024-04-09" -
const ChatModelGPT4_0125Preview ChatModel = "gpt-4-0125-preview" -
const ChatModelGPT4TurboPreview ChatModel = "gpt-4-turbo-preview" -
const ChatModelGPT4_1106Preview ChatModel = "gpt-4-1106-preview" -
const ChatModelGPT4VisionPreview ChatModel = "gpt-4-vision-preview" -
const ChatModelGPT4 ChatModel = "gpt-4" -
const ChatModelGPT4_0314 ChatModel = "gpt-4-0314" -
const ChatModelGPT4_0613 ChatModel = "gpt-4-0613" -
const ChatModelGPT4_32k ChatModel = "gpt-4-32k" -
const ChatModelGPT4_32k0314 ChatModel = "gpt-4-32k-0314" -
const ChatModelGPT4_32k0613 ChatModel = "gpt-4-32k-0613" -
const ChatModelGPT3_5Turbo ChatModel = "gpt-3.5-turbo" -
const ChatModelGPT3_5Turbo16k ChatModel = "gpt-3.5-turbo-16k" -
const ChatModelGPT3_5Turbo0301 ChatModel = "gpt-3.5-turbo-0301" -
const ChatModelGPT3_5Turbo0613 ChatModel = "gpt-3.5-turbo-0613" -
const ChatModelGPT3_5Turbo1106 ChatModel = "gpt-3.5-turbo-1106" -
const ChatModelGPT3_5Turbo0125 ChatModel = "gpt-3.5-turbo-0125" -
const ChatModelGPT3_5Turbo16k0613 ChatModel = "gpt-3.5-turbo-16k-0613"
-
-
type ResponsesModel string-
const ResponsesModelO1Pro ResponsesModel = "o1-pro" -
const ResponsesModelO1Pro2025_03_19 ResponsesModel = "o1-pro-2025-03-19" -
const ResponsesModelO3Pro ResponsesModel = "o3-pro" -
const ResponsesModelO3Pro2025_06_10 ResponsesModel = "o3-pro-2025-06-10" -
const ResponsesModelO3DeepResearch ResponsesModel = "o3-deep-research" -
const ResponsesModelO3DeepResearch2025_06_26 ResponsesModel = "o3-deep-research-2025-06-26" -
const ResponsesModelO4MiniDeepResearch ResponsesModel = "o4-mini-deep-research" -
const ResponsesModelO4MiniDeepResearch2025_06_26 ResponsesModel = "o4-mini-deep-research-2025-06-26" -
const ResponsesModelComputerUsePreview ResponsesModel = "computer-use-preview" -
const ResponsesModelComputerUsePreview2025_03_11 ResponsesModel = "computer-use-preview-2025-03-11" -
const ResponsesModelGPT5Codex ResponsesModel = "gpt-5-codex" -
const ResponsesModelGPT5Pro ResponsesModel = "gpt-5-pro" -
const ResponsesModelGPT5Pro2025_10_06 ResponsesModel = "gpt-5-pro-2025-10-06" -
const ResponsesModelGPT5_1CodexMax ResponsesModel = "gpt-5.1-codex-max"
-
-
-
Object ResponseThe object type of this resource - always set to
response.const ResponseResponse Response = "response"
-
Output []ResponseOutputItemUnionAn array of content items generated by the model.
-
The length and order of items in the
outputarray is dependent on the model's response. -
Rather than accessing the first item in the
outputarray and assuming it's anassistantmessage with the content generated by the model, you might consider using theoutput_textproperty where supported in SDKs. -
type ResponseOutputMessage struct{…}An output message from the model.
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
type ResponseFunctionToolCall struct{…}A tool call to run a function. See the function calling guide for more information.
-
type ResponseFunctionToolCallOutputItem struct{…}-
ID stringThe unique ID of the function call tool output.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseFunctionToolCallOutputItemOutputUnionThe output from the function call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseFunctionToolCallOutputItemOutputOutputContentList []ResponseFunctionToolCallOutputItemOutputOutputContentListItemUnionText, image, or file output of the function call.
-
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
-
Status ResponseFunctionToolCallOutputItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallOutputItemStatusInProgress ResponseFunctionToolCallOutputItemStatus = "in_progress" -
const ResponseFunctionToolCallOutputItemStatusCompleted ResponseFunctionToolCallOutputItemStatus = "completed" -
const ResponseFunctionToolCallOutputItemStatusIncomplete ResponseFunctionToolCallOutputItemStatus = "incomplete"
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
type ResponseComputerToolCallOutputItem struct{…}-
ID stringThe unique ID of the computer call tool output.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Status ResponseComputerToolCallOutputItemStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseComputerToolCallOutputItemStatusCompleted ResponseComputerToolCallOutputItemStatus = "completed" -
const ResponseComputerToolCallOutputItemStatusIncomplete ResponseComputerToolCallOutputItemStatus = "incomplete" -
const ResponseComputerToolCallOutputItemStatusFailed ResponseComputerToolCallOutputItemStatus = "failed" -
const ResponseComputerToolCallOutputItemStatusInProgress ResponseComputerToolCallOutputItemStatus = "in_progress"
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
AcknowledgedSafetyChecks []ResponseComputerToolCallOutputItemAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context. -
type ResponseToolSearchCall struct{…}-
ID stringThe unique ID of the tool search call item.
-
Arguments anyArguments used for the tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchCallExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchCallExecutionServer ResponseToolSearchCallExecution = "server" -
const ResponseToolSearchCallExecutionClient ResponseToolSearchCallExecution = "client"
-
-
Status ResponseToolSearchCallStatusThe status of the tool search call item that was recorded.
-
const ResponseToolSearchCallStatusInProgress ResponseToolSearchCallStatus = "in_progress" -
const ResponseToolSearchCallStatusCompleted ResponseToolSearchCallStatus = "completed" -
const ResponseToolSearchCallStatusIncomplete ResponseToolSearchCallStatus = "incomplete"
-
-
Type ToolSearchCallThe type of the item. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseToolSearchOutputItem struct{…}-
ID stringThe unique ID of the tool search output item.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemExecutionServer ResponseToolSearchOutputItemExecution = "server" -
const ResponseToolSearchOutputItemExecutionClient ResponseToolSearchOutputItemExecution = "client"
-
-
Status ResponseToolSearchOutputItemStatusThe status of the tool search output item that was recorded.
-
const ResponseToolSearchOutputItemStatusInProgress ResponseToolSearchOutputItemStatus = "in_progress" -
const ResponseToolSearchOutputItemStatusCompleted ResponseToolSearchOutputItemStatus = "completed" -
const ResponseToolSearchOutputItemStatusIncomplete ResponseToolSearchOutputItemStatus = "incomplete"
-
-
Tools []ToolUnionThe loaded tool definitions returned by tool search.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type ToolSearchOutputThe type of the item. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseOutputItemAdditionalTools struct{…}-
ID stringThe unique ID of the additional tools item.
-
Role stringThe role that provided the additional tools.
-
const ResponseOutputItemAdditionalToolsRoleUnknown ResponseOutputItemAdditionalToolsRole = "unknown" -
const ResponseOutputItemAdditionalToolsRoleUser ResponseOutputItemAdditionalToolsRole = "user" -
const ResponseOutputItemAdditionalToolsRoleAssistant ResponseOutputItemAdditionalToolsRole = "assistant" -
const ResponseOutputItemAdditionalToolsRoleSystem ResponseOutputItemAdditionalToolsRole = "system" -
const ResponseOutputItemAdditionalToolsRoleCritic ResponseOutputItemAdditionalToolsRole = "critic" -
const ResponseOutputItemAdditionalToolsRoleDiscriminator ResponseOutputItemAdditionalToolsRole = "discriminator" -
const ResponseOutputItemAdditionalToolsRoleDeveloper ResponseOutputItemAdditionalToolsRole = "developer" -
const ResponseOutputItemAdditionalToolsRoleTool ResponseOutputItemAdditionalToolsRole = "tool"
-
-
Tools []ToolUnionThe additional tool definitions made available at this item.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type AdditionalToolsThe type of the item. Always
additional_tools.const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"
-
-
type ResponseCompactionItem struct{…}A compaction item generated by the
v1/responses/compactAPI.-
ID stringThe unique ID of the compaction item.
-
EncryptedContent stringThe encrypted content that was produced by compaction.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseOutputItemImageGenerationCall struct{…}An image generation request made by the model.
-
ID stringThe unique ID of the image generation call.
-
Result stringThe generated image encoded in base64.
-
Status stringThe status of the image generation call.
-
const ResponseOutputItemImageGenerationCallStatusInProgress ResponseOutputItemImageGenerationCallStatus = "in_progress" -
const ResponseOutputItemImageGenerationCallStatusCompleted ResponseOutputItemImageGenerationCallStatus = "completed" -
const ResponseOutputItemImageGenerationCallStatusGenerating ResponseOutputItemImageGenerationCallStatus = "generating" -
const ResponseOutputItemImageGenerationCallStatusFailed ResponseOutputItemImageGenerationCallStatus = "failed"
-
-
Type ImageGenerationCallThe type of the image generation call. Always
image_generation_call.const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"
-
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
type ResponseOutputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
ID stringThe unique ID of the local shell call.
-
Action ResponseOutputItemLocalShellCallActionExecute a shell command on the server.
-
Command []stringThe command to run.
-
Env map[string, string]Environment variables to set for the command.
-
Type ExecThe type of the local shell action. Always
exec.const ExecExec Exec = "exec"
-
TimeoutMs int64Optional timeout in milliseconds for the command.
-
User stringOptional user to run the command as.
-
WorkingDirectory stringOptional working directory to run the command in.
-
-
CallID stringThe unique ID of the local shell tool call generated by the model.
-
Status stringThe status of the local shell call.
-
const ResponseOutputItemLocalShellCallStatusInProgress ResponseOutputItemLocalShellCallStatus = "in_progress" -
const ResponseOutputItemLocalShellCallStatusCompleted ResponseOutputItemLocalShellCallStatus = "completed" -
const ResponseOutputItemLocalShellCallStatusIncomplete ResponseOutputItemLocalShellCallStatus = "incomplete"
-
-
Type LocalShellCallThe type of the local shell call. Always
local_shell_call.const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"
-
-
type ResponseOutputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
ID stringThe unique ID of the local shell tool call generated by the model.
-
Output stringA JSON string of the output of the local shell tool call.
-
Type LocalShellCallOutputThe type of the local shell tool call output. Always
local_shell_call_output.const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete.-
const ResponseOutputItemLocalShellCallOutputStatusInProgress ResponseOutputItemLocalShellCallOutputStatus = "in_progress" -
const ResponseOutputItemLocalShellCallOutputStatusCompleted ResponseOutputItemLocalShellCallOutputStatus = "completed" -
const ResponseOutputItemLocalShellCallOutputStatusIncomplete ResponseOutputItemLocalShellCallOutputStatus = "incomplete"
-
-
-
type ResponseFunctionShellToolCall struct{…}A tool call that executes one or more shell commands in a managed environment.
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Action ResponseFunctionShellToolCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []string -
MaxOutputLength int64Optional maximum number of characters to return from each command.
-
TimeoutMs int64Optional timeout in milliseconds for the commands.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Environment ResponseFunctionShellToolCallEnvironmentUnionRepresents the use of a local environment to perform shell actions.
-
type ResponseLocalEnvironment struct{…}Represents the use of a local environment to perform shell actions.
-
Type LocalThe environment type. Always
local.const LocalLocal Local = "local"
-
-
type ResponseContainerReference struct{…}Represents a container created with /v1/containers.
-
ContainerID string -
Type ContainerReferenceThe environment type. Always
container_reference.const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
Status ResponseFunctionShellToolCallStatusThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallStatusInProgress ResponseFunctionShellToolCallStatus = "in_progress" -
const ResponseFunctionShellToolCallStatusCompleted ResponseFunctionShellToolCallStatus = "completed" -
const ResponseFunctionShellToolCallStatusIncomplete ResponseFunctionShellToolCallStatus = "incomplete"
-
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseFunctionShellToolCallOutput struct{…}The output of a shell tool call that was emitted.
-
ID stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
MaxOutputLength int64The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
Output []ResponseFunctionShellToolCallOutputOutputAn array of shell call output contents
-
Outcome ResponseFunctionShellToolCallOutputOutputOutcomeUnionRepresents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
type ResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64Exit code from the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringThe standard error output that was captured.
-
Stdout stringThe standard output that was captured.
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
Status ResponseFunctionShellToolCallOutputStatusThe status of the shell call output. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallOutputStatusInProgress ResponseFunctionShellToolCallOutputStatus = "in_progress" -
const ResponseFunctionShellToolCallOutputStatusCompleted ResponseFunctionShellToolCallOutputStatus = "completed" -
const ResponseFunctionShellToolCallOutputStatusIncomplete ResponseFunctionShellToolCallOutputStatus = "incomplete"
-
-
Type ShellCallOutputThe type of the shell call output. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseApplyPatchToolCall struct{…}A tool call that applies file diffs by creating, deleting, or updating files.
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseApplyPatchToolCallOperationUnionOne of the create_file, delete_file, or update_file operations applied via apply_patch.
-
type ResponseApplyPatchToolCallOperationCreateFile struct{…}Instruction describing how to create a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to create.
-
Type CreateFileCreate a new file with the provided diff.
const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseApplyPatchToolCallOperationDeleteFile struct{…}Instruction describing how to delete a file via the apply_patch tool.
-
Path stringPath of the file to delete.
-
Type DeleteFileDelete the specified file.
const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseApplyPatchToolCallOperationUpdateFile struct{…}Instruction describing how to update a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to update.
-
Type UpdateFileUpdate an existing file with the provided diff.
const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status ResponseApplyPatchToolCallStatusThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseApplyPatchToolCallStatusInProgress ResponseApplyPatchToolCallStatus = "in_progress" -
const ResponseApplyPatchToolCallStatusCompleted ResponseApplyPatchToolCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseApplyPatchToolCallOutput struct{…}The output emitted by an apply patch tool call.
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status ResponseApplyPatchToolCallOutputStatusThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseApplyPatchToolCallOutputStatusCompleted ResponseApplyPatchToolCallOutputStatus = "completed" -
const ResponseApplyPatchToolCallOutputStatusFailed ResponseApplyPatchToolCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
CreatedBy stringThe ID of the entity that created this tool call output.
-
Output stringOptional textual output returned by the apply patch tool.
-
-
type ResponseOutputItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
ID stringThe unique ID of the tool call.
-
Arguments stringA JSON string of the arguments passed to the tool.
-
Name stringThe name of the tool that was run.
-
ServerLabel stringThe label of the MCP server running the tool.
-
Type McpCallThe type of the item. Always
mcp_call.const McpCallMcpCall McpCall = "mcp_call"
-
ApprovalRequestID stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
Error stringThe error from the tool call, if any.
-
Output stringThe output from the tool call.
-
Status stringThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
const ResponseOutputItemMcpCallStatusInProgress ResponseOutputItemMcpCallStatus = "in_progress" -
const ResponseOutputItemMcpCallStatusCompleted ResponseOutputItemMcpCallStatus = "completed" -
const ResponseOutputItemMcpCallStatusIncomplete ResponseOutputItemMcpCallStatus = "incomplete" -
const ResponseOutputItemMcpCallStatusCalling ResponseOutputItemMcpCallStatus = "calling" -
const ResponseOutputItemMcpCallStatusFailed ResponseOutputItemMcpCallStatus = "failed"
-
-
-
type ResponseOutputItemMcpListTools struct{…}A list of tools available on an MCP server.
-
ID stringThe unique ID of the list.
-
ServerLabel stringThe label of the MCP server.
-
Tools []ResponseOutputItemMcpListToolsToolThe tools available on the server.
-
InputSchema anyThe JSON schema describing the tool's input.
-
Name stringThe name of the tool.
-
Annotations anyAdditional annotations about the tool.
-
Description stringThe description of the tool.
-
-
Type McpListToolsThe type of the item. Always
mcp_list_tools.const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
-
Error stringError message if the server could not list tools.
-
-
type ResponseOutputItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
ID stringThe unique ID of the approval request.
-
Arguments stringA JSON string of arguments for the tool.
-
Name stringThe name of the tool to run.
-
ServerLabel stringThe label of the MCP server making the request.
-
Type McpApprovalRequestThe type of the item. Always
mcp_approval_request.const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"
-
-
type ResponseOutputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
ID stringThe unique ID of the approval response
-
ApprovalRequestID stringThe ID of the approval request being answered.
-
Approve boolWhether the request was approved.
-
Type McpApprovalResponseThe type of the item. Always
mcp_approval_response.const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
-
Reason stringOptional reason for the decision.
-
-
type ResponseCustomToolCall struct{…}A call to a custom tool created by the model.
-
type ResponseCustomToolCallOutputItem struct{…}The output of a custom tool call from your code, being sent back to the model.
-
ID stringThe unique ID of the custom tool call output item.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseCustomToolCallOutputItemStatusInProgress ResponseCustomToolCallOutputItemStatus = "in_progress" -
const ResponseCustomToolCallOutputItemStatusCompleted ResponseCustomToolCallOutputItemStatus = "completed" -
const ResponseCustomToolCallOutputItemStatusIncomplete ResponseCustomToolCallOutputItemStatus = "incomplete"
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
-
ParallelToolCalls boolWhether to allow the model to run tool calls in parallel.
-
Temperature float64What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or
top_pbut not both. -
ToolChoice ResponseToolChoiceUnionHow the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call.-
type ToolChoiceOptions stringControls which (if any) tool is called by the model.
nonemeans the model will not call any tool and instead generates a message.automeans the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools.-
const ToolChoiceOptionsNone ToolChoiceOptions = "none" -
const ToolChoiceOptionsAuto ToolChoiceOptions = "auto" -
const ToolChoiceOptionsRequired ToolChoiceOptions = "required"
-
-
type ToolChoiceAllowed struct{…}Constrains the tools available to the model to a pre-defined set.
-
Mode ToolChoiceAllowedModeConstrains the tools available to the model to a pre-defined set.
autoallows the model to pick from among the allowed tools and generate a message.requiredrequires the model to call one or more of the allowed tools.-
const ToolChoiceAllowedModeAuto ToolChoiceAllowedMode = "auto" -
const ToolChoiceAllowedModeRequired ToolChoiceAllowedMode = "required"
-
-
Tools []map[string, any]A list of tool definitions that the model should be allowed to call.
For the Responses API, the list of tool definitions might look like:
[ { "type": "function", "name": "get_weather" }, { "type": "mcp", "server_label": "deepwiki" }, { "type": "image_generation" } ] -
Type AllowedToolsAllowed tool configuration type. Always
allowed_tools.const AllowedToolsAllowedTools AllowedTools = "allowed_tools"
-
-
type ToolChoiceTypes struct{…}Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
-
Type ToolChoiceTypesTypeThe type of hosted tool the model should to use. Learn more about built-in tools.
Allowed values are:
-
file_search -
web_search_preview -
computer -
computer_use_preview -
computer_use -
code_interpreter -
image_generation -
const ToolChoiceTypesTypeFileSearch ToolChoiceTypesType = "file_search" -
const ToolChoiceTypesTypeWebSearchPreview ToolChoiceTypesType = "web_search_preview" -
const ToolChoiceTypesTypeComputer ToolChoiceTypesType = "computer" -
const ToolChoiceTypesTypeComputerUsePreview ToolChoiceTypesType = "computer_use_preview" -
const ToolChoiceTypesTypeComputerUse ToolChoiceTypesType = "computer_use" -
const ToolChoiceTypesTypeWebSearchPreview2025_03_11 ToolChoiceTypesType = "web_search_preview_2025_03_11" -
const ToolChoiceTypesTypeImageGeneration ToolChoiceTypesType = "image_generation" -
const ToolChoiceTypesTypeCodeInterpreter ToolChoiceTypesType = "code_interpreter"
-
-
-
type ToolChoiceFunction struct{…}Use this option to force the model to call a specific function.
-
Name stringThe name of the function to call.
-
Type FunctionFor function calling, the type is always
function.const FunctionFunction Function = "function"
-
-
type ToolChoiceMcp struct{…}Use this option to force the model to call a specific tool on a remote MCP server.
-
ServerLabel stringThe label of the MCP server to use.
-
Type McpFor MCP tools, the type is always
mcp.const McpMcp Mcp = "mcp"
-
Name stringThe name of the tool to call on the server.
-
-
type ToolChoiceCustom struct{…}Use this option to force the model to call a specific custom tool.
-
Name stringThe name of the custom tool to call.
-
Type CustomFor custom tool calling, the type is always
custom.const CustomCustom Custom = "custom"
-
-
type ToolChoiceApplyPatch struct{…}Forces the model to call the apply_patch tool when executing a tool call.
-
Type ApplyPatchThe tool to call. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
type ToolChoiceShell struct{…}Forces the model to call the shell tool when a tool call is required.
-
Type ShellThe tool to call. Always
shell.const ShellShell Shell = "shell"
-
-
-
Tools []ToolUnionAn array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.We support the following categories of tools:
-
Built-in tools: Tools that are provided by OpenAI that extend the model's capabilities, like web search or file search. Learn more about built-in tools.
-
MCP Tools: Integrations with third-party systems via custom MCP servers or predefined connectors such as Google Drive and SharePoint. Learn more about MCP Tools.
-
Function calls (custom tools): Functions that are defined by you, enabling the model to call your own code with strongly typed arguments and outputs. Learn more about function calling. You can also use custom tools to call your own code.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
TopP float64An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
We generally recommend altering this or
temperaturebut not both. -
Background boolWhether to run the model response in the background. Learn more.
-
CompletedAt float64Unix timestamp (in seconds) of when this Response was completed. Only present when the status is
completed. -
Conversation ResponseConversationThe conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
-
ID stringThe unique ID of the conversation that this response was associated with.
-
-
MaxOutputTokens int64An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
MaxToolCalls int64The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored.
-
Moderation ResponseModerationModeration results for the response input and output, if moderated completions were requested.
-
Input ResponseModerationInputUnionModeration for the response input.
-
type ResponseModerationInputModerationResult struct{…}A moderation result produced for the response input or output.
-
Categories map[string, bool]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
CategoryAppliedInputTypes map[string, []string]Which modalities of input are reflected by the score for each category.
-
const ResponseModerationInputModerationResultCategoryAppliedInputTypeText ResponseModerationInputModerationResultCategoryAppliedInputType = "text" -
const ResponseModerationInputModerationResultCategoryAppliedInputTypeImage ResponseModerationInputModerationResultCategoryAppliedInputType = "image"
-
-
CategoryScores map[string, float64]A dictionary of moderation categories to scores.
-
Flagged boolA boolean indicating whether the content was flagged by any category.
-
Model stringThe moderation model that produced this result.
-
Type ModerationResultThe object type, which was always
moderation_resultfor successful moderation results.const ModerationResultModerationResult ModerationResult = "moderation_result"
-
-
type ResponseModerationInputError struct{…}An error produced while attempting moderation for the response input or output.
-
Code stringThe error code.
-
Message stringThe error message.
-
Type ErrorThe object type, which was always
errorfor moderation failures.const ErrorError Error = "error"
-
-
-
Output ResponseModerationOutputUnionModeration for the response output.
-
type ResponseModerationOutputModerationResult struct{…}A moderation result produced for the response input or output.
-
Categories map[string, bool]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
CategoryAppliedInputTypes map[string, []string]Which modalities of input are reflected by the score for each category.
-
const ResponseModerationOutputModerationResultCategoryAppliedInputTypeText ResponseModerationOutputModerationResultCategoryAppliedInputType = "text" -
const ResponseModerationOutputModerationResultCategoryAppliedInputTypeImage ResponseModerationOutputModerationResultCategoryAppliedInputType = "image"
-
-
CategoryScores map[string, float64]A dictionary of moderation categories to scores.
-
Flagged boolA boolean indicating whether the content was flagged by any category.
-
Model stringThe moderation model that produced this result.
-
Type ModerationResultThe object type, which was always
moderation_resultfor successful moderation results.const ModerationResultModerationResult ModerationResult = "moderation_result"
-
-
type ResponseModerationOutputError struct{…}An error produced while attempting moderation for the response input or output.
-
Code stringThe error code.
-
Message stringThe error message.
-
Type ErrorThe object type, which was always
errorfor moderation failures.const ErrorError Error = "error"
-
-
-
-
PreviousResponseID stringThe unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about conversation state. Cannot be used in conjunction with
conversation. -
Prompt ResponsePromptReference to a prompt template and its variables. Learn more.
-
ID stringThe unique identifier of the prompt template to use.
-
Variables map[string, ResponsePromptVariableUnion]Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files.
-
string -
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
Version stringOptional version of the prompt template.
-
-
PromptCacheKey stringUsed by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more. -
PromptCacheRetention ResponsePromptCacheRetentionThe retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. Forgpt-5.5,gpt-5.5-pro, and future models, only24his supported.For older models that support both
in_memoryand24h, the default depends on your organization's data retention policy:-
Organizations without ZDR enabled default to
24h. -
Organizations with ZDR enabled default to
in_memorywhenprompt_cache_retentionis not specified. -
const ResponsePromptCacheRetentionInMemory ResponsePromptCacheRetention = "in_memory" -
const ResponsePromptCacheRetention24h ResponsePromptCacheRetention = "24h"
-
-
Reasoning Reasoninggpt-5 and o-series models only
Configuration options for reasoning models.
-
Context ReasoningContextControls which reasoning items are rendered back to the model on later turns. When returned on a response, this is the effective reasoning context mode used for the response.
-
const ReasoningContextAuto ReasoningContext = "auto" -
const ReasoningContextCurrentTurn ReasoningContext = "current_turn" -
const ReasoningContextAllTurns ReasoningContext = "all_turns"
-
-
Effort ReasoningEffortConstrains effort on reasoning for reasoning models. Currently supported values are
none,minimal,low,medium,high, andxhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.-
gpt-5.1defaults tonone, which does not perform reasoning. The supported reasoning values forgpt-5.1arenone,low,medium, andhigh. Tool calls are supported for all reasoning values in gpt-5.1. -
All models before
gpt-5.1default tomediumreasoning effort, and do not supportnone. -
The
gpt-5-promodel defaults to (and only supports)highreasoning effort. -
xhighis supported for all models aftergpt-5.1-codex-max. -
const ReasoningEffortNone ReasoningEffort = "none" -
const ReasoningEffortMinimal ReasoningEffort = "minimal" -
const ReasoningEffortLow ReasoningEffort = "low" -
const ReasoningEffortMedium ReasoningEffort = "medium" -
const ReasoningEffortHigh ReasoningEffort = "high" -
const ReasoningEffortXhigh ReasoningEffort = "xhigh"
-
-
GenerateSummary ReasoningGenerateSummaryDeprecated: use
summaryinstead.A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.-
const ReasoningGenerateSummaryAuto ReasoningGenerateSummary = "auto" -
const ReasoningGenerateSummaryConcise ReasoningGenerateSummary = "concise" -
const ReasoningGenerateSummaryDetailed ReasoningGenerateSummary = "detailed"
-
-
Summary ReasoningSummaryA summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.conciseis supported forcomputer-use-previewmodels and all reasoning models aftergpt-5.-
const ReasoningSummaryAuto ReasoningSummary = "auto" -
const ReasoningSummaryConcise ReasoningSummary = "concise" -
const ReasoningSummaryDetailed ReasoningSummary = "detailed"
-
-
-
SafetyIdentifier stringA stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
ServiceTier ResponseServiceTierSpecifies the processing type used for serving the request.
- If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'.
- If set to 'default', then the request will be processed with the standard pricing and performance for the selected model.
- If set to 'flex' or 'priority', then the request will be processed with the corresponding service tier.
- When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.-
const ResponseServiceTierAuto ResponseServiceTier = "auto" -
const ResponseServiceTierDefault ResponseServiceTier = "default" -
const ResponseServiceTierFlex ResponseServiceTier = "flex" -
const ResponseServiceTierScale ResponseServiceTier = "scale" -
const ResponseServiceTierPriority ResponseServiceTier = "priority"
-
Status ResponseStatusThe status of the response generation. One of
completed,failed,in_progress,cancelled,queued, orincomplete.-
const ResponseStatusCompleted ResponseStatus = "completed" -
const ResponseStatusFailed ResponseStatus = "failed" -
const ResponseStatusInProgress ResponseStatus = "in_progress" -
const ResponseStatusCancelled ResponseStatus = "cancelled" -
const ResponseStatusQueued ResponseStatus = "queued" -
const ResponseStatusIncomplete ResponseStatus = "incomplete"
-
-
Text ResponseTextConfigConfiguration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
Format ResponseFormatTextConfigUnionAn object specifying the format that the model must output.
Configuring
{ "type": "json_schema" }enables Structured Outputs, which ensures the model will match your supplied JSON schema. Learn more in the Structured Outputs guide.The default format is
{ "type": "text" }with no additional options.Not recommended for gpt-4o and newer models:
Setting to
{ "type": "json_object" }enables the older JSON mode, which ensures the message the model generates is valid JSON. Usingjson_schemais preferred for models that support it.-
type ResponseFormatText struct{…}Default response format. Used to generate text responses.
-
Type TextThe type of response format being defined. Always
text.const TextText Text = "text"
-
-
type ResponseFormatTextJSONSchemaConfig struct{…}JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
Name stringThe name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
-
Schema map[string, any]The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
-
Type JSONSchemaThe type of response format being defined. Always
json_schema.const JSONSchemaJSONSchema JSONSchema = "json_schema"
-
Description stringA description of what the response format is for, used by the model to determine how to respond in the format.
-
Strict boolWhether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the
schemafield. Only a subset of JSON Schema is supported whenstrictistrue. To learn more, read the Structured Outputs guide.
-
-
type ResponseFormatJSONObject struct{…}JSON object response format. An older method of generating JSON responses. Using
json_schemais 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 JSONObjectThe type of response format being defined. Always
json_object.const JSONObjectJSONObject JSONObject = "json_object"
-
-
-
Verbosity ResponseTextConfigVerbosityConstrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses. Currently supported values are
low,medium, andhigh.-
const ResponseTextConfigVerbosityLow ResponseTextConfigVerbosity = "low" -
const ResponseTextConfigVerbosityMedium ResponseTextConfigVerbosity = "medium" -
const ResponseTextConfigVerbosityHigh ResponseTextConfigVerbosity = "high"
-
-
TopLogprobs int64An integer between 0 and 20 specifying the maximum number of most likely tokens to return at each token position, each with an associated log probability. In some cases, the number of returned tokens may be fewer than requested.
-
Truncation ResponseTruncationThe truncation strategy to use for the model response.
-
auto: If the input to this Response exceeds the model's context window size, the model will truncate the response to fit the context window by dropping items from the beginning of the conversation. -
disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error. -
const ResponseTruncationAuto ResponseTruncation = "auto" -
const ResponseTruncationDisabled ResponseTruncation = "disabled"
-
-
Usage ResponseUsageRepresents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
-
InputTokens int64The number of input tokens.
-
InputTokensDetails ResponseUsageInputTokensDetailsA detailed breakdown of the input tokens.
-
CachedTokens int64The number of tokens that were retrieved from the cache. More on prompt caching.
-
-
OutputTokens int64The number of output tokens.
-
OutputTokensDetails ResponseUsageOutputTokensDetailsA detailed breakdown of the output tokens.
-
ReasoningTokens int64The number of reasoning tokens.
-
-
TotalTokens int64The total number of tokens used.
-
-
User stringThis field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead to maintain caching optimizations. A stable identifier for your end-users. Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. Learn more.
-
-
SequenceNumber int64The sequence number for this event.
-
Type ResponseCreatedThe type of the event. Always
response.created.const ResponseCreatedResponseCreated ResponseCreated = "response.created"
-
Response Custom Tool Call
-
type ResponseCustomToolCall struct{…}A call to a custom tool created by the model.
-
CallID stringAn identifier used to map this custom tool call to a tool call output.
-
Input stringThe input for the custom tool call generated by the model.
-
Name stringThe name of the custom tool being called.
-
Type CustomToolCallThe type of the custom tool call. Always
custom_tool_call.const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"
-
ID stringThe unique ID of the custom tool call in the OpenAI platform.
-
Namespace stringThe namespace of the custom tool being called.
-
Response Custom Tool Call Input Delta Event
-
type ResponseCustomToolCallInputDeltaEvent struct{…}Event representing a delta (partial update) to the input of a custom tool call.
-
Delta stringThe incremental input data (delta) for the custom tool call.
-
ItemID stringUnique identifier for the API item associated with this event.
-
OutputIndex int64The index of the output this delta applies to.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseCustomToolCallInputDeltaThe event type identifier.
const ResponseCustomToolCallInputDeltaResponseCustomToolCallInputDelta ResponseCustomToolCallInputDelta = "response.custom_tool_call_input.delta"
-
Response Custom Tool Call Input Done Event
-
type ResponseCustomToolCallInputDoneEvent struct{…}Event indicating that input for a custom tool call is complete.
-
Input stringThe complete input data for the custom tool call.
-
ItemID stringUnique identifier for the API item associated with this event.
-
OutputIndex int64The index of the output this event applies to.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseCustomToolCallInputDoneThe event type identifier.
const ResponseCustomToolCallInputDoneResponseCustomToolCallInputDone ResponseCustomToolCallInputDone = "response.custom_tool_call_input.done"
-
Response Custom Tool Call Item
-
type ResponseCustomToolCallItem struct{…}A call to a custom tool created by the model.
-
ID stringThe unique ID of the custom tool call item.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseCustomToolCallItemStatusInProgress ResponseCustomToolCallItemStatus = "in_progress" -
const ResponseCustomToolCallItemStatusCompleted ResponseCustomToolCallItemStatus = "completed" -
const ResponseCustomToolCallItemStatusIncomplete ResponseCustomToolCallItemStatus = "incomplete"
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
Response Custom Tool Call Output
-
type ResponseCustomToolCallOutput struct{…}The output of a custom tool call from your code, being sent back to the model.
-
CallID stringThe call ID, used to map this custom tool call output to a custom tool call.
-
Output ResponseCustomToolCallOutputOutputUnionThe output from the custom tool call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseCustomToolCallOutputOutputOutputContentList []ResponseCustomToolCallOutputOutputOutputContentListItemUnionText, image, or file output of the custom tool call.
-
type ResponseInputText struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
Detail ResponseInputImageDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageDetailLow ResponseInputImageDetail = "low" -
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high" -
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto" -
const ResponseInputImageDetailOriginal ResponseInputImageDetail = "original"
-
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFile struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileDetailLow ResponseInputFileDetail = "low" -
const ResponseInputFileDetailHigh ResponseInputFileDetail = "high"
-
-
FileData stringThe content of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Type CustomToolCallOutputThe type of the custom tool call output. Always
custom_tool_call_output.const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"
-
ID stringThe unique ID of the custom tool call output in the OpenAI platform.
-
Response Custom Tool Call Output Item
-
type ResponseCustomToolCallOutputItem struct{…}The output of a custom tool call from your code, being sent back to the model.
-
ID stringThe unique ID of the custom tool call output item.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseCustomToolCallOutputItemStatusInProgress ResponseCustomToolCallOutputItemStatus = "in_progress" -
const ResponseCustomToolCallOutputItemStatusCompleted ResponseCustomToolCallOutputItemStatus = "completed" -
const ResponseCustomToolCallOutputItemStatusIncomplete ResponseCustomToolCallOutputItemStatus = "incomplete"
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
Response Error
-
type ResponseError struct{…}An error object returned when the model fails to generate a Response.
-
Code ResponseErrorCodeThe error code for the response.
-
const ResponseErrorCodeServerError ResponseErrorCode = "server_error" -
const ResponseErrorCodeRateLimitExceeded ResponseErrorCode = "rate_limit_exceeded" -
const ResponseErrorCodeInvalidPrompt ResponseErrorCode = "invalid_prompt" -
const ResponseErrorCodeVectorStoreTimeout ResponseErrorCode = "vector_store_timeout" -
const ResponseErrorCodeInvalidImage ResponseErrorCode = "invalid_image" -
const ResponseErrorCodeInvalidImageFormat ResponseErrorCode = "invalid_image_format" -
const ResponseErrorCodeInvalidBase64Image ResponseErrorCode = "invalid_base64_image" -
const ResponseErrorCodeInvalidImageURL ResponseErrorCode = "invalid_image_url" -
const ResponseErrorCodeImageTooLarge ResponseErrorCode = "image_too_large" -
const ResponseErrorCodeImageTooSmall ResponseErrorCode = "image_too_small" -
const ResponseErrorCodeImageParseError ResponseErrorCode = "image_parse_error" -
const ResponseErrorCodeImageContentPolicyViolation ResponseErrorCode = "image_content_policy_violation" -
const ResponseErrorCodeInvalidImageMode ResponseErrorCode = "invalid_image_mode" -
const ResponseErrorCodeImageFileTooLarge ResponseErrorCode = "image_file_too_large" -
const ResponseErrorCodeUnsupportedImageMediaType ResponseErrorCode = "unsupported_image_media_type" -
const ResponseErrorCodeEmptyImageFile ResponseErrorCode = "empty_image_file" -
const ResponseErrorCodeFailedToDownloadImage ResponseErrorCode = "failed_to_download_image" -
const ResponseErrorCodeImageFileNotFound ResponseErrorCode = "image_file_not_found"
-
-
Message stringA human-readable description of the error.
-
Response Error Event
-
type ResponseErrorEvent struct{…}Emitted when an error occurs.
-
Code stringThe error code.
-
Message stringThe error message.
-
Param stringThe error parameter.
-
SequenceNumber int64The sequence number of this event.
-
Type ErrorThe type of the event. Always
error.const ErrorError Error = "error"
-
Response Failed Event
-
type ResponseFailedEvent struct{…}An event that is emitted when a response fails.
-
Response ResponseThe response that failed.
-
ID stringUnique identifier for this Response.
-
CreatedAt float64Unix timestamp (in seconds) of when this Response was created.
-
Error ResponseErrorAn error object returned when the model fails to generate a Response.
-
Code ResponseErrorCodeThe error code for the response.
-
const ResponseErrorCodeServerError ResponseErrorCode = "server_error" -
const ResponseErrorCodeRateLimitExceeded ResponseErrorCode = "rate_limit_exceeded" -
const ResponseErrorCodeInvalidPrompt ResponseErrorCode = "invalid_prompt" -
const ResponseErrorCodeVectorStoreTimeout ResponseErrorCode = "vector_store_timeout" -
const ResponseErrorCodeInvalidImage ResponseErrorCode = "invalid_image" -
const ResponseErrorCodeInvalidImageFormat ResponseErrorCode = "invalid_image_format" -
const ResponseErrorCodeInvalidBase64Image ResponseErrorCode = "invalid_base64_image" -
const ResponseErrorCodeInvalidImageURL ResponseErrorCode = "invalid_image_url" -
const ResponseErrorCodeImageTooLarge ResponseErrorCode = "image_too_large" -
const ResponseErrorCodeImageTooSmall ResponseErrorCode = "image_too_small" -
const ResponseErrorCodeImageParseError ResponseErrorCode = "image_parse_error" -
const ResponseErrorCodeImageContentPolicyViolation ResponseErrorCode = "image_content_policy_violation" -
const ResponseErrorCodeInvalidImageMode ResponseErrorCode = "invalid_image_mode" -
const ResponseErrorCodeImageFileTooLarge ResponseErrorCode = "image_file_too_large" -
const ResponseErrorCodeUnsupportedImageMediaType ResponseErrorCode = "unsupported_image_media_type" -
const ResponseErrorCodeEmptyImageFile ResponseErrorCode = "empty_image_file" -
const ResponseErrorCodeFailedToDownloadImage ResponseErrorCode = "failed_to_download_image" -
const ResponseErrorCodeImageFileNotFound ResponseErrorCode = "image_file_not_found"
-
-
Message stringA human-readable description of the error.
-
-
IncompleteDetails ResponseIncompleteDetailsDetails about why the response is incomplete.
-
Reason stringThe reason why the response is incomplete.
-
const ResponseIncompleteDetailsReasonMaxOutputTokens ResponseIncompleteDetailsReason = "max_output_tokens" -
const ResponseIncompleteDetailsReasonContentFilter ResponseIncompleteDetailsReason = "content_filter"
-
-
-
Instructions ResponseInstructionsUnionA system (or developer) message inserted into the model's context.
When using along with
previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses.-
string -
type ResponseInstructionsInputItemList []ResponseInputItemUnionA list of one or many input items to the model, containing different content types.
-
type EasyInputMessage struct{…}A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.-
Content EasyInputMessageContentUnionText, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
-
string -
type ResponseInputMessageContentList []ResponseInputContentUnionA list of one or many input items to the model, containing different content types.
-
type ResponseInputText struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
Detail ResponseInputImageDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageDetailLow ResponseInputImageDetail = "low" -
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high" -
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto" -
const ResponseInputImageDetailOriginal ResponseInputImageDetail = "original"
-
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFile struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileDetailLow ResponseInputFileDetail = "low" -
const ResponseInputFileDetailHigh ResponseInputFileDetail = "high"
-
-
FileData stringThe content of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Role EasyInputMessageRoleThe role of the message input. One of
user,assistant,system, ordeveloper.-
const EasyInputMessageRoleUser EasyInputMessageRole = "user" -
const EasyInputMessageRoleAssistant EasyInputMessageRole = "assistant" -
const EasyInputMessageRoleSystem EasyInputMessageRole = "system" -
const EasyInputMessageRoleDeveloper EasyInputMessageRole = "developer"
-
-
Phase EasyInputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const EasyInputMessagePhaseCommentary EasyInputMessagePhase = "commentary" -
const EasyInputMessagePhaseFinalAnswer EasyInputMessagePhase = "final_answer"
-
-
Type EasyInputMessageTypeThe type of the message input. Always
message.const EasyInputMessageTypeMessage EasyInputMessageType = "message"
-
-
type ResponseInputItemMessage struct{…}A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole.-
Content ResponseInputMessageContentListA list of one or many input items to the model, containing different content types.
-
Role stringThe role of the message input. One of
user,system, ordeveloper.-
const ResponseInputItemMessageRoleUser ResponseInputItemMessageRole = "user" -
const ResponseInputItemMessageRoleSystem ResponseInputItemMessageRole = "system" -
const ResponseInputItemMessageRoleDeveloper ResponseInputItemMessageRole = "developer"
-
-
Status stringThe status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputItemMessageStatusInProgress ResponseInputItemMessageStatus = "in_progress" -
const ResponseInputItemMessageStatusCompleted ResponseInputItemMessageStatus = "completed" -
const ResponseInputItemMessageStatusIncomplete ResponseInputItemMessageStatus = "incomplete"
-
-
Type stringThe type of the message input. Always set to
message.const ResponseInputItemMessageTypeMessage ResponseInputItemMessageType = "message"
-
-
type ResponseOutputMessage struct{…}An output message from the model.
-
ID stringThe unique ID of the output message.
-
Content []ResponseOutputMessageContentUnionThe content of the output message.
-
type ResponseOutputText struct{…}A text output from the model.
-
Annotations []ResponseOutputTextAnnotationUnionThe annotations of the text output.
-
type ResponseOutputTextAnnotationFileCitation struct{…}A citation to a file.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the file cited.
-
Index int64The index of the file in the list of files.
-
Type FileCitationThe type of the file citation. Always
file_citation.const FileCitationFileCitation FileCitation = "file_citation"
-
-
type ResponseOutputTextAnnotationURLCitation struct{…}A citation for a web resource used to generate a model response.
-
EndIndex int64The index of the last character of the URL citation in the message.
-
StartIndex int64The index of the first character of the URL citation in the message.
-
Title stringThe title of the web resource.
-
Type URLCitationThe type of the URL citation. Always
url_citation.const URLCitationURLCitation URLCitation = "url_citation"
-
URL stringThe URL of the web resource.
-
-
type ResponseOutputTextAnnotationContainerFileCitation struct{…}A citation for a container file used to generate a model response.
-
ContainerID stringThe ID of the container file.
-
EndIndex int64The index of the last character of the container file citation in the message.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the container file cited.
-
StartIndex int64The index of the first character of the container file citation in the message.
-
Type ContainerFileCitationThe type of the container file citation. Always
container_file_citation.const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"
-
-
type ResponseOutputTextAnnotationFilePath struct{…}A path to a file.
-
FileID stringThe ID of the file.
-
Index int64The index of the file in the list of files.
-
Type FilePathThe type of the file path. Always
file_path.const FilePathFilePath FilePath = "file_path"
-
-
-
Text stringThe text output from the model.
-
Type OutputTextThe type of the output text. Always
output_text.const OutputTextOutputText OutputText = "output_text"
-
Logprobs []ResponseOutputTextLogprob-
Token string -
Bytes []int64 -
Logprob float64 -
TopLogprobs []ResponseOutputTextLogprobTopLogprob-
Token string -
Bytes []int64 -
Logprob float64
-
-
-
-
type ResponseOutputRefusal struct{…}A refusal from the model.
-
Refusal stringThe refusal explanation from the model.
-
Type RefusalThe type of the refusal. Always
refusal.const RefusalRefusal Refusal = "refusal"
-
-
-
Role AssistantThe role of the output message. Always
assistant.const AssistantAssistant Assistant = "assistant"
-
Status ResponseOutputMessageStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseOutputMessageStatusInProgress ResponseOutputMessageStatus = "in_progress" -
const ResponseOutputMessageStatusCompleted ResponseOutputMessageStatus = "completed" -
const ResponseOutputMessageStatusIncomplete ResponseOutputMessageStatus = "incomplete"
-
-
Type MessageThe type of the output message. Always
message.const MessageMessage Message = "message"
-
Phase ResponseOutputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const ResponseOutputMessagePhaseCommentary ResponseOutputMessagePhase = "commentary" -
const ResponseOutputMessagePhaseFinalAnswer ResponseOutputMessagePhase = "final_answer"
-
-
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
ID stringThe unique ID of the file search tool call.
-
Queries []stringThe queries used to search for files.
-
Status ResponseFileSearchToolCallStatusThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
const ResponseFileSearchToolCallStatusInProgress ResponseFileSearchToolCallStatus = "in_progress" -
const ResponseFileSearchToolCallStatusSearching ResponseFileSearchToolCallStatus = "searching" -
const ResponseFileSearchToolCallStatusCompleted ResponseFileSearchToolCallStatus = "completed" -
const ResponseFileSearchToolCallStatusIncomplete ResponseFileSearchToolCallStatus = "incomplete" -
const ResponseFileSearchToolCallStatusFailed ResponseFileSearchToolCallStatus = "failed"
-
-
Type FileSearchCallThe type of the file search tool call. Always
file_search_call.const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"
-
Results []ResponseFileSearchToolCallResultThe results of the file search tool call.
-
Attributes map[string, ResponseFileSearchToolCallResultAttributeUnion]Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.
-
string -
float64 -
bool
-
-
FileID stringThe unique ID of the file.
-
Filename stringThe name of the file.
-
Score float64The relevance score of the file - a value between 0 and 1.
-
Text stringThe text that was retrieved from the file.
-
-
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
ID stringThe unique ID of the computer call.
-
CallID stringAn identifier used when responding to the tool call with output.
-
PendingSafetyChecks []ResponseComputerToolCallPendingSafetyCheckThe pending safety checks for the computer call.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status ResponseComputerToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseComputerToolCallStatusInProgress ResponseComputerToolCallStatus = "in_progress" -
const ResponseComputerToolCallStatusCompleted ResponseComputerToolCallStatus = "completed" -
const ResponseComputerToolCallStatusIncomplete ResponseComputerToolCallStatus = "incomplete"
-
-
Type ResponseComputerToolCallTypeThe type of the computer call. Always
computer_call.const ResponseComputerToolCallTypeComputerCall ResponseComputerToolCallType = "computer_call"
-
Action ResponseComputerToolCallActionUnionA click action.
-
type ResponseComputerToolCallActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ResponseComputerToolCallActionClickButtonLeft ResponseComputerToolCallActionClickButton = "left" -
const ResponseComputerToolCallActionClickButtonRight ResponseComputerToolCallActionClickButton = "right" -
const ResponseComputerToolCallActionClickButtonWheel ResponseComputerToolCallActionClickButton = "wheel" -
const ResponseComputerToolCallActionClickButtonBack ResponseComputerToolCallActionClickButton = "back" -
const ResponseComputerToolCallActionClickButtonForward ResponseComputerToolCallActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ResponseComputerToolCallActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ResponseComputerToolCallActionDrag struct{…}A drag action.
-
Path []ResponseComputerToolCallActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ResponseComputerToolCallActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ResponseComputerToolCallActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ResponseComputerToolCallActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ResponseComputerToolCallActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ResponseComputerToolCallActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ResponseComputerToolCallActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
Actions ComputerActionListFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
type ComputerActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ComputerActionClickButtonLeft ComputerActionClickButton = "left" -
const ComputerActionClickButtonRight ComputerActionClickButton = "right" -
const ComputerActionClickButtonWheel ComputerActionClickButton = "wheel" -
const ComputerActionClickButtonBack ComputerActionClickButton = "back" -
const ComputerActionClickButtonForward ComputerActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ComputerActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ComputerActionDrag struct{…}A drag action.
-
Path []ComputerActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ComputerActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ComputerActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ComputerActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ComputerActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ComputerActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ComputerActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
-
type ResponseInputItemComputerCallOutput struct{…}The output of a computer tool call.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Type ComputerScreenshotSpecifies the event type. For a computer screenshot, this property is always set to
computer_screenshot.const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"
-
FileID stringThe identifier of an uploaded file that contains the screenshot.
-
ImageURL stringThe URL of the screenshot image.
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
ID stringThe ID of the computer tool call output.
-
AcknowledgedSafetyChecks []ResponseInputItemComputerCallOutputAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status stringThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseInputItemComputerCallOutputStatusInProgress ResponseInputItemComputerCallOutputStatus = "in_progress" -
const ResponseInputItemComputerCallOutputStatusCompleted ResponseInputItemComputerCallOutputStatus = "completed" -
const ResponseInputItemComputerCallOutputStatusIncomplete ResponseInputItemComputerCallOutputStatus = "incomplete"
-
-
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
ID stringThe unique ID of the web search tool call.
-
Action ResponseFunctionWebSearchActionUnionAn object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
type ResponseFunctionWebSearchActionSearch struct{…}Action type "search" - Performs a web search query.
-
Type SearchThe action type.
const SearchSearch Search = "search"
-
Queries []stringThe search queries.
-
Query stringThe search query.
-
Sources []ResponseFunctionWebSearchActionSearchSourceThe sources used in the search.
-
Type URLThe type of source. Always
url.const URLURL URL = "url"
-
URL stringThe URL of the source.
-
-
-
type ResponseFunctionWebSearchActionOpenPage struct{…}Action type "open_page" - Opens a specific URL from search results.
-
Type OpenPageThe action type.
const OpenPageOpenPage OpenPage = "open_page"
-
URL stringThe URL opened by the model.
-
-
type ResponseFunctionWebSearchActionFindInPage struct{…}Action type "find_in_page": Searches for a pattern within a loaded page.
-
Pattern stringThe pattern or text to search for within the page.
-
Type FindInPageThe action type.
const FindInPageFindInPage FindInPage = "find_in_page"
-
URL stringThe URL of the page searched for the pattern.
-
-
-
Status ResponseFunctionWebSearchStatusThe status of the web search tool call.
-
const ResponseFunctionWebSearchStatusInProgress ResponseFunctionWebSearchStatus = "in_progress" -
const ResponseFunctionWebSearchStatusSearching ResponseFunctionWebSearchStatus = "searching" -
const ResponseFunctionWebSearchStatusCompleted ResponseFunctionWebSearchStatus = "completed" -
const ResponseFunctionWebSearchStatusFailed ResponseFunctionWebSearchStatus = "failed"
-
-
Type WebSearchCallThe type of the web search tool call. Always
web_search_call.const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"
-
-
type ResponseFunctionToolCall struct{…}A tool call to run a function. See the function calling guide for more information.
-
Arguments stringA JSON string of the arguments to pass to the function.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Name stringThe name of the function to run.
-
Type FunctionCallThe type of the function tool call. Always
function_call.const FunctionCallFunctionCall FunctionCall = "function_call"
-
ID stringThe unique ID of the function tool call.
-
Namespace stringThe namespace of the function to run.
-
Status ResponseFunctionToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallStatusInProgress ResponseFunctionToolCallStatus = "in_progress" -
const ResponseFunctionToolCallStatusCompleted ResponseFunctionToolCallStatus = "completed" -
const ResponseFunctionToolCallStatusIncomplete ResponseFunctionToolCallStatus = "incomplete"
-
-
-
type ResponseInputItemFunctionCallOutput struct{…}The output of a function tool call.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseInputItemFunctionCallOutputOutputUnionText, image, or file output of the function tool call.
-
string -
type ResponseFunctionCallOutputItemList []ResponseFunctionCallOutputItemUnionAn array of content outputs (text, image, file) for the function tool call.
-
type ResponseInputTextContent struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImageContent struct{…}An image input to the model. Learn about image inputs
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
Detail ResponseInputImageContentDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageContentDetailLow ResponseInputImageContentDetail = "low" -
const ResponseInputImageContentDetailHigh ResponseInputImageContentDetail = "high" -
const ResponseInputImageContentDetailAuto ResponseInputImageContentDetail = "auto" -
const ResponseInputImageContentDetailOriginal ResponseInputImageContentDetail = "original"
-
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFileContent struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileContentDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileContentDetailLow ResponseInputFileContentDetail = "low" -
const ResponseInputFileContentDetailHigh ResponseInputFileContentDetail = "high"
-
-
FileData stringThe base64-encoded data of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
ID stringThe unique ID of the function tool call output. Populated when this item is returned via API.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputItemFunctionCallOutputStatusInProgress ResponseInputItemFunctionCallOutputStatus = "in_progress" -
const ResponseInputItemFunctionCallOutputStatusCompleted ResponseInputItemFunctionCallOutputStatus = "completed" -
const ResponseInputItemFunctionCallOutputStatusIncomplete ResponseInputItemFunctionCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemToolSearchCall struct{…}-
Arguments anyThe arguments supplied to the tool search call.
-
Type ToolSearchCallThe item type. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
ID stringThe unique ID of this tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution stringWhether tool search was executed by the server or by the client.
-
const ResponseInputItemToolSearchCallExecutionServer ResponseInputItemToolSearchCallExecution = "server" -
const ResponseInputItemToolSearchCallExecutionClient ResponseInputItemToolSearchCallExecution = "client"
-
-
Status stringThe status of the tool search call.
-
const ResponseInputItemToolSearchCallStatusInProgress ResponseInputItemToolSearchCallStatus = "in_progress" -
const ResponseInputItemToolSearchCallStatusCompleted ResponseInputItemToolSearchCallStatus = "completed" -
const ResponseInputItemToolSearchCallStatusIncomplete ResponseInputItemToolSearchCallStatus = "incomplete"
-
-
-
type ResponseToolSearchOutputItemParamResp struct{…}-
Tools []ToolUnionThe loaded tool definitions returned by the tool search output.
-
type FunctionTool struct{…}Defines a function in your own code the model can choose to call. Learn more about function calling.
-
Name stringThe name of the function to call.
-
Parameters map[string, any]A JSON schema object describing the parameters of the function.
-
Strict boolWhether to enforce strict parameter validation. Default
true. -
Type FunctionThe type of the function tool. Always
function.const FunctionFunction Function = "function"
-
DeferLoading boolWhether this function is deferred and loaded via tool search.
-
Description stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
type FileSearchTool struct{…}A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
Type FileSearchThe type of the file search tool. Always
file_search.const FileSearchFileSearch FileSearch = "file_search"
-
VectorStoreIDs []stringThe IDs of the vector stores to search.
-
Filters FileSearchToolFiltersUnionA filter to apply.
-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
Key stringThe key to compare against the value.
-
Type ComparisonFilterTypeSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
const ComparisonFilterTypeEq ComparisonFilterType = "eq" -
const ComparisonFilterTypeNe ComparisonFilterType = "ne" -
const ComparisonFilterTypeGt ComparisonFilterType = "gt" -
const ComparisonFilterTypeGte ComparisonFilterType = "gte" -
const ComparisonFilterTypeLt ComparisonFilterType = "lt" -
const ComparisonFilterTypeLte ComparisonFilterType = "lte" -
const ComparisonFilterTypeIn ComparisonFilterType = "in" -
const ComparisonFilterTypeNin ComparisonFilterType = "nin"
-
-
Value ComparisonFilterValueUnionThe value to compare against the attribute key; supports string, number, or boolean types.
-
string -
float64 -
bool -
type ComparisonFilterValueArray []ComparisonFilterValueArrayItemUnion-
string -
float64
-
-
-
-
type CompoundFilter struct{…}Combine multiple filters using
andoror.-
Filters []ComparisonFilterArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
-
Type CompoundFilterTypeType of operation:
andoror.-
const CompoundFilterTypeAnd CompoundFilterType = "and" -
const CompoundFilterTypeOr CompoundFilterType = "or"
-
-
-
-
MaxNumResults int64The maximum number of results to return. This number should be between 1 and 50 inclusive.
-
RankingOptions FileSearchToolRankingOptionsRanking options for search.
-
HybridSearch FileSearchToolRankingOptionsHybridSearchWeights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
EmbeddingWeight float64The weight of the embedding in the reciprocal ranking fusion.
-
TextWeight float64The weight of the text in the reciprocal ranking fusion.
-
-
Ranker stringThe ranker to use for the file search.
-
const FileSearchToolRankingOptionsRankerAuto FileSearchToolRankingOptionsRanker = "auto" -
const FileSearchToolRankingOptionsRankerDefault2024_11_15 FileSearchToolRankingOptionsRanker = "default-2024-11-15"
-
-
ScoreThreshold float64The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
Type ComputerThe type of the computer tool. Always
computer.const ComputerComputer Computer = "computer"
-
-
type ComputerUsePreviewTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
DisplayHeight int64The height of the computer display.
-
DisplayWidth int64The width of the computer display.
-
Environment ComputerUsePreviewToolEnvironmentThe type of computer environment to control.
-
const ComputerUsePreviewToolEnvironmentWindows ComputerUsePreviewToolEnvironment = "windows" -
const ComputerUsePreviewToolEnvironmentMac ComputerUsePreviewToolEnvironment = "mac" -
const ComputerUsePreviewToolEnvironmentLinux ComputerUsePreviewToolEnvironment = "linux" -
const ComputerUsePreviewToolEnvironmentUbuntu ComputerUsePreviewToolEnvironment = "ubuntu" -
const ComputerUsePreviewToolEnvironmentBrowser ComputerUsePreviewToolEnvironment = "browser"
-
-
Type ComputerUsePreviewThe type of the computer use tool. Always
computer_use_preview.const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"
-
-
type WebSearchTool struct{…}Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
Type WebSearchToolTypeThe type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
const WebSearchToolTypeWebSearch WebSearchToolType = "web_search" -
const WebSearchToolTypeWebSearch2025_08_26 WebSearchToolType = "web_search_2025_08_26"
-
-
Filters WebSearchToolFiltersFilters for the search.
-
AllowedDomains []stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
SearchContextSize WebSearchToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchToolSearchContextSizeLow WebSearchToolSearchContextSize = "low" -
const WebSearchToolSearchContextSizeMedium WebSearchToolSearchContextSize = "medium" -
const WebSearchToolSearchContextSizeHigh WebSearchToolSearchContextSize = "high"
-
-
UserLocation WebSearchToolUserLocationThe approximate location of the user.
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
Type stringThe type of location approximation. Always
approximate.const WebSearchToolUserLocationTypeApproximate WebSearchToolUserLocationType = "approximate"
-
-
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
ServerLabel stringA label for this MCP server, used to identify it in tool calls.
-
Type McpThe type of the MCP tool. Always
mcp.const McpMcp Mcp = "mcp"
-
AllowedTools ToolMcpAllowedToolsUnionList of allowed tool names or a filter object.
-
type ToolMcpAllowedToolsMcpAllowedTools []stringA string array of allowed tool names
-
type ToolMcpAllowedToolsMcpToolFilter struct{…}A filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
Authorization stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
ConnectorID stringIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
const ToolMcpConnectorIDConnectorDropbox ToolMcpConnectorID = "connector_dropbox" -
const ToolMcpConnectorIDConnectorGmail ToolMcpConnectorID = "connector_gmail" -
const ToolMcpConnectorIDConnectorGooglecalendar ToolMcpConnectorID = "connector_googlecalendar" -
const ToolMcpConnectorIDConnectorGoogledrive ToolMcpConnectorID = "connector_googledrive" -
const ToolMcpConnectorIDConnectorMicrosoftteams ToolMcpConnectorID = "connector_microsoftteams" -
const ToolMcpConnectorIDConnectorOutlookcalendar ToolMcpConnectorID = "connector_outlookcalendar" -
const ToolMcpConnectorIDConnectorOutlookemail ToolMcpConnectorID = "connector_outlookemail" -
const ToolMcpConnectorIDConnectorSharepoint ToolMcpConnectorID = "connector_sharepoint"
-
-
DeferLoading boolWhether this MCP tool is deferred and discovered via tool search.
-
Headers map[string, string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
RequireApproval ToolMcpRequireApprovalUnionSpecify which of the MCP server's tools require approval.
-
type ToolMcpRequireApprovalMcpToolApprovalFilter 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.-
Always ToolMcpRequireApprovalMcpToolApprovalFilterAlwaysA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
Never ToolMcpRequireApprovalMcpToolApprovalFilterNeverA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
type ToolMcpRequireApprovalMcpToolApprovalSetting stringSpecify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
const ToolMcpRequireApprovalMcpToolApprovalSettingAlways ToolMcpRequireApprovalMcpToolApprovalSetting = "always" -
const ToolMcpRequireApprovalMcpToolApprovalSettingNever ToolMcpRequireApprovalMcpToolApprovalSetting = "never"
-
-
-
ServerDescription stringOptional description of the MCP server, used to provide more context.
-
ServerURL stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
TunnelID stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
Container ToolCodeInterpreterContainerUnionThe code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
string -
type ToolCodeInterpreterContainerCodeInterpreterContainerAuto struct{…}Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
Type AutoAlways
auto.const AutoAuto Auto = "auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit stringThe memory limit for the code interpreter container.
-
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"
-
-
NetworkPolicy ToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…}-
Type DisabledDisable outbound network access. Always
disabled.const DisabledDisabled Disabled = "disabled"
-
-
type ContainerNetworkPolicyAllowlist struct{…}-
AllowedDomains []stringA list of allowed domains when type is
allowlist. -
Type AllowlistAllow outbound network access only to specified domains. Always
allowlist.const AllowlistAllowlist Allowlist = "allowlist"
-
DomainSecrets []ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
Domain stringThe domain associated with the secret.
-
Name stringThe name of the secret to inject for the domain.
-
Value stringThe secret value to inject for the domain.
-
-
-
-
-
-
Type CodeInterpreterThe type of the code interpreter tool. Always
code_interpreter.const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"
-
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
Type ImageGenerationThe type of the image generation tool. Always
image_generation.const ImageGenerationImageGeneration ImageGeneration = "image_generation"
-
Action stringWhether to generate a new image or edit an existing image. Default:
auto.-
const ToolImageGenerationActionGenerate ToolImageGenerationAction = "generate" -
const ToolImageGenerationActionEdit ToolImageGenerationAction = "edit" -
const ToolImageGenerationActionAuto ToolImageGenerationAction = "auto"
-
-
Background stringAllows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
const ToolImageGenerationBackgroundTransparent ToolImageGenerationBackground = "transparent" -
const ToolImageGenerationBackgroundOpaque ToolImageGenerationBackground = "opaque" -
const ToolImageGenerationBackgroundAuto ToolImageGenerationBackground = "auto"
-
-
InputFidelity stringControl how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
const ToolImageGenerationInputFidelityHigh ToolImageGenerationInputFidelity = "high" -
const ToolImageGenerationInputFidelityLow ToolImageGenerationInputFidelity = "low"
-
-
InputImageMask ToolImageGenerationInputImageMaskOptional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
FileID stringFile ID for the mask image.
-
ImageURL stringBase64-encoded mask image.
-
-
Model stringThe image generation model to use. Default:
gpt-image-1.-
string -
string-
const ToolImageGenerationModelGPTImage1 ToolImageGenerationModel = "gpt-image-1" -
const ToolImageGenerationModelGPTImage1Mini ToolImageGenerationModel = "gpt-image-1-mini" -
const ToolImageGenerationModelGPTImage2 ToolImageGenerationModel = "gpt-image-2" -
const ToolImageGenerationModelGPTImage2_2026_04_21 ToolImageGenerationModel = "gpt-image-2-2026-04-21" -
const ToolImageGenerationModelGPTImage1_5 ToolImageGenerationModel = "gpt-image-1.5" -
const ToolImageGenerationModelChatgptImageLatest ToolImageGenerationModel = "chatgpt-image-latest"
-
-
-
Moderation stringModeration level for the generated image. Default:
auto.-
const ToolImageGenerationModerationAuto ToolImageGenerationModeration = "auto" -
const ToolImageGenerationModerationLow ToolImageGenerationModeration = "low"
-
-
OutputCompression int64Compression level for the output image. Default: 100.
-
OutputFormat stringThe output format of the generated image. One of
png,webp, orjpeg. Default:png.-
const ToolImageGenerationOutputFormatPNG ToolImageGenerationOutputFormat = "png" -
const ToolImageGenerationOutputFormatWebP ToolImageGenerationOutputFormat = "webp" -
const ToolImageGenerationOutputFormatJPEG ToolImageGenerationOutputFormat = "jpeg"
-
-
PartialImages int64Number of partial images to generate in streaming mode, from 0 (default value) to 3.
-
Quality stringThe quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
const ToolImageGenerationQualityLow ToolImageGenerationQuality = "low" -
const ToolImageGenerationQualityMedium ToolImageGenerationQuality = "medium" -
const ToolImageGenerationQualityHigh ToolImageGenerationQuality = "high" -
const ToolImageGenerationQualityAuto ToolImageGenerationQuality = "auto"
-
-
Size stringThe size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
string -
string-
const ToolImageGenerationSize1024x1024 ToolImageGenerationSize = "1024x1024" -
const ToolImageGenerationSize1024x1536 ToolImageGenerationSize = "1024x1536" -
const ToolImageGenerationSize1536x1024 ToolImageGenerationSize = "1536x1024" -
const ToolImageGenerationSizeAuto ToolImageGenerationSize = "auto"
-
-
-
-
type ToolLocalShell struct{…}A tool that allows the model to execute shell commands in a local environment.
-
Type LocalShellThe type of the local shell tool. Always
local_shell.const LocalShellLocalShell LocalShell = "local_shell"
-
-
type FunctionShellTool struct{…}A tool that allows the model to execute shell commands.
-
Type ShellThe type of the shell tool. Always
shell.const ShellShell Shell = "shell"
-
Environment FunctionShellToolEnvironmentUnion-
type ContainerAuto struct{…}-
Type ContainerAutoAutomatically creates a container for this request
const ContainerAutoContainerAuto ContainerAuto = "container_auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit ContainerAutoMemoryLimitThe memory limit for the container.
-
const ContainerAutoMemoryLimit1g ContainerAutoMemoryLimit = "1g" -
const ContainerAutoMemoryLimit4g ContainerAutoMemoryLimit = "4g" -
const ContainerAutoMemoryLimit16g ContainerAutoMemoryLimit = "16g" -
const ContainerAutoMemoryLimit64g ContainerAutoMemoryLimit = "64g"
-
-
NetworkPolicy ContainerAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…} -
type ContainerNetworkPolicyAllowlist struct{…}
-
-
Skills []ContainerAutoSkillUnionAn optional list of skills referenced by id or inline data.
-
type SkillReference struct{…}-
SkillID stringThe ID of the referenced skill.
-
Type SkillReferenceReferences a skill created with the /v1/skills endpoint.
const SkillReferenceSkillReference SkillReference = "skill_reference"
-
Version stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
type InlineSkill struct{…}-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Source InlineSkillSourceInline skill payload
-
Data stringBase64-encoded skill zip bundle.
-
MediaType ApplicationZipThe media type of the inline skill payload. Must be
application/zip.const ApplicationZipApplicationZip ApplicationZip = "application/zip"
-
Type Base64The type of the inline skill source. Must be
base64.const Base64Base64 Base64 = "base64"
-
-
Type InlineDefines an inline skill for this request.
const InlineInline Inline = "inline"
-
-
-
-
type LocalEnvironment struct{…}-
Type LocalUse a local computer environment.
const LocalLocal Local = "local"
-
Skills []LocalSkillAn optional list of skills.
-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Path stringThe path to the directory containing the skill.
-
-
-
type ContainerReference struct{…}-
ContainerID stringThe ID of the referenced container.
-
Type ContainerReferenceReferences a container created with the /v1/containers endpoint
const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
Name stringThe name of the custom tool, used to identify it in tool calls.
-
Type CustomThe type of the custom tool. Always
custom.const CustomCustom Custom = "custom"
-
DeferLoading boolWhether this tool should be deferred and discovered via tool search.
-
Description stringOptional description of the custom tool, used to provide more context.
-
Format CustomToolInputFormatUnionThe input format for the custom tool. Default is unconstrained text.
-
type CustomToolInputFormatText struct{…}Unconstrained free-form text.
-
Type TextUnconstrained text format. Always
text.const TextText Text = "text"
-
-
type CustomToolInputFormatGrammar struct{…}A grammar defined by the user.
-
Definition stringThe grammar definition.
-
Syntax stringThe syntax of the grammar definition. One of
larkorregex.-
const CustomToolInputFormatGrammarSyntaxLark CustomToolInputFormatGrammarSyntax = "lark" -
const CustomToolInputFormatGrammarSyntaxRegex CustomToolInputFormatGrammarSyntax = "regex"
-
-
Type GrammarGrammar format. Always
grammar.const GrammarGrammar Grammar = "grammar"
-
-
-
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
Description stringA description of the namespace shown to the model.
-
Name stringThe namespace name used in tool calls (for example,
crm). -
Tools []NamespaceToolToolUnionThe function/custom tools available inside this namespace.
-
type NamespaceToolToolFunction struct{…}-
Name string -
Type Functionconst FunctionFunction Function = "function"
-
DeferLoading boolWhether this function should be deferred and discovered via tool search.
-
Description string -
Parameters any -
Strict bool
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
-
Type NamespaceThe type of the tool. Always
namespace.const NamespaceNamespace Namespace = "namespace"
-
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
Type ToolSearchThe type of the tool. Always
tool_search.const ToolSearchToolSearch ToolSearch = "tool_search"
-
Description stringDescription shown to the model for a client-executed tool search tool.
-
Execution ToolSearchToolExecutionWhether tool search is executed by the server or by the client.
-
const ToolSearchToolExecutionServer ToolSearchToolExecution = "server" -
const ToolSearchToolExecutionClient ToolSearchToolExecution = "client"
-
-
Parameters anyParameter schema for a client-executed tool search tool.
-
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
Type WebSearchPreviewToolTypeThe type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
const WebSearchPreviewToolTypeWebSearchPreview WebSearchPreviewToolType = "web_search_preview" -
const WebSearchPreviewToolTypeWebSearchPreview2025_03_11 WebSearchPreviewToolType = "web_search_preview_2025_03_11"
-
-
SearchContentTypes []string-
const WebSearchPreviewToolSearchContentTypeText WebSearchPreviewToolSearchContentType = "text" -
const WebSearchPreviewToolSearchContentTypeImage WebSearchPreviewToolSearchContentType = "image"
-
-
SearchContextSize WebSearchPreviewToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchPreviewToolSearchContextSizeLow WebSearchPreviewToolSearchContextSize = "low" -
const WebSearchPreviewToolSearchContextSizeMedium WebSearchPreviewToolSearchContextSize = "medium" -
const WebSearchPreviewToolSearchContextSizeHigh WebSearchPreviewToolSearchContextSize = "high"
-
-
UserLocation WebSearchPreviewToolUserLocationThe user's location.
-
Type ApproximateThe type of location approximation. Always
approximate.const ApproximateApproximate Approximate = "approximate"
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
Type ApplyPatchThe type of the tool. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
-
Type ToolSearchOutputThe item type. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
ID stringThe unique ID of this tool search output.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemParamExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemParamExecutionServer ResponseToolSearchOutputItemParamExecution = "server" -
const ResponseToolSearchOutputItemParamExecutionClient ResponseToolSearchOutputItemParamExecution = "client"
-
-
Status ResponseToolSearchOutputItemParamStatusThe status of the tool search output.
-
const ResponseToolSearchOutputItemParamStatusInProgress ResponseToolSearchOutputItemParamStatus = "in_progress" -
const ResponseToolSearchOutputItemParamStatusCompleted ResponseToolSearchOutputItemParamStatus = "completed" -
const ResponseToolSearchOutputItemParamStatusIncomplete ResponseToolSearchOutputItemParamStatus = "incomplete"
-
-
-
type ResponseInputItemAdditionalTools struct{…}-
Role DeveloperThe role that provided the additional tools. Only
developeris supported.const DeveloperDeveloper Developer = "developer"
-
Tools []ToolUnionA list of additional tools made available at this item.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type AdditionalToolsThe item type. Always
additional_tools.const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"
-
ID stringThe unique ID of this additional tools item.
-
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
ID stringThe unique identifier of the reasoning content.
-
Summary []ResponseReasoningItemSummaryReasoning summary content.
-
Text stringA summary of the reasoning output from the model so far.
-
Type SummaryTextThe type of the object. Always
summary_text.const SummaryTextSummaryText SummaryText = "summary_text"
-
-
Type ReasoningThe type of the object. Always
reasoning.const ReasoningReasoning Reasoning = "reasoning"
-
Content []ResponseReasoningItemContentReasoning text content.
-
Text stringThe reasoning text from the model.
-
Type ReasoningTextThe type of the reasoning text. Always
reasoning_text.const ReasoningTextReasoningText ReasoningText = "reasoning_text"
-
-
EncryptedContent stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
Status ResponseReasoningItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseReasoningItemStatusInProgress ResponseReasoningItemStatus = "in_progress" -
const ResponseReasoningItemStatusCompleted ResponseReasoningItemStatus = "completed" -
const ResponseReasoningItemStatusIncomplete ResponseReasoningItemStatus = "incomplete"
-
-
-
type ResponseCompactionItemParamResp struct{…}A compaction item generated by the
v1/responses/compactAPI.-
EncryptedContent stringThe encrypted content of the compaction summary.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
ID stringThe ID of the compaction item.
-
-
type ResponseInputItemImageGenerationCall struct{…}An image generation request made by the model.
-
ID stringThe unique ID of the image generation call.
-
Result stringThe generated image encoded in base64.
-
Status stringThe status of the image generation call.
-
const ResponseInputItemImageGenerationCallStatusInProgress ResponseInputItemImageGenerationCallStatus = "in_progress" -
const ResponseInputItemImageGenerationCallStatusCompleted ResponseInputItemImageGenerationCallStatus = "completed" -
const ResponseInputItemImageGenerationCallStatusGenerating ResponseInputItemImageGenerationCallStatus = "generating" -
const ResponseInputItemImageGenerationCallStatusFailed ResponseInputItemImageGenerationCallStatus = "failed"
-
-
Type ImageGenerationCallThe type of the image generation call. Always
image_generation_call.const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"
-
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
ID stringThe unique ID of the code interpreter tool call.
-
Code stringThe code to run, or null if not available.
-
ContainerID stringThe ID of the container used to run the code.
-
Outputs []ResponseCodeInterpreterToolCallOutputUnionThe outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
type ResponseCodeInterpreterToolCallOutputLogs struct{…}The logs output from the code interpreter.
-
Logs stringThe logs output from the code interpreter.
-
Type LogsThe type of the output. Always
logs.const LogsLogs Logs = "logs"
-
-
type ResponseCodeInterpreterToolCallOutputImage struct{…}The image output from the code interpreter.
-
Type ImageThe type of the output. Always
image.const ImageImage Image = "image"
-
URL stringThe URL of the image output from the code interpreter.
-
-
-
Status ResponseCodeInterpreterToolCallStatusThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
const ResponseCodeInterpreterToolCallStatusInProgress ResponseCodeInterpreterToolCallStatus = "in_progress" -
const ResponseCodeInterpreterToolCallStatusCompleted ResponseCodeInterpreterToolCallStatus = "completed" -
const ResponseCodeInterpreterToolCallStatusIncomplete ResponseCodeInterpreterToolCallStatus = "incomplete" -
const ResponseCodeInterpreterToolCallStatusInterpreting ResponseCodeInterpreterToolCallStatus = "interpreting" -
const ResponseCodeInterpreterToolCallStatusFailed ResponseCodeInterpreterToolCallStatus = "failed"
-
-
Type CodeInterpreterCallThe type of the code interpreter tool call. Always
code_interpreter_call.const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"
-
-
type ResponseInputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
ID stringThe unique ID of the local shell call.
-
Action ResponseInputItemLocalShellCallActionExecute a shell command on the server.
-
Command []stringThe command to run.
-
Env map[string, string]Environment variables to set for the command.
-
Type ExecThe type of the local shell action. Always
exec.const ExecExec Exec = "exec"
-
TimeoutMs int64Optional timeout in milliseconds for the command.
-
User stringOptional user to run the command as.
-
WorkingDirectory stringOptional working directory to run the command in.
-
-
CallID stringThe unique ID of the local shell tool call generated by the model.
-
Status stringThe status of the local shell call.
-
const ResponseInputItemLocalShellCallStatusInProgress ResponseInputItemLocalShellCallStatus = "in_progress" -
const ResponseInputItemLocalShellCallStatusCompleted ResponseInputItemLocalShellCallStatus = "completed" -
const ResponseInputItemLocalShellCallStatusIncomplete ResponseInputItemLocalShellCallStatus = "incomplete"
-
-
Type LocalShellCallThe type of the local shell call. Always
local_shell_call.const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"
-
-
type ResponseInputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
ID stringThe unique ID of the local shell tool call generated by the model.
-
Output stringA JSON string of the output of the local shell tool call.
-
Type LocalShellCallOutputThe type of the local shell tool call output. Always
local_shell_call_output.const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete.-
const ResponseInputItemLocalShellCallOutputStatusInProgress ResponseInputItemLocalShellCallOutputStatus = "in_progress" -
const ResponseInputItemLocalShellCallOutputStatusCompleted ResponseInputItemLocalShellCallOutputStatus = "completed" -
const ResponseInputItemLocalShellCallOutputStatusIncomplete ResponseInputItemLocalShellCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemShellCall struct{…}A tool representing a request to execute one or more shell commands.
-
Action ResponseInputItemShellCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []stringOrdered shell commands for the execution environment to run.
-
MaxOutputLength int64Maximum number of UTF-8 characters to capture from combined stdout and stderr output.
-
TimeoutMs int64Maximum wall-clock time in milliseconds to allow the shell commands to run.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Environment ResponseInputItemShellCallEnvironmentUnionThe environment to execute the shell commands in.
-
type LocalEnvironment struct{…} -
type ContainerReference struct{…}
-
-
Status stringThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseInputItemShellCallStatusInProgress ResponseInputItemShellCallStatus = "in_progress" -
const ResponseInputItemShellCallStatusCompleted ResponseInputItemShellCallStatus = "completed" -
const ResponseInputItemShellCallStatusIncomplete ResponseInputItemShellCallStatus = "incomplete"
-
-
-
type ResponseInputItemShellCallOutput struct{…}The streamed output items emitted by a shell tool call.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Output []ResponseFunctionShellCallOutputContentCaptured chunks of stdout and stderr output, along with their associated outcomes.
-
Outcome ResponseFunctionShellCallOutputContentOutcomeUnionThe exit or timeout outcome associated with this shell call.
-
type ResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellCallOutputContentOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64The exit code returned by the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringCaptured stderr output for the shell call.
-
Stdout stringCaptured stdout output for the shell call.
-
-
Type ShellCallOutputThe type of the item. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
ID stringThe unique ID of the shell tool call output. Populated when this item is returned via API.
-
MaxOutputLength int64The maximum number of UTF-8 characters captured for this shell call's combined output.
-
Status stringThe status of the shell call output.
-
const ResponseInputItemShellCallOutputStatusInProgress ResponseInputItemShellCallOutputStatus = "in_progress" -
const ResponseInputItemShellCallOutputStatusCompleted ResponseInputItemShellCallOutputStatus = "completed" -
const ResponseInputItemShellCallOutputStatusIncomplete ResponseInputItemShellCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemApplyPatchCall struct{…}A tool call representing a request to create, delete, or update files using diff patches.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseInputItemApplyPatchCallOperationUnionThe specific create, delete, or update instruction for the apply_patch tool call.
-
type ResponseInputItemApplyPatchCallOperationCreateFile struct{…}Instruction for creating a new file via the apply_patch tool.
-
Diff stringUnified diff content to apply when creating the file.
-
Path stringPath of the file to create relative to the workspace root.
-
Type CreateFileThe operation type. Always
create_file.const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseInputItemApplyPatchCallOperationDeleteFile struct{…}Instruction for deleting an existing file via the apply_patch tool.
-
Path stringPath of the file to delete relative to the workspace root.
-
Type DeleteFileThe operation type. Always
delete_file.const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseInputItemApplyPatchCallOperationUpdateFile struct{…}Instruction for updating an existing file via the apply_patch tool.
-
Diff stringUnified diff content to apply to the existing file.
-
Path stringPath of the file to update relative to the workspace root.
-
Type UpdateFileThe operation type. Always
update_file.const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status stringThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseInputItemApplyPatchCallStatusInProgress ResponseInputItemApplyPatchCallStatus = "in_progress" -
const ResponseInputItemApplyPatchCallStatusCompleted ResponseInputItemApplyPatchCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
-
type ResponseInputItemApplyPatchCallOutput struct{…}The streamed output emitted by an apply patch tool call.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status stringThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseInputItemApplyPatchCallOutputStatusCompleted ResponseInputItemApplyPatchCallOutputStatus = "completed" -
const ResponseInputItemApplyPatchCallOutputStatusFailed ResponseInputItemApplyPatchCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
Output stringOptional human-readable log text from the apply patch tool (e.g., patch results or errors).
-
-
type ResponseInputItemMcpListTools struct{…}A list of tools available on an MCP server.
-
ID stringThe unique ID of the list.
-
ServerLabel stringThe label of the MCP server.
-
Tools []ResponseInputItemMcpListToolsToolThe tools available on the server.
-
InputSchema anyThe JSON schema describing the tool's input.
-
Name stringThe name of the tool.
-
Annotations anyAdditional annotations about the tool.
-
Description stringThe description of the tool.
-
-
Type McpListToolsThe type of the item. Always
mcp_list_tools.const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
-
Error stringError message if the server could not list tools.
-
-
type ResponseInputItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
ID stringThe unique ID of the approval request.
-
Arguments stringA JSON string of arguments for the tool.
-
Name stringThe name of the tool to run.
-
ServerLabel stringThe label of the MCP server making the request.
-
Type McpApprovalRequestThe type of the item. Always
mcp_approval_request.const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"
-
-
type ResponseInputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
ApprovalRequestID stringThe ID of the approval request being answered.
-
Approve boolWhether the request was approved.
-
Type McpApprovalResponseThe type of the item. Always
mcp_approval_response.const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
-
ID stringThe unique ID of the approval response
-
Reason stringOptional reason for the decision.
-
-
type ResponseInputItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
ID stringThe unique ID of the tool call.
-
Arguments stringA JSON string of the arguments passed to the tool.
-
Name stringThe name of the tool that was run.
-
ServerLabel stringThe label of the MCP server running the tool.
-
Type McpCallThe type of the item. Always
mcp_call.const McpCallMcpCall McpCall = "mcp_call"
-
ApprovalRequestID stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
Error stringThe error from the tool call, if any.
-
Output stringThe output from the tool call.
-
Status stringThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
const ResponseInputItemMcpCallStatusInProgress ResponseInputItemMcpCallStatus = "in_progress" -
const ResponseInputItemMcpCallStatusCompleted ResponseInputItemMcpCallStatus = "completed" -
const ResponseInputItemMcpCallStatusIncomplete ResponseInputItemMcpCallStatus = "incomplete" -
const ResponseInputItemMcpCallStatusCalling ResponseInputItemMcpCallStatus = "calling" -
const ResponseInputItemMcpCallStatusFailed ResponseInputItemMcpCallStatus = "failed"
-
-
-
type ResponseCustomToolCallOutput struct{…}The output of a custom tool call from your code, being sent back to the model.
-
CallID stringThe call ID, used to map this custom tool call output to a custom tool call.
-
Output ResponseCustomToolCallOutputOutputUnionThe output from the custom tool call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseCustomToolCallOutputOutputOutputContentList []ResponseCustomToolCallOutputOutputOutputContentListItemUnionText, image, or file output of the custom tool call.
-
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
-
Type CustomToolCallOutputThe type of the custom tool call output. Always
custom_tool_call_output.const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"
-
ID stringThe unique ID of the custom tool call output in the OpenAI platform.
-
-
type ResponseCustomToolCall struct{…}A call to a custom tool created by the model.
-
CallID stringAn identifier used to map this custom tool call to a tool call output.
-
Input stringThe input for the custom tool call generated by the model.
-
Name stringThe name of the custom tool being called.
-
Type CustomToolCallThe type of the custom tool call. Always
custom_tool_call.const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"
-
ID stringThe unique ID of the custom tool call in the OpenAI platform.
-
Namespace stringThe namespace of the custom tool being called.
-
-
type ResponseInputItemCompactionTrigger struct{…}Compacts the current context. Must be the final input item.
-
Type CompactionTriggerThe type of the item. Always
compaction_trigger.const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"
-
-
type ResponseInputItemItemReference struct{…}An internal identifier for an item to reference.
-
ID stringThe ID of the item to reference.
-
Type stringThe type of item to reference. Always
item_reference.const ResponseInputItemItemReferenceTypeItemReference ResponseInputItemItemReferenceType = "item_reference"
-
-
-
-
Metadata MetadataSet of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
-
Model ResponsesModelModel ID used to generate the response, like
gpt-4ooro3. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models.-
string -
type ChatModel string-
const ChatModelGPT5_4 ChatModel = "gpt-5.4" -
const ChatModelGPT5_4Mini ChatModel = "gpt-5.4-mini" -
const ChatModelGPT5_4Nano ChatModel = "gpt-5.4-nano" -
const ChatModelGPT5_4Mini2026_03_17 ChatModel = "gpt-5.4-mini-2026-03-17" -
const ChatModelGPT5_4Nano2026_03_17 ChatModel = "gpt-5.4-nano-2026-03-17" -
const ChatModelGPT5_3ChatLatest ChatModel = "gpt-5.3-chat-latest" -
const ChatModelGPT5_2 ChatModel = "gpt-5.2" -
const ChatModelGPT5_2_2025_12_11 ChatModel = "gpt-5.2-2025-12-11" -
const ChatModelGPT5_2ChatLatest ChatModel = "gpt-5.2-chat-latest" -
const ChatModelGPT5_2Pro ChatModel = "gpt-5.2-pro" -
const ChatModelGPT5_2Pro2025_12_11 ChatModel = "gpt-5.2-pro-2025-12-11" -
const ChatModelGPT5_1 ChatModel = "gpt-5.1" -
const ChatModelGPT5_1_2025_11_13 ChatModel = "gpt-5.1-2025-11-13" -
const ChatModelGPT5_1Codex ChatModel = "gpt-5.1-codex" -
const ChatModelGPT5_1Mini ChatModel = "gpt-5.1-mini" -
const ChatModelGPT5_1ChatLatest ChatModel = "gpt-5.1-chat-latest" -
const ChatModelGPT5 ChatModel = "gpt-5" -
const ChatModelGPT5Mini ChatModel = "gpt-5-mini" -
const ChatModelGPT5Nano ChatModel = "gpt-5-nano" -
const ChatModelGPT5_2025_08_07 ChatModel = "gpt-5-2025-08-07" -
const ChatModelGPT5Mini2025_08_07 ChatModel = "gpt-5-mini-2025-08-07" -
const ChatModelGPT5Nano2025_08_07 ChatModel = "gpt-5-nano-2025-08-07" -
const ChatModelGPT5ChatLatest ChatModel = "gpt-5-chat-latest" -
const ChatModelGPT4_1 ChatModel = "gpt-4.1" -
const ChatModelGPT4_1Mini ChatModel = "gpt-4.1-mini" -
const ChatModelGPT4_1Nano ChatModel = "gpt-4.1-nano" -
const ChatModelGPT4_1_2025_04_14 ChatModel = "gpt-4.1-2025-04-14" -
const ChatModelGPT4_1Mini2025_04_14 ChatModel = "gpt-4.1-mini-2025-04-14" -
const ChatModelGPT4_1Nano2025_04_14 ChatModel = "gpt-4.1-nano-2025-04-14" -
const ChatModelO4Mini ChatModel = "o4-mini" -
const ChatModelO4Mini2025_04_16 ChatModel = "o4-mini-2025-04-16" -
const ChatModelO3 ChatModel = "o3" -
const ChatModelO3_2025_04_16 ChatModel = "o3-2025-04-16" -
const ChatModelO3Mini ChatModel = "o3-mini" -
const ChatModelO3Mini2025_01_31 ChatModel = "o3-mini-2025-01-31" -
const ChatModelO1 ChatModel = "o1" -
const ChatModelO1_2024_12_17 ChatModel = "o1-2024-12-17" -
const ChatModelO1Preview ChatModel = "o1-preview" -
const ChatModelO1Preview2024_09_12 ChatModel = "o1-preview-2024-09-12" -
const ChatModelO1Mini ChatModel = "o1-mini" -
const ChatModelO1Mini2024_09_12 ChatModel = "o1-mini-2024-09-12" -
const ChatModelGPT4o ChatModel = "gpt-4o" -
const ChatModelGPT4o2024_11_20 ChatModel = "gpt-4o-2024-11-20" -
const ChatModelGPT4o2024_08_06 ChatModel = "gpt-4o-2024-08-06" -
const ChatModelGPT4o2024_05_13 ChatModel = "gpt-4o-2024-05-13" -
const ChatModelGPT4oAudioPreview ChatModel = "gpt-4o-audio-preview" -
const ChatModelGPT4oAudioPreview2024_10_01 ChatModel = "gpt-4o-audio-preview-2024-10-01" -
const ChatModelGPT4oAudioPreview2024_12_17 ChatModel = "gpt-4o-audio-preview-2024-12-17" -
const ChatModelGPT4oAudioPreview2025_06_03 ChatModel = "gpt-4o-audio-preview-2025-06-03" -
const ChatModelGPT4oMiniAudioPreview ChatModel = "gpt-4o-mini-audio-preview" -
const ChatModelGPT4oMiniAudioPreview2024_12_17 ChatModel = "gpt-4o-mini-audio-preview-2024-12-17" -
const ChatModelGPT4oSearchPreview ChatModel = "gpt-4o-search-preview" -
const ChatModelGPT4oMiniSearchPreview ChatModel = "gpt-4o-mini-search-preview" -
const ChatModelGPT4oSearchPreview2025_03_11 ChatModel = "gpt-4o-search-preview-2025-03-11" -
const ChatModelGPT4oMiniSearchPreview2025_03_11 ChatModel = "gpt-4o-mini-search-preview-2025-03-11" -
const ChatModelChatgpt4oLatest ChatModel = "chatgpt-4o-latest" -
const ChatModelCodexMiniLatest ChatModel = "codex-mini-latest" -
const ChatModelGPT4oMini ChatModel = "gpt-4o-mini" -
const ChatModelGPT4oMini2024_07_18 ChatModel = "gpt-4o-mini-2024-07-18" -
const ChatModelGPT4Turbo ChatModel = "gpt-4-turbo" -
const ChatModelGPT4Turbo2024_04_09 ChatModel = "gpt-4-turbo-2024-04-09" -
const ChatModelGPT4_0125Preview ChatModel = "gpt-4-0125-preview" -
const ChatModelGPT4TurboPreview ChatModel = "gpt-4-turbo-preview" -
const ChatModelGPT4_1106Preview ChatModel = "gpt-4-1106-preview" -
const ChatModelGPT4VisionPreview ChatModel = "gpt-4-vision-preview" -
const ChatModelGPT4 ChatModel = "gpt-4" -
const ChatModelGPT4_0314 ChatModel = "gpt-4-0314" -
const ChatModelGPT4_0613 ChatModel = "gpt-4-0613" -
const ChatModelGPT4_32k ChatModel = "gpt-4-32k" -
const ChatModelGPT4_32k0314 ChatModel = "gpt-4-32k-0314" -
const ChatModelGPT4_32k0613 ChatModel = "gpt-4-32k-0613" -
const ChatModelGPT3_5Turbo ChatModel = "gpt-3.5-turbo" -
const ChatModelGPT3_5Turbo16k ChatModel = "gpt-3.5-turbo-16k" -
const ChatModelGPT3_5Turbo0301 ChatModel = "gpt-3.5-turbo-0301" -
const ChatModelGPT3_5Turbo0613 ChatModel = "gpt-3.5-turbo-0613" -
const ChatModelGPT3_5Turbo1106 ChatModel = "gpt-3.5-turbo-1106" -
const ChatModelGPT3_5Turbo0125 ChatModel = "gpt-3.5-turbo-0125" -
const ChatModelGPT3_5Turbo16k0613 ChatModel = "gpt-3.5-turbo-16k-0613"
-
-
type ResponsesModel string-
const ResponsesModelO1Pro ResponsesModel = "o1-pro" -
const ResponsesModelO1Pro2025_03_19 ResponsesModel = "o1-pro-2025-03-19" -
const ResponsesModelO3Pro ResponsesModel = "o3-pro" -
const ResponsesModelO3Pro2025_06_10 ResponsesModel = "o3-pro-2025-06-10" -
const ResponsesModelO3DeepResearch ResponsesModel = "o3-deep-research" -
const ResponsesModelO3DeepResearch2025_06_26 ResponsesModel = "o3-deep-research-2025-06-26" -
const ResponsesModelO4MiniDeepResearch ResponsesModel = "o4-mini-deep-research" -
const ResponsesModelO4MiniDeepResearch2025_06_26 ResponsesModel = "o4-mini-deep-research-2025-06-26" -
const ResponsesModelComputerUsePreview ResponsesModel = "computer-use-preview" -
const ResponsesModelComputerUsePreview2025_03_11 ResponsesModel = "computer-use-preview-2025-03-11" -
const ResponsesModelGPT5Codex ResponsesModel = "gpt-5-codex" -
const ResponsesModelGPT5Pro ResponsesModel = "gpt-5-pro" -
const ResponsesModelGPT5Pro2025_10_06 ResponsesModel = "gpt-5-pro-2025-10-06" -
const ResponsesModelGPT5_1CodexMax ResponsesModel = "gpt-5.1-codex-max"
-
-
-
Object ResponseThe object type of this resource - always set to
response.const ResponseResponse Response = "response"
-
Output []ResponseOutputItemUnionAn array of content items generated by the model.
-
The length and order of items in the
outputarray is dependent on the model's response. -
Rather than accessing the first item in the
outputarray and assuming it's anassistantmessage with the content generated by the model, you might consider using theoutput_textproperty where supported in SDKs. -
type ResponseOutputMessage struct{…}An output message from the model.
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
type ResponseFunctionToolCall struct{…}A tool call to run a function. See the function calling guide for more information.
-
type ResponseFunctionToolCallOutputItem struct{…}-
ID stringThe unique ID of the function call tool output.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseFunctionToolCallOutputItemOutputUnionThe output from the function call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseFunctionToolCallOutputItemOutputOutputContentList []ResponseFunctionToolCallOutputItemOutputOutputContentListItemUnionText, image, or file output of the function call.
-
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
-
Status ResponseFunctionToolCallOutputItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallOutputItemStatusInProgress ResponseFunctionToolCallOutputItemStatus = "in_progress" -
const ResponseFunctionToolCallOutputItemStatusCompleted ResponseFunctionToolCallOutputItemStatus = "completed" -
const ResponseFunctionToolCallOutputItemStatusIncomplete ResponseFunctionToolCallOutputItemStatus = "incomplete"
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
type ResponseComputerToolCallOutputItem struct{…}-
ID stringThe unique ID of the computer call tool output.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Status ResponseComputerToolCallOutputItemStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseComputerToolCallOutputItemStatusCompleted ResponseComputerToolCallOutputItemStatus = "completed" -
const ResponseComputerToolCallOutputItemStatusIncomplete ResponseComputerToolCallOutputItemStatus = "incomplete" -
const ResponseComputerToolCallOutputItemStatusFailed ResponseComputerToolCallOutputItemStatus = "failed" -
const ResponseComputerToolCallOutputItemStatusInProgress ResponseComputerToolCallOutputItemStatus = "in_progress"
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
AcknowledgedSafetyChecks []ResponseComputerToolCallOutputItemAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context. -
type ResponseToolSearchCall struct{…}-
ID stringThe unique ID of the tool search call item.
-
Arguments anyArguments used for the tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchCallExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchCallExecutionServer ResponseToolSearchCallExecution = "server" -
const ResponseToolSearchCallExecutionClient ResponseToolSearchCallExecution = "client"
-
-
Status ResponseToolSearchCallStatusThe status of the tool search call item that was recorded.
-
const ResponseToolSearchCallStatusInProgress ResponseToolSearchCallStatus = "in_progress" -
const ResponseToolSearchCallStatusCompleted ResponseToolSearchCallStatus = "completed" -
const ResponseToolSearchCallStatusIncomplete ResponseToolSearchCallStatus = "incomplete"
-
-
Type ToolSearchCallThe type of the item. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseToolSearchOutputItem struct{…}-
ID stringThe unique ID of the tool search output item.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemExecutionServer ResponseToolSearchOutputItemExecution = "server" -
const ResponseToolSearchOutputItemExecutionClient ResponseToolSearchOutputItemExecution = "client"
-
-
Status ResponseToolSearchOutputItemStatusThe status of the tool search output item that was recorded.
-
const ResponseToolSearchOutputItemStatusInProgress ResponseToolSearchOutputItemStatus = "in_progress" -
const ResponseToolSearchOutputItemStatusCompleted ResponseToolSearchOutputItemStatus = "completed" -
const ResponseToolSearchOutputItemStatusIncomplete ResponseToolSearchOutputItemStatus = "incomplete"
-
-
Tools []ToolUnionThe loaded tool definitions returned by tool search.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type ToolSearchOutputThe type of the item. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseOutputItemAdditionalTools struct{…}-
ID stringThe unique ID of the additional tools item.
-
Role stringThe role that provided the additional tools.
-
const ResponseOutputItemAdditionalToolsRoleUnknown ResponseOutputItemAdditionalToolsRole = "unknown" -
const ResponseOutputItemAdditionalToolsRoleUser ResponseOutputItemAdditionalToolsRole = "user" -
const ResponseOutputItemAdditionalToolsRoleAssistant ResponseOutputItemAdditionalToolsRole = "assistant" -
const ResponseOutputItemAdditionalToolsRoleSystem ResponseOutputItemAdditionalToolsRole = "system" -
const ResponseOutputItemAdditionalToolsRoleCritic ResponseOutputItemAdditionalToolsRole = "critic" -
const ResponseOutputItemAdditionalToolsRoleDiscriminator ResponseOutputItemAdditionalToolsRole = "discriminator" -
const ResponseOutputItemAdditionalToolsRoleDeveloper ResponseOutputItemAdditionalToolsRole = "developer" -
const ResponseOutputItemAdditionalToolsRoleTool ResponseOutputItemAdditionalToolsRole = "tool"
-
-
Tools []ToolUnionThe additional tool definitions made available at this item.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type AdditionalToolsThe type of the item. Always
additional_tools.const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"
-
-
type ResponseCompactionItem struct{…}A compaction item generated by the
v1/responses/compactAPI.-
ID stringThe unique ID of the compaction item.
-
EncryptedContent stringThe encrypted content that was produced by compaction.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseOutputItemImageGenerationCall struct{…}An image generation request made by the model.
-
ID stringThe unique ID of the image generation call.
-
Result stringThe generated image encoded in base64.
-
Status stringThe status of the image generation call.
-
const ResponseOutputItemImageGenerationCallStatusInProgress ResponseOutputItemImageGenerationCallStatus = "in_progress" -
const ResponseOutputItemImageGenerationCallStatusCompleted ResponseOutputItemImageGenerationCallStatus = "completed" -
const ResponseOutputItemImageGenerationCallStatusGenerating ResponseOutputItemImageGenerationCallStatus = "generating" -
const ResponseOutputItemImageGenerationCallStatusFailed ResponseOutputItemImageGenerationCallStatus = "failed"
-
-
Type ImageGenerationCallThe type of the image generation call. Always
image_generation_call.const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"
-
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
type ResponseOutputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
ID stringThe unique ID of the local shell call.
-
Action ResponseOutputItemLocalShellCallActionExecute a shell command on the server.
-
Command []stringThe command to run.
-
Env map[string, string]Environment variables to set for the command.
-
Type ExecThe type of the local shell action. Always
exec.const ExecExec Exec = "exec"
-
TimeoutMs int64Optional timeout in milliseconds for the command.
-
User stringOptional user to run the command as.
-
WorkingDirectory stringOptional working directory to run the command in.
-
-
CallID stringThe unique ID of the local shell tool call generated by the model.
-
Status stringThe status of the local shell call.
-
const ResponseOutputItemLocalShellCallStatusInProgress ResponseOutputItemLocalShellCallStatus = "in_progress" -
const ResponseOutputItemLocalShellCallStatusCompleted ResponseOutputItemLocalShellCallStatus = "completed" -
const ResponseOutputItemLocalShellCallStatusIncomplete ResponseOutputItemLocalShellCallStatus = "incomplete"
-
-
Type LocalShellCallThe type of the local shell call. Always
local_shell_call.const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"
-
-
type ResponseOutputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
ID stringThe unique ID of the local shell tool call generated by the model.
-
Output stringA JSON string of the output of the local shell tool call.
-
Type LocalShellCallOutputThe type of the local shell tool call output. Always
local_shell_call_output.const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete.-
const ResponseOutputItemLocalShellCallOutputStatusInProgress ResponseOutputItemLocalShellCallOutputStatus = "in_progress" -
const ResponseOutputItemLocalShellCallOutputStatusCompleted ResponseOutputItemLocalShellCallOutputStatus = "completed" -
const ResponseOutputItemLocalShellCallOutputStatusIncomplete ResponseOutputItemLocalShellCallOutputStatus = "incomplete"
-
-
-
type ResponseFunctionShellToolCall struct{…}A tool call that executes one or more shell commands in a managed environment.
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Action ResponseFunctionShellToolCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []string -
MaxOutputLength int64Optional maximum number of characters to return from each command.
-
TimeoutMs int64Optional timeout in milliseconds for the commands.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Environment ResponseFunctionShellToolCallEnvironmentUnionRepresents the use of a local environment to perform shell actions.
-
type ResponseLocalEnvironment struct{…}Represents the use of a local environment to perform shell actions.
-
Type LocalThe environment type. Always
local.const LocalLocal Local = "local"
-
-
type ResponseContainerReference struct{…}Represents a container created with /v1/containers.
-
ContainerID string -
Type ContainerReferenceThe environment type. Always
container_reference.const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
Status ResponseFunctionShellToolCallStatusThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallStatusInProgress ResponseFunctionShellToolCallStatus = "in_progress" -
const ResponseFunctionShellToolCallStatusCompleted ResponseFunctionShellToolCallStatus = "completed" -
const ResponseFunctionShellToolCallStatusIncomplete ResponseFunctionShellToolCallStatus = "incomplete"
-
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseFunctionShellToolCallOutput struct{…}The output of a shell tool call that was emitted.
-
ID stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
MaxOutputLength int64The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
Output []ResponseFunctionShellToolCallOutputOutputAn array of shell call output contents
-
Outcome ResponseFunctionShellToolCallOutputOutputOutcomeUnionRepresents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
type ResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64Exit code from the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringThe standard error output that was captured.
-
Stdout stringThe standard output that was captured.
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
Status ResponseFunctionShellToolCallOutputStatusThe status of the shell call output. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallOutputStatusInProgress ResponseFunctionShellToolCallOutputStatus = "in_progress" -
const ResponseFunctionShellToolCallOutputStatusCompleted ResponseFunctionShellToolCallOutputStatus = "completed" -
const ResponseFunctionShellToolCallOutputStatusIncomplete ResponseFunctionShellToolCallOutputStatus = "incomplete"
-
-
Type ShellCallOutputThe type of the shell call output. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseApplyPatchToolCall struct{…}A tool call that applies file diffs by creating, deleting, or updating files.
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseApplyPatchToolCallOperationUnionOne of the create_file, delete_file, or update_file operations applied via apply_patch.
-
type ResponseApplyPatchToolCallOperationCreateFile struct{…}Instruction describing how to create a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to create.
-
Type CreateFileCreate a new file with the provided diff.
const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseApplyPatchToolCallOperationDeleteFile struct{…}Instruction describing how to delete a file via the apply_patch tool.
-
Path stringPath of the file to delete.
-
Type DeleteFileDelete the specified file.
const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseApplyPatchToolCallOperationUpdateFile struct{…}Instruction describing how to update a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to update.
-
Type UpdateFileUpdate an existing file with the provided diff.
const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status ResponseApplyPatchToolCallStatusThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseApplyPatchToolCallStatusInProgress ResponseApplyPatchToolCallStatus = "in_progress" -
const ResponseApplyPatchToolCallStatusCompleted ResponseApplyPatchToolCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseApplyPatchToolCallOutput struct{…}The output emitted by an apply patch tool call.
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status ResponseApplyPatchToolCallOutputStatusThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseApplyPatchToolCallOutputStatusCompleted ResponseApplyPatchToolCallOutputStatus = "completed" -
const ResponseApplyPatchToolCallOutputStatusFailed ResponseApplyPatchToolCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
CreatedBy stringThe ID of the entity that created this tool call output.
-
Output stringOptional textual output returned by the apply patch tool.
-
-
type ResponseOutputItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
ID stringThe unique ID of the tool call.
-
Arguments stringA JSON string of the arguments passed to the tool.
-
Name stringThe name of the tool that was run.
-
ServerLabel stringThe label of the MCP server running the tool.
-
Type McpCallThe type of the item. Always
mcp_call.const McpCallMcpCall McpCall = "mcp_call"
-
ApprovalRequestID stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
Error stringThe error from the tool call, if any.
-
Output stringThe output from the tool call.
-
Status stringThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
const ResponseOutputItemMcpCallStatusInProgress ResponseOutputItemMcpCallStatus = "in_progress" -
const ResponseOutputItemMcpCallStatusCompleted ResponseOutputItemMcpCallStatus = "completed" -
const ResponseOutputItemMcpCallStatusIncomplete ResponseOutputItemMcpCallStatus = "incomplete" -
const ResponseOutputItemMcpCallStatusCalling ResponseOutputItemMcpCallStatus = "calling" -
const ResponseOutputItemMcpCallStatusFailed ResponseOutputItemMcpCallStatus = "failed"
-
-
-
type ResponseOutputItemMcpListTools struct{…}A list of tools available on an MCP server.
-
ID stringThe unique ID of the list.
-
ServerLabel stringThe label of the MCP server.
-
Tools []ResponseOutputItemMcpListToolsToolThe tools available on the server.
-
InputSchema anyThe JSON schema describing the tool's input.
-
Name stringThe name of the tool.
-
Annotations anyAdditional annotations about the tool.
-
Description stringThe description of the tool.
-
-
Type McpListToolsThe type of the item. Always
mcp_list_tools.const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
-
Error stringError message if the server could not list tools.
-
-
type ResponseOutputItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
ID stringThe unique ID of the approval request.
-
Arguments stringA JSON string of arguments for the tool.
-
Name stringThe name of the tool to run.
-
ServerLabel stringThe label of the MCP server making the request.
-
Type McpApprovalRequestThe type of the item. Always
mcp_approval_request.const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"
-
-
type ResponseOutputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
ID stringThe unique ID of the approval response
-
ApprovalRequestID stringThe ID of the approval request being answered.
-
Approve boolWhether the request was approved.
-
Type McpApprovalResponseThe type of the item. Always
mcp_approval_response.const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
-
Reason stringOptional reason for the decision.
-
-
type ResponseCustomToolCall struct{…}A call to a custom tool created by the model.
-
type ResponseCustomToolCallOutputItem struct{…}The output of a custom tool call from your code, being sent back to the model.
-
ID stringThe unique ID of the custom tool call output item.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseCustomToolCallOutputItemStatusInProgress ResponseCustomToolCallOutputItemStatus = "in_progress" -
const ResponseCustomToolCallOutputItemStatusCompleted ResponseCustomToolCallOutputItemStatus = "completed" -
const ResponseCustomToolCallOutputItemStatusIncomplete ResponseCustomToolCallOutputItemStatus = "incomplete"
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
-
ParallelToolCalls boolWhether to allow the model to run tool calls in parallel.
-
Temperature float64What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or
top_pbut not both. -
ToolChoice ResponseToolChoiceUnionHow the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call.-
type ToolChoiceOptions stringControls which (if any) tool is called by the model.
nonemeans the model will not call any tool and instead generates a message.automeans the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools.-
const ToolChoiceOptionsNone ToolChoiceOptions = "none" -
const ToolChoiceOptionsAuto ToolChoiceOptions = "auto" -
const ToolChoiceOptionsRequired ToolChoiceOptions = "required"
-
-
type ToolChoiceAllowed struct{…}Constrains the tools available to the model to a pre-defined set.
-
Mode ToolChoiceAllowedModeConstrains the tools available to the model to a pre-defined set.
autoallows the model to pick from among the allowed tools and generate a message.requiredrequires the model to call one or more of the allowed tools.-
const ToolChoiceAllowedModeAuto ToolChoiceAllowedMode = "auto" -
const ToolChoiceAllowedModeRequired ToolChoiceAllowedMode = "required"
-
-
Tools []map[string, any]A list of tool definitions that the model should be allowed to call.
For the Responses API, the list of tool definitions might look like:
[ { "type": "function", "name": "get_weather" }, { "type": "mcp", "server_label": "deepwiki" }, { "type": "image_generation" } ] -
Type AllowedToolsAllowed tool configuration type. Always
allowed_tools.const AllowedToolsAllowedTools AllowedTools = "allowed_tools"
-
-
type ToolChoiceTypes struct{…}Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
-
Type ToolChoiceTypesTypeThe type of hosted tool the model should to use. Learn more about built-in tools.
Allowed values are:
-
file_search -
web_search_preview -
computer -
computer_use_preview -
computer_use -
code_interpreter -
image_generation -
const ToolChoiceTypesTypeFileSearch ToolChoiceTypesType = "file_search" -
const ToolChoiceTypesTypeWebSearchPreview ToolChoiceTypesType = "web_search_preview" -
const ToolChoiceTypesTypeComputer ToolChoiceTypesType = "computer" -
const ToolChoiceTypesTypeComputerUsePreview ToolChoiceTypesType = "computer_use_preview" -
const ToolChoiceTypesTypeComputerUse ToolChoiceTypesType = "computer_use" -
const ToolChoiceTypesTypeWebSearchPreview2025_03_11 ToolChoiceTypesType = "web_search_preview_2025_03_11" -
const ToolChoiceTypesTypeImageGeneration ToolChoiceTypesType = "image_generation" -
const ToolChoiceTypesTypeCodeInterpreter ToolChoiceTypesType = "code_interpreter"
-
-
-
type ToolChoiceFunction struct{…}Use this option to force the model to call a specific function.
-
Name stringThe name of the function to call.
-
Type FunctionFor function calling, the type is always
function.const FunctionFunction Function = "function"
-
-
type ToolChoiceMcp struct{…}Use this option to force the model to call a specific tool on a remote MCP server.
-
ServerLabel stringThe label of the MCP server to use.
-
Type McpFor MCP tools, the type is always
mcp.const McpMcp Mcp = "mcp"
-
Name stringThe name of the tool to call on the server.
-
-
type ToolChoiceCustom struct{…}Use this option to force the model to call a specific custom tool.
-
Name stringThe name of the custom tool to call.
-
Type CustomFor custom tool calling, the type is always
custom.const CustomCustom Custom = "custom"
-
-
type ToolChoiceApplyPatch struct{…}Forces the model to call the apply_patch tool when executing a tool call.
-
Type ApplyPatchThe tool to call. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
type ToolChoiceShell struct{…}Forces the model to call the shell tool when a tool call is required.
-
Type ShellThe tool to call. Always
shell.const ShellShell Shell = "shell"
-
-
-
Tools []ToolUnionAn array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.We support the following categories of tools:
-
Built-in tools: Tools that are provided by OpenAI that extend the model's capabilities, like web search or file search. Learn more about built-in tools.
-
MCP Tools: Integrations with third-party systems via custom MCP servers or predefined connectors such as Google Drive and SharePoint. Learn more about MCP Tools.
-
Function calls (custom tools): Functions that are defined by you, enabling the model to call your own code with strongly typed arguments and outputs. Learn more about function calling. You can also use custom tools to call your own code.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
TopP float64An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
We generally recommend altering this or
temperaturebut not both. -
Background boolWhether to run the model response in the background. Learn more.
-
CompletedAt float64Unix timestamp (in seconds) of when this Response was completed. Only present when the status is
completed. -
Conversation ResponseConversationThe conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
-
ID stringThe unique ID of the conversation that this response was associated with.
-
-
MaxOutputTokens int64An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
MaxToolCalls int64The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored.
-
Moderation ResponseModerationModeration results for the response input and output, if moderated completions were requested.
-
Input ResponseModerationInputUnionModeration for the response input.
-
type ResponseModerationInputModerationResult struct{…}A moderation result produced for the response input or output.
-
Categories map[string, bool]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
CategoryAppliedInputTypes map[string, []string]Which modalities of input are reflected by the score for each category.
-
const ResponseModerationInputModerationResultCategoryAppliedInputTypeText ResponseModerationInputModerationResultCategoryAppliedInputType = "text" -
const ResponseModerationInputModerationResultCategoryAppliedInputTypeImage ResponseModerationInputModerationResultCategoryAppliedInputType = "image"
-
-
CategoryScores map[string, float64]A dictionary of moderation categories to scores.
-
Flagged boolA boolean indicating whether the content was flagged by any category.
-
Model stringThe moderation model that produced this result.
-
Type ModerationResultThe object type, which was always
moderation_resultfor successful moderation results.const ModerationResultModerationResult ModerationResult = "moderation_result"
-
-
type ResponseModerationInputError struct{…}An error produced while attempting moderation for the response input or output.
-
Code stringThe error code.
-
Message stringThe error message.
-
Type ErrorThe object type, which was always
errorfor moderation failures.const ErrorError Error = "error"
-
-
-
Output ResponseModerationOutputUnionModeration for the response output.
-
type ResponseModerationOutputModerationResult struct{…}A moderation result produced for the response input or output.
-
Categories map[string, bool]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
CategoryAppliedInputTypes map[string, []string]Which modalities of input are reflected by the score for each category.
-
const ResponseModerationOutputModerationResultCategoryAppliedInputTypeText ResponseModerationOutputModerationResultCategoryAppliedInputType = "text" -
const ResponseModerationOutputModerationResultCategoryAppliedInputTypeImage ResponseModerationOutputModerationResultCategoryAppliedInputType = "image"
-
-
CategoryScores map[string, float64]A dictionary of moderation categories to scores.
-
Flagged boolA boolean indicating whether the content was flagged by any category.
-
Model stringThe moderation model that produced this result.
-
Type ModerationResultThe object type, which was always
moderation_resultfor successful moderation results.const ModerationResultModerationResult ModerationResult = "moderation_result"
-
-
type ResponseModerationOutputError struct{…}An error produced while attempting moderation for the response input or output.
-
Code stringThe error code.
-
Message stringThe error message.
-
Type ErrorThe object type, which was always
errorfor moderation failures.const ErrorError Error = "error"
-
-
-
-
PreviousResponseID stringThe unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about conversation state. Cannot be used in conjunction with
conversation. -
Prompt ResponsePromptReference to a prompt template and its variables. Learn more.
-
ID stringThe unique identifier of the prompt template to use.
-
Variables map[string, ResponsePromptVariableUnion]Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files.
-
string -
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
Version stringOptional version of the prompt template.
-
-
PromptCacheKey stringUsed by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more. -
PromptCacheRetention ResponsePromptCacheRetentionThe retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. Forgpt-5.5,gpt-5.5-pro, and future models, only24his supported.For older models that support both
in_memoryand24h, the default depends on your organization's data retention policy:-
Organizations without ZDR enabled default to
24h. -
Organizations with ZDR enabled default to
in_memorywhenprompt_cache_retentionis not specified. -
const ResponsePromptCacheRetentionInMemory ResponsePromptCacheRetention = "in_memory" -
const ResponsePromptCacheRetention24h ResponsePromptCacheRetention = "24h"
-
-
Reasoning Reasoninggpt-5 and o-series models only
Configuration options for reasoning models.
-
Context ReasoningContextControls which reasoning items are rendered back to the model on later turns. When returned on a response, this is the effective reasoning context mode used for the response.
-
const ReasoningContextAuto ReasoningContext = "auto" -
const ReasoningContextCurrentTurn ReasoningContext = "current_turn" -
const ReasoningContextAllTurns ReasoningContext = "all_turns"
-
-
Effort ReasoningEffortConstrains effort on reasoning for reasoning models. Currently supported values are
none,minimal,low,medium,high, andxhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.-
gpt-5.1defaults tonone, which does not perform reasoning. The supported reasoning values forgpt-5.1arenone,low,medium, andhigh. Tool calls are supported for all reasoning values in gpt-5.1. -
All models before
gpt-5.1default tomediumreasoning effort, and do not supportnone. -
The
gpt-5-promodel defaults to (and only supports)highreasoning effort. -
xhighis supported for all models aftergpt-5.1-codex-max. -
const ReasoningEffortNone ReasoningEffort = "none" -
const ReasoningEffortMinimal ReasoningEffort = "minimal" -
const ReasoningEffortLow ReasoningEffort = "low" -
const ReasoningEffortMedium ReasoningEffort = "medium" -
const ReasoningEffortHigh ReasoningEffort = "high" -
const ReasoningEffortXhigh ReasoningEffort = "xhigh"
-
-
GenerateSummary ReasoningGenerateSummaryDeprecated: use
summaryinstead.A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.-
const ReasoningGenerateSummaryAuto ReasoningGenerateSummary = "auto" -
const ReasoningGenerateSummaryConcise ReasoningGenerateSummary = "concise" -
const ReasoningGenerateSummaryDetailed ReasoningGenerateSummary = "detailed"
-
-
Summary ReasoningSummaryA summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.conciseis supported forcomputer-use-previewmodels and all reasoning models aftergpt-5.-
const ReasoningSummaryAuto ReasoningSummary = "auto" -
const ReasoningSummaryConcise ReasoningSummary = "concise" -
const ReasoningSummaryDetailed ReasoningSummary = "detailed"
-
-
-
SafetyIdentifier stringA stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
ServiceTier ResponseServiceTierSpecifies the processing type used for serving the request.
- If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'.
- If set to 'default', then the request will be processed with the standard pricing and performance for the selected model.
- If set to 'flex' or 'priority', then the request will be processed with the corresponding service tier.
- When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.-
const ResponseServiceTierAuto ResponseServiceTier = "auto" -
const ResponseServiceTierDefault ResponseServiceTier = "default" -
const ResponseServiceTierFlex ResponseServiceTier = "flex" -
const ResponseServiceTierScale ResponseServiceTier = "scale" -
const ResponseServiceTierPriority ResponseServiceTier = "priority"
-
Status ResponseStatusThe status of the response generation. One of
completed,failed,in_progress,cancelled,queued, orincomplete.-
const ResponseStatusCompleted ResponseStatus = "completed" -
const ResponseStatusFailed ResponseStatus = "failed" -
const ResponseStatusInProgress ResponseStatus = "in_progress" -
const ResponseStatusCancelled ResponseStatus = "cancelled" -
const ResponseStatusQueued ResponseStatus = "queued" -
const ResponseStatusIncomplete ResponseStatus = "incomplete"
-
-
Text ResponseTextConfigConfiguration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
Format ResponseFormatTextConfigUnionAn object specifying the format that the model must output.
Configuring
{ "type": "json_schema" }enables Structured Outputs, which ensures the model will match your supplied JSON schema. Learn more in the Structured Outputs guide.The default format is
{ "type": "text" }with no additional options.Not recommended for gpt-4o and newer models:
Setting to
{ "type": "json_object" }enables the older JSON mode, which ensures the message the model generates is valid JSON. Usingjson_schemais preferred for models that support it.-
type ResponseFormatText struct{…}Default response format. Used to generate text responses.
-
Type TextThe type of response format being defined. Always
text.const TextText Text = "text"
-
-
type ResponseFormatTextJSONSchemaConfig struct{…}JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
Name stringThe name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
-
Schema map[string, any]The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
-
Type JSONSchemaThe type of response format being defined. Always
json_schema.const JSONSchemaJSONSchema JSONSchema = "json_schema"
-
Description stringA description of what the response format is for, used by the model to determine how to respond in the format.
-
Strict boolWhether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the
schemafield. Only a subset of JSON Schema is supported whenstrictistrue. To learn more, read the Structured Outputs guide.
-
-
type ResponseFormatJSONObject struct{…}JSON object response format. An older method of generating JSON responses. Using
json_schemais 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 JSONObjectThe type of response format being defined. Always
json_object.const JSONObjectJSONObject JSONObject = "json_object"
-
-
-
Verbosity ResponseTextConfigVerbosityConstrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses. Currently supported values are
low,medium, andhigh.-
const ResponseTextConfigVerbosityLow ResponseTextConfigVerbosity = "low" -
const ResponseTextConfigVerbosityMedium ResponseTextConfigVerbosity = "medium" -
const ResponseTextConfigVerbosityHigh ResponseTextConfigVerbosity = "high"
-
-
TopLogprobs int64An integer between 0 and 20 specifying the maximum number of most likely tokens to return at each token position, each with an associated log probability. In some cases, the number of returned tokens may be fewer than requested.
-
Truncation ResponseTruncationThe truncation strategy to use for the model response.
-
auto: If the input to this Response exceeds the model's context window size, the model will truncate the response to fit the context window by dropping items from the beginning of the conversation. -
disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error. -
const ResponseTruncationAuto ResponseTruncation = "auto" -
const ResponseTruncationDisabled ResponseTruncation = "disabled"
-
-
Usage ResponseUsageRepresents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
-
InputTokens int64The number of input tokens.
-
InputTokensDetails ResponseUsageInputTokensDetailsA detailed breakdown of the input tokens.
-
CachedTokens int64The number of tokens that were retrieved from the cache. More on prompt caching.
-
-
OutputTokens int64The number of output tokens.
-
OutputTokensDetails ResponseUsageOutputTokensDetailsA detailed breakdown of the output tokens.
-
ReasoningTokens int64The number of reasoning tokens.
-
-
TotalTokens int64The total number of tokens used.
-
-
User stringThis field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead to maintain caching optimizations. A stable identifier for your end-users. Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. Learn more.
-
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseFailedThe type of the event. Always
response.failed.const ResponseFailedResponseFailed ResponseFailed = "response.failed"
-
Response File Search Call Completed Event
-
type ResponseFileSearchCallCompletedEvent struct{…}Emitted when a file search call is completed (results found).
-
ItemID stringThe ID of the output item that the file search call is initiated.
-
OutputIndex int64The index of the output item that the file search call is initiated.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseFileSearchCallCompletedThe type of the event. Always
response.file_search_call.completed.const ResponseFileSearchCallCompletedResponseFileSearchCallCompleted ResponseFileSearchCallCompleted = "response.file_search_call.completed"
-
Response File Search Call In Progress Event
-
type ResponseFileSearchCallInProgressEvent struct{…}Emitted when a file search call is initiated.
-
ItemID stringThe ID of the output item that the file search call is initiated.
-
OutputIndex int64The index of the output item that the file search call is initiated.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseFileSearchCallInProgressThe type of the event. Always
response.file_search_call.in_progress.const ResponseFileSearchCallInProgressResponseFileSearchCallInProgress ResponseFileSearchCallInProgress = "response.file_search_call.in_progress"
-
Response File Search Call Searching Event
-
type ResponseFileSearchCallSearchingEvent struct{…}Emitted when a file search is currently searching.
-
ItemID stringThe ID of the output item that the file search call is initiated.
-
OutputIndex int64The index of the output item that the file search call is searching.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseFileSearchCallSearchingThe type of the event. Always
response.file_search_call.searching.const ResponseFileSearchCallSearchingResponseFileSearchCallSearching ResponseFileSearchCallSearching = "response.file_search_call.searching"
-
Response File Search Tool Call
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
ID stringThe unique ID of the file search tool call.
-
Queries []stringThe queries used to search for files.
-
Status ResponseFileSearchToolCallStatusThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
const ResponseFileSearchToolCallStatusInProgress ResponseFileSearchToolCallStatus = "in_progress" -
const ResponseFileSearchToolCallStatusSearching ResponseFileSearchToolCallStatus = "searching" -
const ResponseFileSearchToolCallStatusCompleted ResponseFileSearchToolCallStatus = "completed" -
const ResponseFileSearchToolCallStatusIncomplete ResponseFileSearchToolCallStatus = "incomplete" -
const ResponseFileSearchToolCallStatusFailed ResponseFileSearchToolCallStatus = "failed"
-
-
Type FileSearchCallThe type of the file search tool call. Always
file_search_call.const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"
-
Results []ResponseFileSearchToolCallResultThe results of the file search tool call.
-
Attributes map[string, ResponseFileSearchToolCallResultAttributeUnion]Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.
-
string -
float64 -
bool
-
-
FileID stringThe unique ID of the file.
-
Filename stringThe name of the file.
-
Score float64The relevance score of the file - a value between 0 and 1.
-
Text stringThe text that was retrieved from the file.
-
-
Response Format Text Config
-
type ResponseFormatTextConfigUnion interface{…}An object specifying the format that the model must output.
Configuring
{ "type": "json_schema" }enables Structured Outputs, which ensures the model will match your supplied JSON schema. Learn more in the Structured Outputs guide.The default format is
{ "type": "text" }with no additional options.Not recommended for gpt-4o and newer models:
Setting to
{ "type": "json_object" }enables the older JSON mode, which ensures the message the model generates is valid JSON. Usingjson_schemais preferred for models that support it.-
type ResponseFormatText struct{…}Default response format. Used to generate text responses.
-
Type TextThe type of response format being defined. Always
text.const TextText Text = "text"
-
-
type ResponseFormatTextJSONSchemaConfig struct{…}JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
Name stringThe name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
-
Schema map[string, any]The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
-
Type JSONSchemaThe type of response format being defined. Always
json_schema.const JSONSchemaJSONSchema JSONSchema = "json_schema"
-
Description stringA description of what the response format is for, used by the model to determine how to respond in the format.
-
Strict boolWhether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the
schemafield. Only a subset of JSON Schema is supported whenstrictistrue. To learn more, read the Structured Outputs guide.
-
-
type ResponseFormatJSONObject struct{…}JSON object response format. An older method of generating JSON responses. Using
json_schemais 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 JSONObjectThe type of response format being defined. Always
json_object.const JSONObjectJSONObject JSONObject = "json_object"
-
-
Response Format Text JSON Schema Config
-
type ResponseFormatTextJSONSchemaConfig struct{…}JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
Name stringThe name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
-
Schema map[string, any]The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
-
Type JSONSchemaThe type of response format being defined. Always
json_schema.const JSONSchemaJSONSchema JSONSchema = "json_schema"
-
Description stringA description of what the response format is for, used by the model to determine how to respond in the format.
-
Strict boolWhether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the
schemafield. Only a subset of JSON Schema is supported whenstrictistrue. To learn more, read the Structured Outputs guide.
-
Response Function Call Arguments Delta Event
-
type ResponseFunctionCallArgumentsDeltaEvent struct{…}Emitted when there is a partial function-call arguments delta.
-
Delta stringThe function-call arguments delta that is added.
-
ItemID stringThe ID of the output item that the function-call arguments delta is added to.
-
OutputIndex int64The index of the output item that the function-call arguments delta is added to.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseFunctionCallArgumentsDeltaThe type of the event. Always
response.function_call_arguments.delta.const ResponseFunctionCallArgumentsDeltaResponseFunctionCallArgumentsDelta ResponseFunctionCallArgumentsDelta = "response.function_call_arguments.delta"
-
Response Function Call Arguments Done Event
-
type ResponseFunctionCallArgumentsDoneEvent struct{…}Emitted when function-call arguments are finalized.
-
Arguments stringThe function-call arguments.
-
ItemID stringThe ID of the item.
-
Name stringThe name of the function that was called.
-
OutputIndex int64The index of the output item.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseFunctionCallArgumentsDoneconst ResponseFunctionCallArgumentsDoneResponseFunctionCallArgumentsDone ResponseFunctionCallArgumentsDone = "response.function_call_arguments.done"
-
Response Function Call Output Item
-
type ResponseFunctionCallOutputItemUnion interface{…}A piece of message content, such as text, an image, or a file.
-
type ResponseInputTextContent struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImageContent struct{…}An image input to the model. Learn about image inputs
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
Detail ResponseInputImageContentDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageContentDetailLow ResponseInputImageContentDetail = "low" -
const ResponseInputImageContentDetailHigh ResponseInputImageContentDetail = "high" -
const ResponseInputImageContentDetailAuto ResponseInputImageContentDetail = "auto" -
const ResponseInputImageContentDetailOriginal ResponseInputImageContentDetail = "original"
-
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFileContent struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileContentDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileContentDetailLow ResponseInputFileContentDetail = "low" -
const ResponseInputFileContentDetailHigh ResponseInputFileContentDetail = "high"
-
-
FileData stringThe base64-encoded data of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
Response Function Call Output Item List
-
type ResponseFunctionCallOutputItemList []ResponseFunctionCallOutputItemUnionAn array of content outputs (text, image, file) for the function tool call.
-
type ResponseInputTextContent struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImageContent struct{…}An image input to the model. Learn about image inputs
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
Detail ResponseInputImageContentDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageContentDetailLow ResponseInputImageContentDetail = "low" -
const ResponseInputImageContentDetailHigh ResponseInputImageContentDetail = "high" -
const ResponseInputImageContentDetailAuto ResponseInputImageContentDetail = "auto" -
const ResponseInputImageContentDetailOriginal ResponseInputImageContentDetail = "original"
-
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFileContent struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileContentDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileContentDetailLow ResponseInputFileContentDetail = "low" -
const ResponseInputFileContentDetailHigh ResponseInputFileContentDetail = "high"
-
-
FileData stringThe base64-encoded data of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
Response Function Shell Call Output Content
-
type ResponseFunctionShellCallOutputContent struct{…}Captured stdout and stderr for a portion of a shell tool call output.
-
Outcome ResponseFunctionShellCallOutputContentOutcomeUnionThe exit or timeout outcome associated with this shell call.
-
type ResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellCallOutputContentOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64The exit code returned by the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringCaptured stderr output for the shell call.
-
Stdout stringCaptured stdout output for the shell call.
-
Response Function Shell Tool Call
-
type ResponseFunctionShellToolCall struct{…}A tool call that executes one or more shell commands in a managed environment.
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Action ResponseFunctionShellToolCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []string -
MaxOutputLength int64Optional maximum number of characters to return from each command.
-
TimeoutMs int64Optional timeout in milliseconds for the commands.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Environment ResponseFunctionShellToolCallEnvironmentUnionRepresents the use of a local environment to perform shell actions.
-
type ResponseLocalEnvironment struct{…}Represents the use of a local environment to perform shell actions.
-
Type LocalThe environment type. Always
local.const LocalLocal Local = "local"
-
-
type ResponseContainerReference struct{…}Represents a container created with /v1/containers.
-
ContainerID string -
Type ContainerReferenceThe environment type. Always
container_reference.const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
Status ResponseFunctionShellToolCallStatusThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallStatusInProgress ResponseFunctionShellToolCallStatus = "in_progress" -
const ResponseFunctionShellToolCallStatusCompleted ResponseFunctionShellToolCallStatus = "completed" -
const ResponseFunctionShellToolCallStatusIncomplete ResponseFunctionShellToolCallStatus = "incomplete"
-
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
Response Function Shell Tool Call Output
-
type ResponseFunctionShellToolCallOutput struct{…}The output of a shell tool call that was emitted.
-
ID stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
MaxOutputLength int64The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
Output []ResponseFunctionShellToolCallOutputOutputAn array of shell call output contents
-
Outcome ResponseFunctionShellToolCallOutputOutputOutcomeUnionRepresents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
type ResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64Exit code from the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringThe standard error output that was captured.
-
Stdout stringThe standard output that was captured.
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
Status ResponseFunctionShellToolCallOutputStatusThe status of the shell call output. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallOutputStatusInProgress ResponseFunctionShellToolCallOutputStatus = "in_progress" -
const ResponseFunctionShellToolCallOutputStatusCompleted ResponseFunctionShellToolCallOutputStatus = "completed" -
const ResponseFunctionShellToolCallOutputStatusIncomplete ResponseFunctionShellToolCallOutputStatus = "incomplete"
-
-
Type ShellCallOutputThe type of the shell call output. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
Response Function Tool Call
-
type ResponseFunctionToolCall struct{…}A tool call to run a function. See the function calling guide for more information.
-
Arguments stringA JSON string of the arguments to pass to the function.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Name stringThe name of the function to run.
-
Type FunctionCallThe type of the function tool call. Always
function_call.const FunctionCallFunctionCall FunctionCall = "function_call"
-
ID stringThe unique ID of the function tool call.
-
Namespace stringThe namespace of the function to run.
-
Status ResponseFunctionToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallStatusInProgress ResponseFunctionToolCallStatus = "in_progress" -
const ResponseFunctionToolCallStatusCompleted ResponseFunctionToolCallStatus = "completed" -
const ResponseFunctionToolCallStatusIncomplete ResponseFunctionToolCallStatus = "incomplete"
-
-
Response Function Tool Call Item
-
type ResponseFunctionToolCallItem struct{…}A tool call to run a function. See the function calling guide for more information.
-
ID stringThe unique ID of the function tool call.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallItemStatusInProgress ResponseFunctionToolCallItemStatus = "in_progress" -
const ResponseFunctionToolCallItemStatusCompleted ResponseFunctionToolCallItemStatus = "completed" -
const ResponseFunctionToolCallItemStatusIncomplete ResponseFunctionToolCallItemStatus = "incomplete"
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
Response Function Tool Call Output Item
-
type ResponseFunctionToolCallOutputItem struct{…}-
ID stringThe unique ID of the function call tool output.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseFunctionToolCallOutputItemOutputUnionThe output from the function call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseFunctionToolCallOutputItemOutputOutputContentList []ResponseFunctionToolCallOutputItemOutputOutputContentListItemUnionText, image, or file output of the function call.
-
type ResponseInputText struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
Detail ResponseInputImageDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageDetailLow ResponseInputImageDetail = "low" -
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high" -
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto" -
const ResponseInputImageDetailOriginal ResponseInputImageDetail = "original"
-
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFile struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileDetailLow ResponseInputFileDetail = "low" -
const ResponseInputFileDetailHigh ResponseInputFileDetail = "high"
-
-
FileData stringThe content of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Status ResponseFunctionToolCallOutputItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallOutputItemStatusInProgress ResponseFunctionToolCallOutputItemStatus = "in_progress" -
const ResponseFunctionToolCallOutputItemStatusCompleted ResponseFunctionToolCallOutputItemStatus = "completed" -
const ResponseFunctionToolCallOutputItemStatusIncomplete ResponseFunctionToolCallOutputItemStatus = "incomplete"
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
Response Function Web Search
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
ID stringThe unique ID of the web search tool call.
-
Action ResponseFunctionWebSearchActionUnionAn object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
type ResponseFunctionWebSearchActionSearch struct{…}Action type "search" - Performs a web search query.
-
Type SearchThe action type.
const SearchSearch Search = "search"
-
Queries []stringThe search queries.
-
Query stringThe search query.
-
Sources []ResponseFunctionWebSearchActionSearchSourceThe sources used in the search.
-
Type URLThe type of source. Always
url.const URLURL URL = "url"
-
URL stringThe URL of the source.
-
-
-
type ResponseFunctionWebSearchActionOpenPage struct{…}Action type "open_page" - Opens a specific URL from search results.
-
Type OpenPageThe action type.
const OpenPageOpenPage OpenPage = "open_page"
-
URL stringThe URL opened by the model.
-
-
type ResponseFunctionWebSearchActionFindInPage struct{…}Action type "find_in_page": Searches for a pattern within a loaded page.
-
Pattern stringThe pattern or text to search for within the page.
-
Type FindInPageThe action type.
const FindInPageFindInPage FindInPage = "find_in_page"
-
URL stringThe URL of the page searched for the pattern.
-
-
-
Status ResponseFunctionWebSearchStatusThe status of the web search tool call.
-
const ResponseFunctionWebSearchStatusInProgress ResponseFunctionWebSearchStatus = "in_progress" -
const ResponseFunctionWebSearchStatusSearching ResponseFunctionWebSearchStatus = "searching" -
const ResponseFunctionWebSearchStatusCompleted ResponseFunctionWebSearchStatus = "completed" -
const ResponseFunctionWebSearchStatusFailed ResponseFunctionWebSearchStatus = "failed"
-
-
Type WebSearchCallThe type of the web search tool call. Always
web_search_call.const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"
-
Response Image Gen Call Completed Event
-
type ResponseImageGenCallCompletedEvent struct{…}Emitted when an image generation tool call has completed and the final image is available.
-
ItemID stringThe unique identifier of the image generation item being processed.
-
OutputIndex int64The index of the output item in the response's output array.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseImageGenerationCallCompletedThe type of the event. Always 'response.image_generation_call.completed'.
const ResponseImageGenerationCallCompletedResponseImageGenerationCallCompleted ResponseImageGenerationCallCompleted = "response.image_generation_call.completed"
-
Response Image Gen Call Generating Event
-
type ResponseImageGenCallGeneratingEvent struct{…}Emitted when an image generation tool call is actively generating an image (intermediate state).
-
ItemID stringThe unique identifier of the image generation item being processed.
-
OutputIndex int64The index of the output item in the response's output array.
-
SequenceNumber int64The sequence number of the image generation item being processed.
-
Type ResponseImageGenerationCallGeneratingThe type of the event. Always 'response.image_generation_call.generating'.
const ResponseImageGenerationCallGeneratingResponseImageGenerationCallGenerating ResponseImageGenerationCallGenerating = "response.image_generation_call.generating"
-
Response Image Gen Call In Progress Event
-
type ResponseImageGenCallInProgressEvent struct{…}Emitted when an image generation tool call is in progress.
-
ItemID stringThe unique identifier of the image generation item being processed.
-
OutputIndex int64The index of the output item in the response's output array.
-
SequenceNumber int64The sequence number of the image generation item being processed.
-
Type ResponseImageGenerationCallInProgressThe type of the event. Always 'response.image_generation_call.in_progress'.
const ResponseImageGenerationCallInProgressResponseImageGenerationCallInProgress ResponseImageGenerationCallInProgress = "response.image_generation_call.in_progress"
-
Response Image Gen Call Partial Image Event
-
type ResponseImageGenCallPartialImageEvent struct{…}Emitted when a partial image is available during image generation streaming.
-
ItemID stringThe unique identifier of the image generation item being processed.
-
OutputIndex int64The index of the output item in the response's output array.
-
PartialImageB64 stringBase64-encoded partial image data, suitable for rendering as an image.
-
PartialImageIndex int640-based index for the partial image (backend is 1-based, but this is 0-based for the user).
-
SequenceNumber int64The sequence number of the image generation item being processed.
-
Type ResponseImageGenerationCallPartialImageThe type of the event. Always 'response.image_generation_call.partial_image'.
const ResponseImageGenerationCallPartialImageResponseImageGenerationCallPartialImage ResponseImageGenerationCallPartialImage = "response.image_generation_call.partial_image"
-
Response In Progress Event
-
type ResponseInProgressEvent struct{…}Emitted when the response is in progress.
-
Response ResponseThe response that is in progress.
-
ID stringUnique identifier for this Response.
-
CreatedAt float64Unix timestamp (in seconds) of when this Response was created.
-
Error ResponseErrorAn error object returned when the model fails to generate a Response.
-
Code ResponseErrorCodeThe error code for the response.
-
const ResponseErrorCodeServerError ResponseErrorCode = "server_error" -
const ResponseErrorCodeRateLimitExceeded ResponseErrorCode = "rate_limit_exceeded" -
const ResponseErrorCodeInvalidPrompt ResponseErrorCode = "invalid_prompt" -
const ResponseErrorCodeVectorStoreTimeout ResponseErrorCode = "vector_store_timeout" -
const ResponseErrorCodeInvalidImage ResponseErrorCode = "invalid_image" -
const ResponseErrorCodeInvalidImageFormat ResponseErrorCode = "invalid_image_format" -
const ResponseErrorCodeInvalidBase64Image ResponseErrorCode = "invalid_base64_image" -
const ResponseErrorCodeInvalidImageURL ResponseErrorCode = "invalid_image_url" -
const ResponseErrorCodeImageTooLarge ResponseErrorCode = "image_too_large" -
const ResponseErrorCodeImageTooSmall ResponseErrorCode = "image_too_small" -
const ResponseErrorCodeImageParseError ResponseErrorCode = "image_parse_error" -
const ResponseErrorCodeImageContentPolicyViolation ResponseErrorCode = "image_content_policy_violation" -
const ResponseErrorCodeInvalidImageMode ResponseErrorCode = "invalid_image_mode" -
const ResponseErrorCodeImageFileTooLarge ResponseErrorCode = "image_file_too_large" -
const ResponseErrorCodeUnsupportedImageMediaType ResponseErrorCode = "unsupported_image_media_type" -
const ResponseErrorCodeEmptyImageFile ResponseErrorCode = "empty_image_file" -
const ResponseErrorCodeFailedToDownloadImage ResponseErrorCode = "failed_to_download_image" -
const ResponseErrorCodeImageFileNotFound ResponseErrorCode = "image_file_not_found"
-
-
Message stringA human-readable description of the error.
-
-
IncompleteDetails ResponseIncompleteDetailsDetails about why the response is incomplete.
-
Reason stringThe reason why the response is incomplete.
-
const ResponseIncompleteDetailsReasonMaxOutputTokens ResponseIncompleteDetailsReason = "max_output_tokens" -
const ResponseIncompleteDetailsReasonContentFilter ResponseIncompleteDetailsReason = "content_filter"
-
-
-
Instructions ResponseInstructionsUnionA system (or developer) message inserted into the model's context.
When using along with
previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses.-
string -
type ResponseInstructionsInputItemList []ResponseInputItemUnionA list of one or many input items to the model, containing different content types.
-
type EasyInputMessage struct{…}A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.-
Content EasyInputMessageContentUnionText, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
-
string -
type ResponseInputMessageContentList []ResponseInputContentUnionA list of one or many input items to the model, containing different content types.
-
type ResponseInputText struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
Detail ResponseInputImageDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageDetailLow ResponseInputImageDetail = "low" -
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high" -
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto" -
const ResponseInputImageDetailOriginal ResponseInputImageDetail = "original"
-
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFile struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileDetailLow ResponseInputFileDetail = "low" -
const ResponseInputFileDetailHigh ResponseInputFileDetail = "high"
-
-
FileData stringThe content of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Role EasyInputMessageRoleThe role of the message input. One of
user,assistant,system, ordeveloper.-
const EasyInputMessageRoleUser EasyInputMessageRole = "user" -
const EasyInputMessageRoleAssistant EasyInputMessageRole = "assistant" -
const EasyInputMessageRoleSystem EasyInputMessageRole = "system" -
const EasyInputMessageRoleDeveloper EasyInputMessageRole = "developer"
-
-
Phase EasyInputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const EasyInputMessagePhaseCommentary EasyInputMessagePhase = "commentary" -
const EasyInputMessagePhaseFinalAnswer EasyInputMessagePhase = "final_answer"
-
-
Type EasyInputMessageTypeThe type of the message input. Always
message.const EasyInputMessageTypeMessage EasyInputMessageType = "message"
-
-
type ResponseInputItemMessage struct{…}A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole.-
Content ResponseInputMessageContentListA list of one or many input items to the model, containing different content types.
-
Role stringThe role of the message input. One of
user,system, ordeveloper.-
const ResponseInputItemMessageRoleUser ResponseInputItemMessageRole = "user" -
const ResponseInputItemMessageRoleSystem ResponseInputItemMessageRole = "system" -
const ResponseInputItemMessageRoleDeveloper ResponseInputItemMessageRole = "developer"
-
-
Status stringThe status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputItemMessageStatusInProgress ResponseInputItemMessageStatus = "in_progress" -
const ResponseInputItemMessageStatusCompleted ResponseInputItemMessageStatus = "completed" -
const ResponseInputItemMessageStatusIncomplete ResponseInputItemMessageStatus = "incomplete"
-
-
Type stringThe type of the message input. Always set to
message.const ResponseInputItemMessageTypeMessage ResponseInputItemMessageType = "message"
-
-
type ResponseOutputMessage struct{…}An output message from the model.
-
ID stringThe unique ID of the output message.
-
Content []ResponseOutputMessageContentUnionThe content of the output message.
-
type ResponseOutputText struct{…}A text output from the model.
-
Annotations []ResponseOutputTextAnnotationUnionThe annotations of the text output.
-
type ResponseOutputTextAnnotationFileCitation struct{…}A citation to a file.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the file cited.
-
Index int64The index of the file in the list of files.
-
Type FileCitationThe type of the file citation. Always
file_citation.const FileCitationFileCitation FileCitation = "file_citation"
-
-
type ResponseOutputTextAnnotationURLCitation struct{…}A citation for a web resource used to generate a model response.
-
EndIndex int64The index of the last character of the URL citation in the message.
-
StartIndex int64The index of the first character of the URL citation in the message.
-
Title stringThe title of the web resource.
-
Type URLCitationThe type of the URL citation. Always
url_citation.const URLCitationURLCitation URLCitation = "url_citation"
-
URL stringThe URL of the web resource.
-
-
type ResponseOutputTextAnnotationContainerFileCitation struct{…}A citation for a container file used to generate a model response.
-
ContainerID stringThe ID of the container file.
-
EndIndex int64The index of the last character of the container file citation in the message.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the container file cited.
-
StartIndex int64The index of the first character of the container file citation in the message.
-
Type ContainerFileCitationThe type of the container file citation. Always
container_file_citation.const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"
-
-
type ResponseOutputTextAnnotationFilePath struct{…}A path to a file.
-
FileID stringThe ID of the file.
-
Index int64The index of the file in the list of files.
-
Type FilePathThe type of the file path. Always
file_path.const FilePathFilePath FilePath = "file_path"
-
-
-
Text stringThe text output from the model.
-
Type OutputTextThe type of the output text. Always
output_text.const OutputTextOutputText OutputText = "output_text"
-
Logprobs []ResponseOutputTextLogprob-
Token string -
Bytes []int64 -
Logprob float64 -
TopLogprobs []ResponseOutputTextLogprobTopLogprob-
Token string -
Bytes []int64 -
Logprob float64
-
-
-
-
type ResponseOutputRefusal struct{…}A refusal from the model.
-
Refusal stringThe refusal explanation from the model.
-
Type RefusalThe type of the refusal. Always
refusal.const RefusalRefusal Refusal = "refusal"
-
-
-
Role AssistantThe role of the output message. Always
assistant.const AssistantAssistant Assistant = "assistant"
-
Status ResponseOutputMessageStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseOutputMessageStatusInProgress ResponseOutputMessageStatus = "in_progress" -
const ResponseOutputMessageStatusCompleted ResponseOutputMessageStatus = "completed" -
const ResponseOutputMessageStatusIncomplete ResponseOutputMessageStatus = "incomplete"
-
-
Type MessageThe type of the output message. Always
message.const MessageMessage Message = "message"
-
Phase ResponseOutputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const ResponseOutputMessagePhaseCommentary ResponseOutputMessagePhase = "commentary" -
const ResponseOutputMessagePhaseFinalAnswer ResponseOutputMessagePhase = "final_answer"
-
-
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
ID stringThe unique ID of the file search tool call.
-
Queries []stringThe queries used to search for files.
-
Status ResponseFileSearchToolCallStatusThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
const ResponseFileSearchToolCallStatusInProgress ResponseFileSearchToolCallStatus = "in_progress" -
const ResponseFileSearchToolCallStatusSearching ResponseFileSearchToolCallStatus = "searching" -
const ResponseFileSearchToolCallStatusCompleted ResponseFileSearchToolCallStatus = "completed" -
const ResponseFileSearchToolCallStatusIncomplete ResponseFileSearchToolCallStatus = "incomplete" -
const ResponseFileSearchToolCallStatusFailed ResponseFileSearchToolCallStatus = "failed"
-
-
Type FileSearchCallThe type of the file search tool call. Always
file_search_call.const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"
-
Results []ResponseFileSearchToolCallResultThe results of the file search tool call.
-
Attributes map[string, ResponseFileSearchToolCallResultAttributeUnion]Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.
-
string -
float64 -
bool
-
-
FileID stringThe unique ID of the file.
-
Filename stringThe name of the file.
-
Score float64The relevance score of the file - a value between 0 and 1.
-
Text stringThe text that was retrieved from the file.
-
-
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
ID stringThe unique ID of the computer call.
-
CallID stringAn identifier used when responding to the tool call with output.
-
PendingSafetyChecks []ResponseComputerToolCallPendingSafetyCheckThe pending safety checks for the computer call.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status ResponseComputerToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseComputerToolCallStatusInProgress ResponseComputerToolCallStatus = "in_progress" -
const ResponseComputerToolCallStatusCompleted ResponseComputerToolCallStatus = "completed" -
const ResponseComputerToolCallStatusIncomplete ResponseComputerToolCallStatus = "incomplete"
-
-
Type ResponseComputerToolCallTypeThe type of the computer call. Always
computer_call.const ResponseComputerToolCallTypeComputerCall ResponseComputerToolCallType = "computer_call"
-
Action ResponseComputerToolCallActionUnionA click action.
-
type ResponseComputerToolCallActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ResponseComputerToolCallActionClickButtonLeft ResponseComputerToolCallActionClickButton = "left" -
const ResponseComputerToolCallActionClickButtonRight ResponseComputerToolCallActionClickButton = "right" -
const ResponseComputerToolCallActionClickButtonWheel ResponseComputerToolCallActionClickButton = "wheel" -
const ResponseComputerToolCallActionClickButtonBack ResponseComputerToolCallActionClickButton = "back" -
const ResponseComputerToolCallActionClickButtonForward ResponseComputerToolCallActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ResponseComputerToolCallActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ResponseComputerToolCallActionDrag struct{…}A drag action.
-
Path []ResponseComputerToolCallActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ResponseComputerToolCallActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ResponseComputerToolCallActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ResponseComputerToolCallActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ResponseComputerToolCallActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ResponseComputerToolCallActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ResponseComputerToolCallActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
Actions ComputerActionListFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
type ComputerActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ComputerActionClickButtonLeft ComputerActionClickButton = "left" -
const ComputerActionClickButtonRight ComputerActionClickButton = "right" -
const ComputerActionClickButtonWheel ComputerActionClickButton = "wheel" -
const ComputerActionClickButtonBack ComputerActionClickButton = "back" -
const ComputerActionClickButtonForward ComputerActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ComputerActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ComputerActionDrag struct{…}A drag action.
-
Path []ComputerActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ComputerActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ComputerActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ComputerActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ComputerActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ComputerActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ComputerActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
-
type ResponseInputItemComputerCallOutput struct{…}The output of a computer tool call.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Type ComputerScreenshotSpecifies the event type. For a computer screenshot, this property is always set to
computer_screenshot.const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"
-
FileID stringThe identifier of an uploaded file that contains the screenshot.
-
ImageURL stringThe URL of the screenshot image.
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
ID stringThe ID of the computer tool call output.
-
AcknowledgedSafetyChecks []ResponseInputItemComputerCallOutputAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status stringThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseInputItemComputerCallOutputStatusInProgress ResponseInputItemComputerCallOutputStatus = "in_progress" -
const ResponseInputItemComputerCallOutputStatusCompleted ResponseInputItemComputerCallOutputStatus = "completed" -
const ResponseInputItemComputerCallOutputStatusIncomplete ResponseInputItemComputerCallOutputStatus = "incomplete"
-
-
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
ID stringThe unique ID of the web search tool call.
-
Action ResponseFunctionWebSearchActionUnionAn object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
type ResponseFunctionWebSearchActionSearch struct{…}Action type "search" - Performs a web search query.
-
Type SearchThe action type.
const SearchSearch Search = "search"
-
Queries []stringThe search queries.
-
Query stringThe search query.
-
Sources []ResponseFunctionWebSearchActionSearchSourceThe sources used in the search.
-
Type URLThe type of source. Always
url.const URLURL URL = "url"
-
URL stringThe URL of the source.
-
-
-
type ResponseFunctionWebSearchActionOpenPage struct{…}Action type "open_page" - Opens a specific URL from search results.
-
Type OpenPageThe action type.
const OpenPageOpenPage OpenPage = "open_page"
-
URL stringThe URL opened by the model.
-
-
type ResponseFunctionWebSearchActionFindInPage struct{…}Action type "find_in_page": Searches for a pattern within a loaded page.
-
Pattern stringThe pattern or text to search for within the page.
-
Type FindInPageThe action type.
const FindInPageFindInPage FindInPage = "find_in_page"
-
URL stringThe URL of the page searched for the pattern.
-
-
-
Status ResponseFunctionWebSearchStatusThe status of the web search tool call.
-
const ResponseFunctionWebSearchStatusInProgress ResponseFunctionWebSearchStatus = "in_progress" -
const ResponseFunctionWebSearchStatusSearching ResponseFunctionWebSearchStatus = "searching" -
const ResponseFunctionWebSearchStatusCompleted ResponseFunctionWebSearchStatus = "completed" -
const ResponseFunctionWebSearchStatusFailed ResponseFunctionWebSearchStatus = "failed"
-
-
Type WebSearchCallThe type of the web search tool call. Always
web_search_call.const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"
-
-
type ResponseFunctionToolCall struct{…}A tool call to run a function. See the function calling guide for more information.
-
Arguments stringA JSON string of the arguments to pass to the function.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Name stringThe name of the function to run.
-
Type FunctionCallThe type of the function tool call. Always
function_call.const FunctionCallFunctionCall FunctionCall = "function_call"
-
ID stringThe unique ID of the function tool call.
-
Namespace stringThe namespace of the function to run.
-
Status ResponseFunctionToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallStatusInProgress ResponseFunctionToolCallStatus = "in_progress" -
const ResponseFunctionToolCallStatusCompleted ResponseFunctionToolCallStatus = "completed" -
const ResponseFunctionToolCallStatusIncomplete ResponseFunctionToolCallStatus = "incomplete"
-
-
-
type ResponseInputItemFunctionCallOutput struct{…}The output of a function tool call.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseInputItemFunctionCallOutputOutputUnionText, image, or file output of the function tool call.
-
string -
type ResponseFunctionCallOutputItemList []ResponseFunctionCallOutputItemUnionAn array of content outputs (text, image, file) for the function tool call.
-
type ResponseInputTextContent struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImageContent struct{…}An image input to the model. Learn about image inputs
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
Detail ResponseInputImageContentDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageContentDetailLow ResponseInputImageContentDetail = "low" -
const ResponseInputImageContentDetailHigh ResponseInputImageContentDetail = "high" -
const ResponseInputImageContentDetailAuto ResponseInputImageContentDetail = "auto" -
const ResponseInputImageContentDetailOriginal ResponseInputImageContentDetail = "original"
-
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFileContent struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileContentDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileContentDetailLow ResponseInputFileContentDetail = "low" -
const ResponseInputFileContentDetailHigh ResponseInputFileContentDetail = "high"
-
-
FileData stringThe base64-encoded data of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
ID stringThe unique ID of the function tool call output. Populated when this item is returned via API.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputItemFunctionCallOutputStatusInProgress ResponseInputItemFunctionCallOutputStatus = "in_progress" -
const ResponseInputItemFunctionCallOutputStatusCompleted ResponseInputItemFunctionCallOutputStatus = "completed" -
const ResponseInputItemFunctionCallOutputStatusIncomplete ResponseInputItemFunctionCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemToolSearchCall struct{…}-
Arguments anyThe arguments supplied to the tool search call.
-
Type ToolSearchCallThe item type. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
ID stringThe unique ID of this tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution stringWhether tool search was executed by the server or by the client.
-
const ResponseInputItemToolSearchCallExecutionServer ResponseInputItemToolSearchCallExecution = "server" -
const ResponseInputItemToolSearchCallExecutionClient ResponseInputItemToolSearchCallExecution = "client"
-
-
Status stringThe status of the tool search call.
-
const ResponseInputItemToolSearchCallStatusInProgress ResponseInputItemToolSearchCallStatus = "in_progress" -
const ResponseInputItemToolSearchCallStatusCompleted ResponseInputItemToolSearchCallStatus = "completed" -
const ResponseInputItemToolSearchCallStatusIncomplete ResponseInputItemToolSearchCallStatus = "incomplete"
-
-
-
type ResponseToolSearchOutputItemParamResp struct{…}-
Tools []ToolUnionThe loaded tool definitions returned by the tool search output.
-
type FunctionTool struct{…}Defines a function in your own code the model can choose to call. Learn more about function calling.
-
Name stringThe name of the function to call.
-
Parameters map[string, any]A JSON schema object describing the parameters of the function.
-
Strict boolWhether to enforce strict parameter validation. Default
true. -
Type FunctionThe type of the function tool. Always
function.const FunctionFunction Function = "function"
-
DeferLoading boolWhether this function is deferred and loaded via tool search.
-
Description stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
type FileSearchTool struct{…}A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
Type FileSearchThe type of the file search tool. Always
file_search.const FileSearchFileSearch FileSearch = "file_search"
-
VectorStoreIDs []stringThe IDs of the vector stores to search.
-
Filters FileSearchToolFiltersUnionA filter to apply.
-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
Key stringThe key to compare against the value.
-
Type ComparisonFilterTypeSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
const ComparisonFilterTypeEq ComparisonFilterType = "eq" -
const ComparisonFilterTypeNe ComparisonFilterType = "ne" -
const ComparisonFilterTypeGt ComparisonFilterType = "gt" -
const ComparisonFilterTypeGte ComparisonFilterType = "gte" -
const ComparisonFilterTypeLt ComparisonFilterType = "lt" -
const ComparisonFilterTypeLte ComparisonFilterType = "lte" -
const ComparisonFilterTypeIn ComparisonFilterType = "in" -
const ComparisonFilterTypeNin ComparisonFilterType = "nin"
-
-
Value ComparisonFilterValueUnionThe value to compare against the attribute key; supports string, number, or boolean types.
-
string -
float64 -
bool -
type ComparisonFilterValueArray []ComparisonFilterValueArrayItemUnion-
string -
float64
-
-
-
-
type CompoundFilter struct{…}Combine multiple filters using
andoror.-
Filters []ComparisonFilterArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
-
Type CompoundFilterTypeType of operation:
andoror.-
const CompoundFilterTypeAnd CompoundFilterType = "and" -
const CompoundFilterTypeOr CompoundFilterType = "or"
-
-
-
-
MaxNumResults int64The maximum number of results to return. This number should be between 1 and 50 inclusive.
-
RankingOptions FileSearchToolRankingOptionsRanking options for search.
-
HybridSearch FileSearchToolRankingOptionsHybridSearchWeights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
EmbeddingWeight float64The weight of the embedding in the reciprocal ranking fusion.
-
TextWeight float64The weight of the text in the reciprocal ranking fusion.
-
-
Ranker stringThe ranker to use for the file search.
-
const FileSearchToolRankingOptionsRankerAuto FileSearchToolRankingOptionsRanker = "auto" -
const FileSearchToolRankingOptionsRankerDefault2024_11_15 FileSearchToolRankingOptionsRanker = "default-2024-11-15"
-
-
ScoreThreshold float64The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
Type ComputerThe type of the computer tool. Always
computer.const ComputerComputer Computer = "computer"
-
-
type ComputerUsePreviewTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
DisplayHeight int64The height of the computer display.
-
DisplayWidth int64The width of the computer display.
-
Environment ComputerUsePreviewToolEnvironmentThe type of computer environment to control.
-
const ComputerUsePreviewToolEnvironmentWindows ComputerUsePreviewToolEnvironment = "windows" -
const ComputerUsePreviewToolEnvironmentMac ComputerUsePreviewToolEnvironment = "mac" -
const ComputerUsePreviewToolEnvironmentLinux ComputerUsePreviewToolEnvironment = "linux" -
const ComputerUsePreviewToolEnvironmentUbuntu ComputerUsePreviewToolEnvironment = "ubuntu" -
const ComputerUsePreviewToolEnvironmentBrowser ComputerUsePreviewToolEnvironment = "browser"
-
-
Type ComputerUsePreviewThe type of the computer use tool. Always
computer_use_preview.const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"
-
-
type WebSearchTool struct{…}Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
Type WebSearchToolTypeThe type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
const WebSearchToolTypeWebSearch WebSearchToolType = "web_search" -
const WebSearchToolTypeWebSearch2025_08_26 WebSearchToolType = "web_search_2025_08_26"
-
-
Filters WebSearchToolFiltersFilters for the search.
-
AllowedDomains []stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
SearchContextSize WebSearchToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchToolSearchContextSizeLow WebSearchToolSearchContextSize = "low" -
const WebSearchToolSearchContextSizeMedium WebSearchToolSearchContextSize = "medium" -
const WebSearchToolSearchContextSizeHigh WebSearchToolSearchContextSize = "high"
-
-
UserLocation WebSearchToolUserLocationThe approximate location of the user.
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
Type stringThe type of location approximation. Always
approximate.const WebSearchToolUserLocationTypeApproximate WebSearchToolUserLocationType = "approximate"
-
-
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
ServerLabel stringA label for this MCP server, used to identify it in tool calls.
-
Type McpThe type of the MCP tool. Always
mcp.const McpMcp Mcp = "mcp"
-
AllowedTools ToolMcpAllowedToolsUnionList of allowed tool names or a filter object.
-
type ToolMcpAllowedToolsMcpAllowedTools []stringA string array of allowed tool names
-
type ToolMcpAllowedToolsMcpToolFilter struct{…}A filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
Authorization stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
ConnectorID stringIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
const ToolMcpConnectorIDConnectorDropbox ToolMcpConnectorID = "connector_dropbox" -
const ToolMcpConnectorIDConnectorGmail ToolMcpConnectorID = "connector_gmail" -
const ToolMcpConnectorIDConnectorGooglecalendar ToolMcpConnectorID = "connector_googlecalendar" -
const ToolMcpConnectorIDConnectorGoogledrive ToolMcpConnectorID = "connector_googledrive" -
const ToolMcpConnectorIDConnectorMicrosoftteams ToolMcpConnectorID = "connector_microsoftteams" -
const ToolMcpConnectorIDConnectorOutlookcalendar ToolMcpConnectorID = "connector_outlookcalendar" -
const ToolMcpConnectorIDConnectorOutlookemail ToolMcpConnectorID = "connector_outlookemail" -
const ToolMcpConnectorIDConnectorSharepoint ToolMcpConnectorID = "connector_sharepoint"
-
-
DeferLoading boolWhether this MCP tool is deferred and discovered via tool search.
-
Headers map[string, string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
RequireApproval ToolMcpRequireApprovalUnionSpecify which of the MCP server's tools require approval.
-
type ToolMcpRequireApprovalMcpToolApprovalFilter 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.-
Always ToolMcpRequireApprovalMcpToolApprovalFilterAlwaysA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
Never ToolMcpRequireApprovalMcpToolApprovalFilterNeverA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
type ToolMcpRequireApprovalMcpToolApprovalSetting stringSpecify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
const ToolMcpRequireApprovalMcpToolApprovalSettingAlways ToolMcpRequireApprovalMcpToolApprovalSetting = "always" -
const ToolMcpRequireApprovalMcpToolApprovalSettingNever ToolMcpRequireApprovalMcpToolApprovalSetting = "never"
-
-
-
ServerDescription stringOptional description of the MCP server, used to provide more context.
-
ServerURL stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
TunnelID stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
Container ToolCodeInterpreterContainerUnionThe code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
string -
type ToolCodeInterpreterContainerCodeInterpreterContainerAuto struct{…}Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
Type AutoAlways
auto.const AutoAuto Auto = "auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit stringThe memory limit for the code interpreter container.
-
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"
-
-
NetworkPolicy ToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…}-
Type DisabledDisable outbound network access. Always
disabled.const DisabledDisabled Disabled = "disabled"
-
-
type ContainerNetworkPolicyAllowlist struct{…}-
AllowedDomains []stringA list of allowed domains when type is
allowlist. -
Type AllowlistAllow outbound network access only to specified domains. Always
allowlist.const AllowlistAllowlist Allowlist = "allowlist"
-
DomainSecrets []ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
Domain stringThe domain associated with the secret.
-
Name stringThe name of the secret to inject for the domain.
-
Value stringThe secret value to inject for the domain.
-
-
-
-
-
-
Type CodeInterpreterThe type of the code interpreter tool. Always
code_interpreter.const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"
-
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
Type ImageGenerationThe type of the image generation tool. Always
image_generation.const ImageGenerationImageGeneration ImageGeneration = "image_generation"
-
Action stringWhether to generate a new image or edit an existing image. Default:
auto.-
const ToolImageGenerationActionGenerate ToolImageGenerationAction = "generate" -
const ToolImageGenerationActionEdit ToolImageGenerationAction = "edit" -
const ToolImageGenerationActionAuto ToolImageGenerationAction = "auto"
-
-
Background stringAllows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
const ToolImageGenerationBackgroundTransparent ToolImageGenerationBackground = "transparent" -
const ToolImageGenerationBackgroundOpaque ToolImageGenerationBackground = "opaque" -
const ToolImageGenerationBackgroundAuto ToolImageGenerationBackground = "auto"
-
-
InputFidelity stringControl how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
const ToolImageGenerationInputFidelityHigh ToolImageGenerationInputFidelity = "high" -
const ToolImageGenerationInputFidelityLow ToolImageGenerationInputFidelity = "low"
-
-
InputImageMask ToolImageGenerationInputImageMaskOptional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
FileID stringFile ID for the mask image.
-
ImageURL stringBase64-encoded mask image.
-
-
Model stringThe image generation model to use. Default:
gpt-image-1.-
string -
string-
const ToolImageGenerationModelGPTImage1 ToolImageGenerationModel = "gpt-image-1" -
const ToolImageGenerationModelGPTImage1Mini ToolImageGenerationModel = "gpt-image-1-mini" -
const ToolImageGenerationModelGPTImage2 ToolImageGenerationModel = "gpt-image-2" -
const ToolImageGenerationModelGPTImage2_2026_04_21 ToolImageGenerationModel = "gpt-image-2-2026-04-21" -
const ToolImageGenerationModelGPTImage1_5 ToolImageGenerationModel = "gpt-image-1.5" -
const ToolImageGenerationModelChatgptImageLatest ToolImageGenerationModel = "chatgpt-image-latest"
-
-
-
Moderation stringModeration level for the generated image. Default:
auto.-
const ToolImageGenerationModerationAuto ToolImageGenerationModeration = "auto" -
const ToolImageGenerationModerationLow ToolImageGenerationModeration = "low"
-
-
OutputCompression int64Compression level for the output image. Default: 100.
-
OutputFormat stringThe output format of the generated image. One of
png,webp, orjpeg. Default:png.-
const ToolImageGenerationOutputFormatPNG ToolImageGenerationOutputFormat = "png" -
const ToolImageGenerationOutputFormatWebP ToolImageGenerationOutputFormat = "webp" -
const ToolImageGenerationOutputFormatJPEG ToolImageGenerationOutputFormat = "jpeg"
-
-
PartialImages int64Number of partial images to generate in streaming mode, from 0 (default value) to 3.
-
Quality stringThe quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
const ToolImageGenerationQualityLow ToolImageGenerationQuality = "low" -
const ToolImageGenerationQualityMedium ToolImageGenerationQuality = "medium" -
const ToolImageGenerationQualityHigh ToolImageGenerationQuality = "high" -
const ToolImageGenerationQualityAuto ToolImageGenerationQuality = "auto"
-
-
Size stringThe size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
string -
string-
const ToolImageGenerationSize1024x1024 ToolImageGenerationSize = "1024x1024" -
const ToolImageGenerationSize1024x1536 ToolImageGenerationSize = "1024x1536" -
const ToolImageGenerationSize1536x1024 ToolImageGenerationSize = "1536x1024" -
const ToolImageGenerationSizeAuto ToolImageGenerationSize = "auto"
-
-
-
-
type ToolLocalShell struct{…}A tool that allows the model to execute shell commands in a local environment.
-
Type LocalShellThe type of the local shell tool. Always
local_shell.const LocalShellLocalShell LocalShell = "local_shell"
-
-
type FunctionShellTool struct{…}A tool that allows the model to execute shell commands.
-
Type ShellThe type of the shell tool. Always
shell.const ShellShell Shell = "shell"
-
Environment FunctionShellToolEnvironmentUnion-
type ContainerAuto struct{…}-
Type ContainerAutoAutomatically creates a container for this request
const ContainerAutoContainerAuto ContainerAuto = "container_auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit ContainerAutoMemoryLimitThe memory limit for the container.
-
const ContainerAutoMemoryLimit1g ContainerAutoMemoryLimit = "1g" -
const ContainerAutoMemoryLimit4g ContainerAutoMemoryLimit = "4g" -
const ContainerAutoMemoryLimit16g ContainerAutoMemoryLimit = "16g" -
const ContainerAutoMemoryLimit64g ContainerAutoMemoryLimit = "64g"
-
-
NetworkPolicy ContainerAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…} -
type ContainerNetworkPolicyAllowlist struct{…}
-
-
Skills []ContainerAutoSkillUnionAn optional list of skills referenced by id or inline data.
-
type SkillReference struct{…}-
SkillID stringThe ID of the referenced skill.
-
Type SkillReferenceReferences a skill created with the /v1/skills endpoint.
const SkillReferenceSkillReference SkillReference = "skill_reference"
-
Version stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
type InlineSkill struct{…}-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Source InlineSkillSourceInline skill payload
-
Data stringBase64-encoded skill zip bundle.
-
MediaType ApplicationZipThe media type of the inline skill payload. Must be
application/zip.const ApplicationZipApplicationZip ApplicationZip = "application/zip"
-
Type Base64The type of the inline skill source. Must be
base64.const Base64Base64 Base64 = "base64"
-
-
Type InlineDefines an inline skill for this request.
const InlineInline Inline = "inline"
-
-
-
-
type LocalEnvironment struct{…}-
Type LocalUse a local computer environment.
const LocalLocal Local = "local"
-
Skills []LocalSkillAn optional list of skills.
-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Path stringThe path to the directory containing the skill.
-
-
-
type ContainerReference struct{…}-
ContainerID stringThe ID of the referenced container.
-
Type ContainerReferenceReferences a container created with the /v1/containers endpoint
const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
Name stringThe name of the custom tool, used to identify it in tool calls.
-
Type CustomThe type of the custom tool. Always
custom.const CustomCustom Custom = "custom"
-
DeferLoading boolWhether this tool should be deferred and discovered via tool search.
-
Description stringOptional description of the custom tool, used to provide more context.
-
Format CustomToolInputFormatUnionThe input format for the custom tool. Default is unconstrained text.
-
type CustomToolInputFormatText struct{…}Unconstrained free-form text.
-
Type TextUnconstrained text format. Always
text.const TextText Text = "text"
-
-
type CustomToolInputFormatGrammar struct{…}A grammar defined by the user.
-
Definition stringThe grammar definition.
-
Syntax stringThe syntax of the grammar definition. One of
larkorregex.-
const CustomToolInputFormatGrammarSyntaxLark CustomToolInputFormatGrammarSyntax = "lark" -
const CustomToolInputFormatGrammarSyntaxRegex CustomToolInputFormatGrammarSyntax = "regex"
-
-
Type GrammarGrammar format. Always
grammar.const GrammarGrammar Grammar = "grammar"
-
-
-
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
Description stringA description of the namespace shown to the model.
-
Name stringThe namespace name used in tool calls (for example,
crm). -
Tools []NamespaceToolToolUnionThe function/custom tools available inside this namespace.
-
type NamespaceToolToolFunction struct{…}-
Name string -
Type Functionconst FunctionFunction Function = "function"
-
DeferLoading boolWhether this function should be deferred and discovered via tool search.
-
Description string -
Parameters any -
Strict bool
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
-
Type NamespaceThe type of the tool. Always
namespace.const NamespaceNamespace Namespace = "namespace"
-
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
Type ToolSearchThe type of the tool. Always
tool_search.const ToolSearchToolSearch ToolSearch = "tool_search"
-
Description stringDescription shown to the model for a client-executed tool search tool.
-
Execution ToolSearchToolExecutionWhether tool search is executed by the server or by the client.
-
const ToolSearchToolExecutionServer ToolSearchToolExecution = "server" -
const ToolSearchToolExecutionClient ToolSearchToolExecution = "client"
-
-
Parameters anyParameter schema for a client-executed tool search tool.
-
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
Type WebSearchPreviewToolTypeThe type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
const WebSearchPreviewToolTypeWebSearchPreview WebSearchPreviewToolType = "web_search_preview" -
const WebSearchPreviewToolTypeWebSearchPreview2025_03_11 WebSearchPreviewToolType = "web_search_preview_2025_03_11"
-
-
SearchContentTypes []string-
const WebSearchPreviewToolSearchContentTypeText WebSearchPreviewToolSearchContentType = "text" -
const WebSearchPreviewToolSearchContentTypeImage WebSearchPreviewToolSearchContentType = "image"
-
-
SearchContextSize WebSearchPreviewToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchPreviewToolSearchContextSizeLow WebSearchPreviewToolSearchContextSize = "low" -
const WebSearchPreviewToolSearchContextSizeMedium WebSearchPreviewToolSearchContextSize = "medium" -
const WebSearchPreviewToolSearchContextSizeHigh WebSearchPreviewToolSearchContextSize = "high"
-
-
UserLocation WebSearchPreviewToolUserLocationThe user's location.
-
Type ApproximateThe type of location approximation. Always
approximate.const ApproximateApproximate Approximate = "approximate"
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
Type ApplyPatchThe type of the tool. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
-
Type ToolSearchOutputThe item type. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
ID stringThe unique ID of this tool search output.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemParamExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemParamExecutionServer ResponseToolSearchOutputItemParamExecution = "server" -
const ResponseToolSearchOutputItemParamExecutionClient ResponseToolSearchOutputItemParamExecution = "client"
-
-
Status ResponseToolSearchOutputItemParamStatusThe status of the tool search output.
-
const ResponseToolSearchOutputItemParamStatusInProgress ResponseToolSearchOutputItemParamStatus = "in_progress" -
const ResponseToolSearchOutputItemParamStatusCompleted ResponseToolSearchOutputItemParamStatus = "completed" -
const ResponseToolSearchOutputItemParamStatusIncomplete ResponseToolSearchOutputItemParamStatus = "incomplete"
-
-
-
type ResponseInputItemAdditionalTools struct{…}-
Role DeveloperThe role that provided the additional tools. Only
developeris supported.const DeveloperDeveloper Developer = "developer"
-
Tools []ToolUnionA list of additional tools made available at this item.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type AdditionalToolsThe item type. Always
additional_tools.const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"
-
ID stringThe unique ID of this additional tools item.
-
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
ID stringThe unique identifier of the reasoning content.
-
Summary []ResponseReasoningItemSummaryReasoning summary content.
-
Text stringA summary of the reasoning output from the model so far.
-
Type SummaryTextThe type of the object. Always
summary_text.const SummaryTextSummaryText SummaryText = "summary_text"
-
-
Type ReasoningThe type of the object. Always
reasoning.const ReasoningReasoning Reasoning = "reasoning"
-
Content []ResponseReasoningItemContentReasoning text content.
-
Text stringThe reasoning text from the model.
-
Type ReasoningTextThe type of the reasoning text. Always
reasoning_text.const ReasoningTextReasoningText ReasoningText = "reasoning_text"
-
-
EncryptedContent stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
Status ResponseReasoningItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseReasoningItemStatusInProgress ResponseReasoningItemStatus = "in_progress" -
const ResponseReasoningItemStatusCompleted ResponseReasoningItemStatus = "completed" -
const ResponseReasoningItemStatusIncomplete ResponseReasoningItemStatus = "incomplete"
-
-
-
type ResponseCompactionItemParamResp struct{…}A compaction item generated by the
v1/responses/compactAPI.-
EncryptedContent stringThe encrypted content of the compaction summary.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
ID stringThe ID of the compaction item.
-
-
type ResponseInputItemImageGenerationCall struct{…}An image generation request made by the model.
-
ID stringThe unique ID of the image generation call.
-
Result stringThe generated image encoded in base64.
-
Status stringThe status of the image generation call.
-
const ResponseInputItemImageGenerationCallStatusInProgress ResponseInputItemImageGenerationCallStatus = "in_progress" -
const ResponseInputItemImageGenerationCallStatusCompleted ResponseInputItemImageGenerationCallStatus = "completed" -
const ResponseInputItemImageGenerationCallStatusGenerating ResponseInputItemImageGenerationCallStatus = "generating" -
const ResponseInputItemImageGenerationCallStatusFailed ResponseInputItemImageGenerationCallStatus = "failed"
-
-
Type ImageGenerationCallThe type of the image generation call. Always
image_generation_call.const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"
-
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
ID stringThe unique ID of the code interpreter tool call.
-
Code stringThe code to run, or null if not available.
-
ContainerID stringThe ID of the container used to run the code.
-
Outputs []ResponseCodeInterpreterToolCallOutputUnionThe outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
type ResponseCodeInterpreterToolCallOutputLogs struct{…}The logs output from the code interpreter.
-
Logs stringThe logs output from the code interpreter.
-
Type LogsThe type of the output. Always
logs.const LogsLogs Logs = "logs"
-
-
type ResponseCodeInterpreterToolCallOutputImage struct{…}The image output from the code interpreter.
-
Type ImageThe type of the output. Always
image.const ImageImage Image = "image"
-
URL stringThe URL of the image output from the code interpreter.
-
-
-
Status ResponseCodeInterpreterToolCallStatusThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
const ResponseCodeInterpreterToolCallStatusInProgress ResponseCodeInterpreterToolCallStatus = "in_progress" -
const ResponseCodeInterpreterToolCallStatusCompleted ResponseCodeInterpreterToolCallStatus = "completed" -
const ResponseCodeInterpreterToolCallStatusIncomplete ResponseCodeInterpreterToolCallStatus = "incomplete" -
const ResponseCodeInterpreterToolCallStatusInterpreting ResponseCodeInterpreterToolCallStatus = "interpreting" -
const ResponseCodeInterpreterToolCallStatusFailed ResponseCodeInterpreterToolCallStatus = "failed"
-
-
Type CodeInterpreterCallThe type of the code interpreter tool call. Always
code_interpreter_call.const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"
-
-
type ResponseInputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
ID stringThe unique ID of the local shell call.
-
Action ResponseInputItemLocalShellCallActionExecute a shell command on the server.
-
Command []stringThe command to run.
-
Env map[string, string]Environment variables to set for the command.
-
Type ExecThe type of the local shell action. Always
exec.const ExecExec Exec = "exec"
-
TimeoutMs int64Optional timeout in milliseconds for the command.
-
User stringOptional user to run the command as.
-
WorkingDirectory stringOptional working directory to run the command in.
-
-
CallID stringThe unique ID of the local shell tool call generated by the model.
-
Status stringThe status of the local shell call.
-
const ResponseInputItemLocalShellCallStatusInProgress ResponseInputItemLocalShellCallStatus = "in_progress" -
const ResponseInputItemLocalShellCallStatusCompleted ResponseInputItemLocalShellCallStatus = "completed" -
const ResponseInputItemLocalShellCallStatusIncomplete ResponseInputItemLocalShellCallStatus = "incomplete"
-
-
Type LocalShellCallThe type of the local shell call. Always
local_shell_call.const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"
-
-
type ResponseInputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
ID stringThe unique ID of the local shell tool call generated by the model.
-
Output stringA JSON string of the output of the local shell tool call.
-
Type LocalShellCallOutputThe type of the local shell tool call output. Always
local_shell_call_output.const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete.-
const ResponseInputItemLocalShellCallOutputStatusInProgress ResponseInputItemLocalShellCallOutputStatus = "in_progress" -
const ResponseInputItemLocalShellCallOutputStatusCompleted ResponseInputItemLocalShellCallOutputStatus = "completed" -
const ResponseInputItemLocalShellCallOutputStatusIncomplete ResponseInputItemLocalShellCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemShellCall struct{…}A tool representing a request to execute one or more shell commands.
-
Action ResponseInputItemShellCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []stringOrdered shell commands for the execution environment to run.
-
MaxOutputLength int64Maximum number of UTF-8 characters to capture from combined stdout and stderr output.
-
TimeoutMs int64Maximum wall-clock time in milliseconds to allow the shell commands to run.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Environment ResponseInputItemShellCallEnvironmentUnionThe environment to execute the shell commands in.
-
type LocalEnvironment struct{…} -
type ContainerReference struct{…}
-
-
Status stringThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseInputItemShellCallStatusInProgress ResponseInputItemShellCallStatus = "in_progress" -
const ResponseInputItemShellCallStatusCompleted ResponseInputItemShellCallStatus = "completed" -
const ResponseInputItemShellCallStatusIncomplete ResponseInputItemShellCallStatus = "incomplete"
-
-
-
type ResponseInputItemShellCallOutput struct{…}The streamed output items emitted by a shell tool call.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Output []ResponseFunctionShellCallOutputContentCaptured chunks of stdout and stderr output, along with their associated outcomes.
-
Outcome ResponseFunctionShellCallOutputContentOutcomeUnionThe exit or timeout outcome associated with this shell call.
-
type ResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellCallOutputContentOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64The exit code returned by the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringCaptured stderr output for the shell call.
-
Stdout stringCaptured stdout output for the shell call.
-
-
Type ShellCallOutputThe type of the item. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
ID stringThe unique ID of the shell tool call output. Populated when this item is returned via API.
-
MaxOutputLength int64The maximum number of UTF-8 characters captured for this shell call's combined output.
-
Status stringThe status of the shell call output.
-
const ResponseInputItemShellCallOutputStatusInProgress ResponseInputItemShellCallOutputStatus = "in_progress" -
const ResponseInputItemShellCallOutputStatusCompleted ResponseInputItemShellCallOutputStatus = "completed" -
const ResponseInputItemShellCallOutputStatusIncomplete ResponseInputItemShellCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemApplyPatchCall struct{…}A tool call representing a request to create, delete, or update files using diff patches.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseInputItemApplyPatchCallOperationUnionThe specific create, delete, or update instruction for the apply_patch tool call.
-
type ResponseInputItemApplyPatchCallOperationCreateFile struct{…}Instruction for creating a new file via the apply_patch tool.
-
Diff stringUnified diff content to apply when creating the file.
-
Path stringPath of the file to create relative to the workspace root.
-
Type CreateFileThe operation type. Always
create_file.const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseInputItemApplyPatchCallOperationDeleteFile struct{…}Instruction for deleting an existing file via the apply_patch tool.
-
Path stringPath of the file to delete relative to the workspace root.
-
Type DeleteFileThe operation type. Always
delete_file.const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseInputItemApplyPatchCallOperationUpdateFile struct{…}Instruction for updating an existing file via the apply_patch tool.
-
Diff stringUnified diff content to apply to the existing file.
-
Path stringPath of the file to update relative to the workspace root.
-
Type UpdateFileThe operation type. Always
update_file.const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status stringThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseInputItemApplyPatchCallStatusInProgress ResponseInputItemApplyPatchCallStatus = "in_progress" -
const ResponseInputItemApplyPatchCallStatusCompleted ResponseInputItemApplyPatchCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
-
type ResponseInputItemApplyPatchCallOutput struct{…}The streamed output emitted by an apply patch tool call.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status stringThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseInputItemApplyPatchCallOutputStatusCompleted ResponseInputItemApplyPatchCallOutputStatus = "completed" -
const ResponseInputItemApplyPatchCallOutputStatusFailed ResponseInputItemApplyPatchCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
Output stringOptional human-readable log text from the apply patch tool (e.g., patch results or errors).
-
-
type ResponseInputItemMcpListTools struct{…}A list of tools available on an MCP server.
-
ID stringThe unique ID of the list.
-
ServerLabel stringThe label of the MCP server.
-
Tools []ResponseInputItemMcpListToolsToolThe tools available on the server.
-
InputSchema anyThe JSON schema describing the tool's input.
-
Name stringThe name of the tool.
-
Annotations anyAdditional annotations about the tool.
-
Description stringThe description of the tool.
-
-
Type McpListToolsThe type of the item. Always
mcp_list_tools.const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
-
Error stringError message if the server could not list tools.
-
-
type ResponseInputItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
ID stringThe unique ID of the approval request.
-
Arguments stringA JSON string of arguments for the tool.
-
Name stringThe name of the tool to run.
-
ServerLabel stringThe label of the MCP server making the request.
-
Type McpApprovalRequestThe type of the item. Always
mcp_approval_request.const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"
-
-
type ResponseInputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
ApprovalRequestID stringThe ID of the approval request being answered.
-
Approve boolWhether the request was approved.
-
Type McpApprovalResponseThe type of the item. Always
mcp_approval_response.const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
-
ID stringThe unique ID of the approval response
-
Reason stringOptional reason for the decision.
-
-
type ResponseInputItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
ID stringThe unique ID of the tool call.
-
Arguments stringA JSON string of the arguments passed to the tool.
-
Name stringThe name of the tool that was run.
-
ServerLabel stringThe label of the MCP server running the tool.
-
Type McpCallThe type of the item. Always
mcp_call.const McpCallMcpCall McpCall = "mcp_call"
-
ApprovalRequestID stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
Error stringThe error from the tool call, if any.
-
Output stringThe output from the tool call.
-
Status stringThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
const ResponseInputItemMcpCallStatusInProgress ResponseInputItemMcpCallStatus = "in_progress" -
const ResponseInputItemMcpCallStatusCompleted ResponseInputItemMcpCallStatus = "completed" -
const ResponseInputItemMcpCallStatusIncomplete ResponseInputItemMcpCallStatus = "incomplete" -
const ResponseInputItemMcpCallStatusCalling ResponseInputItemMcpCallStatus = "calling" -
const ResponseInputItemMcpCallStatusFailed ResponseInputItemMcpCallStatus = "failed"
-
-
-
type ResponseCustomToolCallOutput struct{…}The output of a custom tool call from your code, being sent back to the model.
-
CallID stringThe call ID, used to map this custom tool call output to a custom tool call.
-
Output ResponseCustomToolCallOutputOutputUnionThe output from the custom tool call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseCustomToolCallOutputOutputOutputContentList []ResponseCustomToolCallOutputOutputOutputContentListItemUnionText, image, or file output of the custom tool call.
-
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
-
Type CustomToolCallOutputThe type of the custom tool call output. Always
custom_tool_call_output.const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"
-
ID stringThe unique ID of the custom tool call output in the OpenAI platform.
-
-
type ResponseCustomToolCall struct{…}A call to a custom tool created by the model.
-
CallID stringAn identifier used to map this custom tool call to a tool call output.
-
Input stringThe input for the custom tool call generated by the model.
-
Name stringThe name of the custom tool being called.
-
Type CustomToolCallThe type of the custom tool call. Always
custom_tool_call.const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"
-
ID stringThe unique ID of the custom tool call in the OpenAI platform.
-
Namespace stringThe namespace of the custom tool being called.
-
-
type ResponseInputItemCompactionTrigger struct{…}Compacts the current context. Must be the final input item.
-
Type CompactionTriggerThe type of the item. Always
compaction_trigger.const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"
-
-
type ResponseInputItemItemReference struct{…}An internal identifier for an item to reference.
-
ID stringThe ID of the item to reference.
-
Type stringThe type of item to reference. Always
item_reference.const ResponseInputItemItemReferenceTypeItemReference ResponseInputItemItemReferenceType = "item_reference"
-
-
-
-
Metadata MetadataSet of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
-
Model ResponsesModelModel ID used to generate the response, like
gpt-4ooro3. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models.-
string -
type ChatModel string-
const ChatModelGPT5_4 ChatModel = "gpt-5.4" -
const ChatModelGPT5_4Mini ChatModel = "gpt-5.4-mini" -
const ChatModelGPT5_4Nano ChatModel = "gpt-5.4-nano" -
const ChatModelGPT5_4Mini2026_03_17 ChatModel = "gpt-5.4-mini-2026-03-17" -
const ChatModelGPT5_4Nano2026_03_17 ChatModel = "gpt-5.4-nano-2026-03-17" -
const ChatModelGPT5_3ChatLatest ChatModel = "gpt-5.3-chat-latest" -
const ChatModelGPT5_2 ChatModel = "gpt-5.2" -
const ChatModelGPT5_2_2025_12_11 ChatModel = "gpt-5.2-2025-12-11" -
const ChatModelGPT5_2ChatLatest ChatModel = "gpt-5.2-chat-latest" -
const ChatModelGPT5_2Pro ChatModel = "gpt-5.2-pro" -
const ChatModelGPT5_2Pro2025_12_11 ChatModel = "gpt-5.2-pro-2025-12-11" -
const ChatModelGPT5_1 ChatModel = "gpt-5.1" -
const ChatModelGPT5_1_2025_11_13 ChatModel = "gpt-5.1-2025-11-13" -
const ChatModelGPT5_1Codex ChatModel = "gpt-5.1-codex" -
const ChatModelGPT5_1Mini ChatModel = "gpt-5.1-mini" -
const ChatModelGPT5_1ChatLatest ChatModel = "gpt-5.1-chat-latest" -
const ChatModelGPT5 ChatModel = "gpt-5" -
const ChatModelGPT5Mini ChatModel = "gpt-5-mini" -
const ChatModelGPT5Nano ChatModel = "gpt-5-nano" -
const ChatModelGPT5_2025_08_07 ChatModel = "gpt-5-2025-08-07" -
const ChatModelGPT5Mini2025_08_07 ChatModel = "gpt-5-mini-2025-08-07" -
const ChatModelGPT5Nano2025_08_07 ChatModel = "gpt-5-nano-2025-08-07" -
const ChatModelGPT5ChatLatest ChatModel = "gpt-5-chat-latest" -
const ChatModelGPT4_1 ChatModel = "gpt-4.1" -
const ChatModelGPT4_1Mini ChatModel = "gpt-4.1-mini" -
const ChatModelGPT4_1Nano ChatModel = "gpt-4.1-nano" -
const ChatModelGPT4_1_2025_04_14 ChatModel = "gpt-4.1-2025-04-14" -
const ChatModelGPT4_1Mini2025_04_14 ChatModel = "gpt-4.1-mini-2025-04-14" -
const ChatModelGPT4_1Nano2025_04_14 ChatModel = "gpt-4.1-nano-2025-04-14" -
const ChatModelO4Mini ChatModel = "o4-mini" -
const ChatModelO4Mini2025_04_16 ChatModel = "o4-mini-2025-04-16" -
const ChatModelO3 ChatModel = "o3" -
const ChatModelO3_2025_04_16 ChatModel = "o3-2025-04-16" -
const ChatModelO3Mini ChatModel = "o3-mini" -
const ChatModelO3Mini2025_01_31 ChatModel = "o3-mini-2025-01-31" -
const ChatModelO1 ChatModel = "o1" -
const ChatModelO1_2024_12_17 ChatModel = "o1-2024-12-17" -
const ChatModelO1Preview ChatModel = "o1-preview" -
const ChatModelO1Preview2024_09_12 ChatModel = "o1-preview-2024-09-12" -
const ChatModelO1Mini ChatModel = "o1-mini" -
const ChatModelO1Mini2024_09_12 ChatModel = "o1-mini-2024-09-12" -
const ChatModelGPT4o ChatModel = "gpt-4o" -
const ChatModelGPT4o2024_11_20 ChatModel = "gpt-4o-2024-11-20" -
const ChatModelGPT4o2024_08_06 ChatModel = "gpt-4o-2024-08-06" -
const ChatModelGPT4o2024_05_13 ChatModel = "gpt-4o-2024-05-13" -
const ChatModelGPT4oAudioPreview ChatModel = "gpt-4o-audio-preview" -
const ChatModelGPT4oAudioPreview2024_10_01 ChatModel = "gpt-4o-audio-preview-2024-10-01" -
const ChatModelGPT4oAudioPreview2024_12_17 ChatModel = "gpt-4o-audio-preview-2024-12-17" -
const ChatModelGPT4oAudioPreview2025_06_03 ChatModel = "gpt-4o-audio-preview-2025-06-03" -
const ChatModelGPT4oMiniAudioPreview ChatModel = "gpt-4o-mini-audio-preview" -
const ChatModelGPT4oMiniAudioPreview2024_12_17 ChatModel = "gpt-4o-mini-audio-preview-2024-12-17" -
const ChatModelGPT4oSearchPreview ChatModel = "gpt-4o-search-preview" -
const ChatModelGPT4oMiniSearchPreview ChatModel = "gpt-4o-mini-search-preview" -
const ChatModelGPT4oSearchPreview2025_03_11 ChatModel = "gpt-4o-search-preview-2025-03-11" -
const ChatModelGPT4oMiniSearchPreview2025_03_11 ChatModel = "gpt-4o-mini-search-preview-2025-03-11" -
const ChatModelChatgpt4oLatest ChatModel = "chatgpt-4o-latest" -
const ChatModelCodexMiniLatest ChatModel = "codex-mini-latest" -
const ChatModelGPT4oMini ChatModel = "gpt-4o-mini" -
const ChatModelGPT4oMini2024_07_18 ChatModel = "gpt-4o-mini-2024-07-18" -
const ChatModelGPT4Turbo ChatModel = "gpt-4-turbo" -
const ChatModelGPT4Turbo2024_04_09 ChatModel = "gpt-4-turbo-2024-04-09" -
const ChatModelGPT4_0125Preview ChatModel = "gpt-4-0125-preview" -
const ChatModelGPT4TurboPreview ChatModel = "gpt-4-turbo-preview" -
const ChatModelGPT4_1106Preview ChatModel = "gpt-4-1106-preview" -
const ChatModelGPT4VisionPreview ChatModel = "gpt-4-vision-preview" -
const ChatModelGPT4 ChatModel = "gpt-4" -
const ChatModelGPT4_0314 ChatModel = "gpt-4-0314" -
const ChatModelGPT4_0613 ChatModel = "gpt-4-0613" -
const ChatModelGPT4_32k ChatModel = "gpt-4-32k" -
const ChatModelGPT4_32k0314 ChatModel = "gpt-4-32k-0314" -
const ChatModelGPT4_32k0613 ChatModel = "gpt-4-32k-0613" -
const ChatModelGPT3_5Turbo ChatModel = "gpt-3.5-turbo" -
const ChatModelGPT3_5Turbo16k ChatModel = "gpt-3.5-turbo-16k" -
const ChatModelGPT3_5Turbo0301 ChatModel = "gpt-3.5-turbo-0301" -
const ChatModelGPT3_5Turbo0613 ChatModel = "gpt-3.5-turbo-0613" -
const ChatModelGPT3_5Turbo1106 ChatModel = "gpt-3.5-turbo-1106" -
const ChatModelGPT3_5Turbo0125 ChatModel = "gpt-3.5-turbo-0125" -
const ChatModelGPT3_5Turbo16k0613 ChatModel = "gpt-3.5-turbo-16k-0613"
-
-
type ResponsesModel string-
const ResponsesModelO1Pro ResponsesModel = "o1-pro" -
const ResponsesModelO1Pro2025_03_19 ResponsesModel = "o1-pro-2025-03-19" -
const ResponsesModelO3Pro ResponsesModel = "o3-pro" -
const ResponsesModelO3Pro2025_06_10 ResponsesModel = "o3-pro-2025-06-10" -
const ResponsesModelO3DeepResearch ResponsesModel = "o3-deep-research" -
const ResponsesModelO3DeepResearch2025_06_26 ResponsesModel = "o3-deep-research-2025-06-26" -
const ResponsesModelO4MiniDeepResearch ResponsesModel = "o4-mini-deep-research" -
const ResponsesModelO4MiniDeepResearch2025_06_26 ResponsesModel = "o4-mini-deep-research-2025-06-26" -
const ResponsesModelComputerUsePreview ResponsesModel = "computer-use-preview" -
const ResponsesModelComputerUsePreview2025_03_11 ResponsesModel = "computer-use-preview-2025-03-11" -
const ResponsesModelGPT5Codex ResponsesModel = "gpt-5-codex" -
const ResponsesModelGPT5Pro ResponsesModel = "gpt-5-pro" -
const ResponsesModelGPT5Pro2025_10_06 ResponsesModel = "gpt-5-pro-2025-10-06" -
const ResponsesModelGPT5_1CodexMax ResponsesModel = "gpt-5.1-codex-max"
-
-
-
Object ResponseThe object type of this resource - always set to
response.const ResponseResponse Response = "response"
-
Output []ResponseOutputItemUnionAn array of content items generated by the model.
-
The length and order of items in the
outputarray is dependent on the model's response. -
Rather than accessing the first item in the
outputarray and assuming it's anassistantmessage with the content generated by the model, you might consider using theoutput_textproperty where supported in SDKs. -
type ResponseOutputMessage struct{…}An output message from the model.
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
type ResponseFunctionToolCall struct{…}A tool call to run a function. See the function calling guide for more information.
-
type ResponseFunctionToolCallOutputItem struct{…}-
ID stringThe unique ID of the function call tool output.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseFunctionToolCallOutputItemOutputUnionThe output from the function call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseFunctionToolCallOutputItemOutputOutputContentList []ResponseFunctionToolCallOutputItemOutputOutputContentListItemUnionText, image, or file output of the function call.
-
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
-
Status ResponseFunctionToolCallOutputItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallOutputItemStatusInProgress ResponseFunctionToolCallOutputItemStatus = "in_progress" -
const ResponseFunctionToolCallOutputItemStatusCompleted ResponseFunctionToolCallOutputItemStatus = "completed" -
const ResponseFunctionToolCallOutputItemStatusIncomplete ResponseFunctionToolCallOutputItemStatus = "incomplete"
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
type ResponseComputerToolCallOutputItem struct{…}-
ID stringThe unique ID of the computer call tool output.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Status ResponseComputerToolCallOutputItemStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseComputerToolCallOutputItemStatusCompleted ResponseComputerToolCallOutputItemStatus = "completed" -
const ResponseComputerToolCallOutputItemStatusIncomplete ResponseComputerToolCallOutputItemStatus = "incomplete" -
const ResponseComputerToolCallOutputItemStatusFailed ResponseComputerToolCallOutputItemStatus = "failed" -
const ResponseComputerToolCallOutputItemStatusInProgress ResponseComputerToolCallOutputItemStatus = "in_progress"
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
AcknowledgedSafetyChecks []ResponseComputerToolCallOutputItemAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context. -
type ResponseToolSearchCall struct{…}-
ID stringThe unique ID of the tool search call item.
-
Arguments anyArguments used for the tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchCallExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchCallExecutionServer ResponseToolSearchCallExecution = "server" -
const ResponseToolSearchCallExecutionClient ResponseToolSearchCallExecution = "client"
-
-
Status ResponseToolSearchCallStatusThe status of the tool search call item that was recorded.
-
const ResponseToolSearchCallStatusInProgress ResponseToolSearchCallStatus = "in_progress" -
const ResponseToolSearchCallStatusCompleted ResponseToolSearchCallStatus = "completed" -
const ResponseToolSearchCallStatusIncomplete ResponseToolSearchCallStatus = "incomplete"
-
-
Type ToolSearchCallThe type of the item. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseToolSearchOutputItem struct{…}-
ID stringThe unique ID of the tool search output item.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemExecutionServer ResponseToolSearchOutputItemExecution = "server" -
const ResponseToolSearchOutputItemExecutionClient ResponseToolSearchOutputItemExecution = "client"
-
-
Status ResponseToolSearchOutputItemStatusThe status of the tool search output item that was recorded.
-
const ResponseToolSearchOutputItemStatusInProgress ResponseToolSearchOutputItemStatus = "in_progress" -
const ResponseToolSearchOutputItemStatusCompleted ResponseToolSearchOutputItemStatus = "completed" -
const ResponseToolSearchOutputItemStatusIncomplete ResponseToolSearchOutputItemStatus = "incomplete"
-
-
Tools []ToolUnionThe loaded tool definitions returned by tool search.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type ToolSearchOutputThe type of the item. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseOutputItemAdditionalTools struct{…}-
ID stringThe unique ID of the additional tools item.
-
Role stringThe role that provided the additional tools.
-
const ResponseOutputItemAdditionalToolsRoleUnknown ResponseOutputItemAdditionalToolsRole = "unknown" -
const ResponseOutputItemAdditionalToolsRoleUser ResponseOutputItemAdditionalToolsRole = "user" -
const ResponseOutputItemAdditionalToolsRoleAssistant ResponseOutputItemAdditionalToolsRole = "assistant" -
const ResponseOutputItemAdditionalToolsRoleSystem ResponseOutputItemAdditionalToolsRole = "system" -
const ResponseOutputItemAdditionalToolsRoleCritic ResponseOutputItemAdditionalToolsRole = "critic" -
const ResponseOutputItemAdditionalToolsRoleDiscriminator ResponseOutputItemAdditionalToolsRole = "discriminator" -
const ResponseOutputItemAdditionalToolsRoleDeveloper ResponseOutputItemAdditionalToolsRole = "developer" -
const ResponseOutputItemAdditionalToolsRoleTool ResponseOutputItemAdditionalToolsRole = "tool"
-
-
Tools []ToolUnionThe additional tool definitions made available at this item.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type AdditionalToolsThe type of the item. Always
additional_tools.const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"
-
-
type ResponseCompactionItem struct{…}A compaction item generated by the
v1/responses/compactAPI.-
ID stringThe unique ID of the compaction item.
-
EncryptedContent stringThe encrypted content that was produced by compaction.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseOutputItemImageGenerationCall struct{…}An image generation request made by the model.
-
ID stringThe unique ID of the image generation call.
-
Result stringThe generated image encoded in base64.
-
Status stringThe status of the image generation call.
-
const ResponseOutputItemImageGenerationCallStatusInProgress ResponseOutputItemImageGenerationCallStatus = "in_progress" -
const ResponseOutputItemImageGenerationCallStatusCompleted ResponseOutputItemImageGenerationCallStatus = "completed" -
const ResponseOutputItemImageGenerationCallStatusGenerating ResponseOutputItemImageGenerationCallStatus = "generating" -
const ResponseOutputItemImageGenerationCallStatusFailed ResponseOutputItemImageGenerationCallStatus = "failed"
-
-
Type ImageGenerationCallThe type of the image generation call. Always
image_generation_call.const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"
-
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
type ResponseOutputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
ID stringThe unique ID of the local shell call.
-
Action ResponseOutputItemLocalShellCallActionExecute a shell command on the server.
-
Command []stringThe command to run.
-
Env map[string, string]Environment variables to set for the command.
-
Type ExecThe type of the local shell action. Always
exec.const ExecExec Exec = "exec"
-
TimeoutMs int64Optional timeout in milliseconds for the command.
-
User stringOptional user to run the command as.
-
WorkingDirectory stringOptional working directory to run the command in.
-
-
CallID stringThe unique ID of the local shell tool call generated by the model.
-
Status stringThe status of the local shell call.
-
const ResponseOutputItemLocalShellCallStatusInProgress ResponseOutputItemLocalShellCallStatus = "in_progress" -
const ResponseOutputItemLocalShellCallStatusCompleted ResponseOutputItemLocalShellCallStatus = "completed" -
const ResponseOutputItemLocalShellCallStatusIncomplete ResponseOutputItemLocalShellCallStatus = "incomplete"
-
-
Type LocalShellCallThe type of the local shell call. Always
local_shell_call.const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"
-
-
type ResponseOutputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
ID stringThe unique ID of the local shell tool call generated by the model.
-
Output stringA JSON string of the output of the local shell tool call.
-
Type LocalShellCallOutputThe type of the local shell tool call output. Always
local_shell_call_output.const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete.-
const ResponseOutputItemLocalShellCallOutputStatusInProgress ResponseOutputItemLocalShellCallOutputStatus = "in_progress" -
const ResponseOutputItemLocalShellCallOutputStatusCompleted ResponseOutputItemLocalShellCallOutputStatus = "completed" -
const ResponseOutputItemLocalShellCallOutputStatusIncomplete ResponseOutputItemLocalShellCallOutputStatus = "incomplete"
-
-
-
type ResponseFunctionShellToolCall struct{…}A tool call that executes one or more shell commands in a managed environment.
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Action ResponseFunctionShellToolCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []string -
MaxOutputLength int64Optional maximum number of characters to return from each command.
-
TimeoutMs int64Optional timeout in milliseconds for the commands.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Environment ResponseFunctionShellToolCallEnvironmentUnionRepresents the use of a local environment to perform shell actions.
-
type ResponseLocalEnvironment struct{…}Represents the use of a local environment to perform shell actions.
-
Type LocalThe environment type. Always
local.const LocalLocal Local = "local"
-
-
type ResponseContainerReference struct{…}Represents a container created with /v1/containers.
-
ContainerID string -
Type ContainerReferenceThe environment type. Always
container_reference.const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
Status ResponseFunctionShellToolCallStatusThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallStatusInProgress ResponseFunctionShellToolCallStatus = "in_progress" -
const ResponseFunctionShellToolCallStatusCompleted ResponseFunctionShellToolCallStatus = "completed" -
const ResponseFunctionShellToolCallStatusIncomplete ResponseFunctionShellToolCallStatus = "incomplete"
-
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseFunctionShellToolCallOutput struct{…}The output of a shell tool call that was emitted.
-
ID stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
MaxOutputLength int64The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
Output []ResponseFunctionShellToolCallOutputOutputAn array of shell call output contents
-
Outcome ResponseFunctionShellToolCallOutputOutputOutcomeUnionRepresents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
type ResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64Exit code from the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringThe standard error output that was captured.
-
Stdout stringThe standard output that was captured.
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
Status ResponseFunctionShellToolCallOutputStatusThe status of the shell call output. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallOutputStatusInProgress ResponseFunctionShellToolCallOutputStatus = "in_progress" -
const ResponseFunctionShellToolCallOutputStatusCompleted ResponseFunctionShellToolCallOutputStatus = "completed" -
const ResponseFunctionShellToolCallOutputStatusIncomplete ResponseFunctionShellToolCallOutputStatus = "incomplete"
-
-
Type ShellCallOutputThe type of the shell call output. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseApplyPatchToolCall struct{…}A tool call that applies file diffs by creating, deleting, or updating files.
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseApplyPatchToolCallOperationUnionOne of the create_file, delete_file, or update_file operations applied via apply_patch.
-
type ResponseApplyPatchToolCallOperationCreateFile struct{…}Instruction describing how to create a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to create.
-
Type CreateFileCreate a new file with the provided diff.
const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseApplyPatchToolCallOperationDeleteFile struct{…}Instruction describing how to delete a file via the apply_patch tool.
-
Path stringPath of the file to delete.
-
Type DeleteFileDelete the specified file.
const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseApplyPatchToolCallOperationUpdateFile struct{…}Instruction describing how to update a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to update.
-
Type UpdateFileUpdate an existing file with the provided diff.
const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status ResponseApplyPatchToolCallStatusThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseApplyPatchToolCallStatusInProgress ResponseApplyPatchToolCallStatus = "in_progress" -
const ResponseApplyPatchToolCallStatusCompleted ResponseApplyPatchToolCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseApplyPatchToolCallOutput struct{…}The output emitted by an apply patch tool call.
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status ResponseApplyPatchToolCallOutputStatusThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseApplyPatchToolCallOutputStatusCompleted ResponseApplyPatchToolCallOutputStatus = "completed" -
const ResponseApplyPatchToolCallOutputStatusFailed ResponseApplyPatchToolCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
CreatedBy stringThe ID of the entity that created this tool call output.
-
Output stringOptional textual output returned by the apply patch tool.
-
-
type ResponseOutputItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
ID stringThe unique ID of the tool call.
-
Arguments stringA JSON string of the arguments passed to the tool.
-
Name stringThe name of the tool that was run.
-
ServerLabel stringThe label of the MCP server running the tool.
-
Type McpCallThe type of the item. Always
mcp_call.const McpCallMcpCall McpCall = "mcp_call"
-
ApprovalRequestID stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
Error stringThe error from the tool call, if any.
-
Output stringThe output from the tool call.
-
Status stringThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
const ResponseOutputItemMcpCallStatusInProgress ResponseOutputItemMcpCallStatus = "in_progress" -
const ResponseOutputItemMcpCallStatusCompleted ResponseOutputItemMcpCallStatus = "completed" -
const ResponseOutputItemMcpCallStatusIncomplete ResponseOutputItemMcpCallStatus = "incomplete" -
const ResponseOutputItemMcpCallStatusCalling ResponseOutputItemMcpCallStatus = "calling" -
const ResponseOutputItemMcpCallStatusFailed ResponseOutputItemMcpCallStatus = "failed"
-
-
-
type ResponseOutputItemMcpListTools struct{…}A list of tools available on an MCP server.
-
ID stringThe unique ID of the list.
-
ServerLabel stringThe label of the MCP server.
-
Tools []ResponseOutputItemMcpListToolsToolThe tools available on the server.
-
InputSchema anyThe JSON schema describing the tool's input.
-
Name stringThe name of the tool.
-
Annotations anyAdditional annotations about the tool.
-
Description stringThe description of the tool.
-
-
Type McpListToolsThe type of the item. Always
mcp_list_tools.const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
-
Error stringError message if the server could not list tools.
-
-
type ResponseOutputItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
ID stringThe unique ID of the approval request.
-
Arguments stringA JSON string of arguments for the tool.
-
Name stringThe name of the tool to run.
-
ServerLabel stringThe label of the MCP server making the request.
-
Type McpApprovalRequestThe type of the item. Always
mcp_approval_request.const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"
-
-
type ResponseOutputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
ID stringThe unique ID of the approval response
-
ApprovalRequestID stringThe ID of the approval request being answered.
-
Approve boolWhether the request was approved.
-
Type McpApprovalResponseThe type of the item. Always
mcp_approval_response.const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
-
Reason stringOptional reason for the decision.
-
-
type ResponseCustomToolCall struct{…}A call to a custom tool created by the model.
-
type ResponseCustomToolCallOutputItem struct{…}The output of a custom tool call from your code, being sent back to the model.
-
ID stringThe unique ID of the custom tool call output item.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseCustomToolCallOutputItemStatusInProgress ResponseCustomToolCallOutputItemStatus = "in_progress" -
const ResponseCustomToolCallOutputItemStatusCompleted ResponseCustomToolCallOutputItemStatus = "completed" -
const ResponseCustomToolCallOutputItemStatusIncomplete ResponseCustomToolCallOutputItemStatus = "incomplete"
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
-
ParallelToolCalls boolWhether to allow the model to run tool calls in parallel.
-
Temperature float64What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or
top_pbut not both. -
ToolChoice ResponseToolChoiceUnionHow the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call.-
type ToolChoiceOptions stringControls which (if any) tool is called by the model.
nonemeans the model will not call any tool and instead generates a message.automeans the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools.-
const ToolChoiceOptionsNone ToolChoiceOptions = "none" -
const ToolChoiceOptionsAuto ToolChoiceOptions = "auto" -
const ToolChoiceOptionsRequired ToolChoiceOptions = "required"
-
-
type ToolChoiceAllowed struct{…}Constrains the tools available to the model to a pre-defined set.
-
Mode ToolChoiceAllowedModeConstrains the tools available to the model to a pre-defined set.
autoallows the model to pick from among the allowed tools and generate a message.requiredrequires the model to call one or more of the allowed tools.-
const ToolChoiceAllowedModeAuto ToolChoiceAllowedMode = "auto" -
const ToolChoiceAllowedModeRequired ToolChoiceAllowedMode = "required"
-
-
Tools []map[string, any]A list of tool definitions that the model should be allowed to call.
For the Responses API, the list of tool definitions might look like:
[ { "type": "function", "name": "get_weather" }, { "type": "mcp", "server_label": "deepwiki" }, { "type": "image_generation" } ] -
Type AllowedToolsAllowed tool configuration type. Always
allowed_tools.const AllowedToolsAllowedTools AllowedTools = "allowed_tools"
-
-
type ToolChoiceTypes struct{…}Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
-
Type ToolChoiceTypesTypeThe type of hosted tool the model should to use. Learn more about built-in tools.
Allowed values are:
-
file_search -
web_search_preview -
computer -
computer_use_preview -
computer_use -
code_interpreter -
image_generation -
const ToolChoiceTypesTypeFileSearch ToolChoiceTypesType = "file_search" -
const ToolChoiceTypesTypeWebSearchPreview ToolChoiceTypesType = "web_search_preview" -
const ToolChoiceTypesTypeComputer ToolChoiceTypesType = "computer" -
const ToolChoiceTypesTypeComputerUsePreview ToolChoiceTypesType = "computer_use_preview" -
const ToolChoiceTypesTypeComputerUse ToolChoiceTypesType = "computer_use" -
const ToolChoiceTypesTypeWebSearchPreview2025_03_11 ToolChoiceTypesType = "web_search_preview_2025_03_11" -
const ToolChoiceTypesTypeImageGeneration ToolChoiceTypesType = "image_generation" -
const ToolChoiceTypesTypeCodeInterpreter ToolChoiceTypesType = "code_interpreter"
-
-
-
type ToolChoiceFunction struct{…}Use this option to force the model to call a specific function.
-
Name stringThe name of the function to call.
-
Type FunctionFor function calling, the type is always
function.const FunctionFunction Function = "function"
-
-
type ToolChoiceMcp struct{…}Use this option to force the model to call a specific tool on a remote MCP server.
-
ServerLabel stringThe label of the MCP server to use.
-
Type McpFor MCP tools, the type is always
mcp.const McpMcp Mcp = "mcp"
-
Name stringThe name of the tool to call on the server.
-
-
type ToolChoiceCustom struct{…}Use this option to force the model to call a specific custom tool.
-
Name stringThe name of the custom tool to call.
-
Type CustomFor custom tool calling, the type is always
custom.const CustomCustom Custom = "custom"
-
-
type ToolChoiceApplyPatch struct{…}Forces the model to call the apply_patch tool when executing a tool call.
-
Type ApplyPatchThe tool to call. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
type ToolChoiceShell struct{…}Forces the model to call the shell tool when a tool call is required.
-
Type ShellThe tool to call. Always
shell.const ShellShell Shell = "shell"
-
-
-
Tools []ToolUnionAn array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.We support the following categories of tools:
-
Built-in tools: Tools that are provided by OpenAI that extend the model's capabilities, like web search or file search. Learn more about built-in tools.
-
MCP Tools: Integrations with third-party systems via custom MCP servers or predefined connectors such as Google Drive and SharePoint. Learn more about MCP Tools.
-
Function calls (custom tools): Functions that are defined by you, enabling the model to call your own code with strongly typed arguments and outputs. Learn more about function calling. You can also use custom tools to call your own code.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
TopP float64An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
We generally recommend altering this or
temperaturebut not both. -
Background boolWhether to run the model response in the background. Learn more.
-
CompletedAt float64Unix timestamp (in seconds) of when this Response was completed. Only present when the status is
completed. -
Conversation ResponseConversationThe conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
-
ID stringThe unique ID of the conversation that this response was associated with.
-
-
MaxOutputTokens int64An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
MaxToolCalls int64The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored.
-
Moderation ResponseModerationModeration results for the response input and output, if moderated completions were requested.
-
Input ResponseModerationInputUnionModeration for the response input.
-
type ResponseModerationInputModerationResult struct{…}A moderation result produced for the response input or output.
-
Categories map[string, bool]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
CategoryAppliedInputTypes map[string, []string]Which modalities of input are reflected by the score for each category.
-
const ResponseModerationInputModerationResultCategoryAppliedInputTypeText ResponseModerationInputModerationResultCategoryAppliedInputType = "text" -
const ResponseModerationInputModerationResultCategoryAppliedInputTypeImage ResponseModerationInputModerationResultCategoryAppliedInputType = "image"
-
-
CategoryScores map[string, float64]A dictionary of moderation categories to scores.
-
Flagged boolA boolean indicating whether the content was flagged by any category.
-
Model stringThe moderation model that produced this result.
-
Type ModerationResultThe object type, which was always
moderation_resultfor successful moderation results.const ModerationResultModerationResult ModerationResult = "moderation_result"
-
-
type ResponseModerationInputError struct{…}An error produced while attempting moderation for the response input or output.
-
Code stringThe error code.
-
Message stringThe error message.
-
Type ErrorThe object type, which was always
errorfor moderation failures.const ErrorError Error = "error"
-
-
-
Output ResponseModerationOutputUnionModeration for the response output.
-
type ResponseModerationOutputModerationResult struct{…}A moderation result produced for the response input or output.
-
Categories map[string, bool]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
CategoryAppliedInputTypes map[string, []string]Which modalities of input are reflected by the score for each category.
-
const ResponseModerationOutputModerationResultCategoryAppliedInputTypeText ResponseModerationOutputModerationResultCategoryAppliedInputType = "text" -
const ResponseModerationOutputModerationResultCategoryAppliedInputTypeImage ResponseModerationOutputModerationResultCategoryAppliedInputType = "image"
-
-
CategoryScores map[string, float64]A dictionary of moderation categories to scores.
-
Flagged boolA boolean indicating whether the content was flagged by any category.
-
Model stringThe moderation model that produced this result.
-
Type ModerationResultThe object type, which was always
moderation_resultfor successful moderation results.const ModerationResultModerationResult ModerationResult = "moderation_result"
-
-
type ResponseModerationOutputError struct{…}An error produced while attempting moderation for the response input or output.
-
Code stringThe error code.
-
Message stringThe error message.
-
Type ErrorThe object type, which was always
errorfor moderation failures.const ErrorError Error = "error"
-
-
-
-
PreviousResponseID stringThe unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about conversation state. Cannot be used in conjunction with
conversation. -
Prompt ResponsePromptReference to a prompt template and its variables. Learn more.
-
ID stringThe unique identifier of the prompt template to use.
-
Variables map[string, ResponsePromptVariableUnion]Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files.
-
string -
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
Version stringOptional version of the prompt template.
-
-
PromptCacheKey stringUsed by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more. -
PromptCacheRetention ResponsePromptCacheRetentionThe retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. Forgpt-5.5,gpt-5.5-pro, and future models, only24his supported.For older models that support both
in_memoryand24h, the default depends on your organization's data retention policy:-
Organizations without ZDR enabled default to
24h. -
Organizations with ZDR enabled default to
in_memorywhenprompt_cache_retentionis not specified. -
const ResponsePromptCacheRetentionInMemory ResponsePromptCacheRetention = "in_memory" -
const ResponsePromptCacheRetention24h ResponsePromptCacheRetention = "24h"
-
-
Reasoning Reasoninggpt-5 and o-series models only
Configuration options for reasoning models.
-
Context ReasoningContextControls which reasoning items are rendered back to the model on later turns. When returned on a response, this is the effective reasoning context mode used for the response.
-
const ReasoningContextAuto ReasoningContext = "auto" -
const ReasoningContextCurrentTurn ReasoningContext = "current_turn" -
const ReasoningContextAllTurns ReasoningContext = "all_turns"
-
-
Effort ReasoningEffortConstrains effort on reasoning for reasoning models. Currently supported values are
none,minimal,low,medium,high, andxhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.-
gpt-5.1defaults tonone, which does not perform reasoning. The supported reasoning values forgpt-5.1arenone,low,medium, andhigh. Tool calls are supported for all reasoning values in gpt-5.1. -
All models before
gpt-5.1default tomediumreasoning effort, and do not supportnone. -
The
gpt-5-promodel defaults to (and only supports)highreasoning effort. -
xhighis supported for all models aftergpt-5.1-codex-max. -
const ReasoningEffortNone ReasoningEffort = "none" -
const ReasoningEffortMinimal ReasoningEffort = "minimal" -
const ReasoningEffortLow ReasoningEffort = "low" -
const ReasoningEffortMedium ReasoningEffort = "medium" -
const ReasoningEffortHigh ReasoningEffort = "high" -
const ReasoningEffortXhigh ReasoningEffort = "xhigh"
-
-
GenerateSummary ReasoningGenerateSummaryDeprecated: use
summaryinstead.A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.-
const ReasoningGenerateSummaryAuto ReasoningGenerateSummary = "auto" -
const ReasoningGenerateSummaryConcise ReasoningGenerateSummary = "concise" -
const ReasoningGenerateSummaryDetailed ReasoningGenerateSummary = "detailed"
-
-
Summary ReasoningSummaryA summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.conciseis supported forcomputer-use-previewmodels and all reasoning models aftergpt-5.-
const ReasoningSummaryAuto ReasoningSummary = "auto" -
const ReasoningSummaryConcise ReasoningSummary = "concise" -
const ReasoningSummaryDetailed ReasoningSummary = "detailed"
-
-
-
SafetyIdentifier stringA stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
ServiceTier ResponseServiceTierSpecifies the processing type used for serving the request.
- If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'.
- If set to 'default', then the request will be processed with the standard pricing and performance for the selected model.
- If set to 'flex' or 'priority', then the request will be processed with the corresponding service tier.
- When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.-
const ResponseServiceTierAuto ResponseServiceTier = "auto" -
const ResponseServiceTierDefault ResponseServiceTier = "default" -
const ResponseServiceTierFlex ResponseServiceTier = "flex" -
const ResponseServiceTierScale ResponseServiceTier = "scale" -
const ResponseServiceTierPriority ResponseServiceTier = "priority"
-
Status ResponseStatusThe status of the response generation. One of
completed,failed,in_progress,cancelled,queued, orincomplete.-
const ResponseStatusCompleted ResponseStatus = "completed" -
const ResponseStatusFailed ResponseStatus = "failed" -
const ResponseStatusInProgress ResponseStatus = "in_progress" -
const ResponseStatusCancelled ResponseStatus = "cancelled" -
const ResponseStatusQueued ResponseStatus = "queued" -
const ResponseStatusIncomplete ResponseStatus = "incomplete"
-
-
Text ResponseTextConfigConfiguration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
Format ResponseFormatTextConfigUnionAn object specifying the format that the model must output.
Configuring
{ "type": "json_schema" }enables Structured Outputs, which ensures the model will match your supplied JSON schema. Learn more in the Structured Outputs guide.The default format is
{ "type": "text" }with no additional options.Not recommended for gpt-4o and newer models:
Setting to
{ "type": "json_object" }enables the older JSON mode, which ensures the message the model generates is valid JSON. Usingjson_schemais preferred for models that support it.-
type ResponseFormatText struct{…}Default response format. Used to generate text responses.
-
Type TextThe type of response format being defined. Always
text.const TextText Text = "text"
-
-
type ResponseFormatTextJSONSchemaConfig struct{…}JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
Name stringThe name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
-
Schema map[string, any]The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
-
Type JSONSchemaThe type of response format being defined. Always
json_schema.const JSONSchemaJSONSchema JSONSchema = "json_schema"
-
Description stringA description of what the response format is for, used by the model to determine how to respond in the format.
-
Strict boolWhether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the
schemafield. Only a subset of JSON Schema is supported whenstrictistrue. To learn more, read the Structured Outputs guide.
-
-
type ResponseFormatJSONObject struct{…}JSON object response format. An older method of generating JSON responses. Using
json_schemais 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 JSONObjectThe type of response format being defined. Always
json_object.const JSONObjectJSONObject JSONObject = "json_object"
-
-
-
Verbosity ResponseTextConfigVerbosityConstrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses. Currently supported values are
low,medium, andhigh.-
const ResponseTextConfigVerbosityLow ResponseTextConfigVerbosity = "low" -
const ResponseTextConfigVerbosityMedium ResponseTextConfigVerbosity = "medium" -
const ResponseTextConfigVerbosityHigh ResponseTextConfigVerbosity = "high"
-
-
TopLogprobs int64An integer between 0 and 20 specifying the maximum number of most likely tokens to return at each token position, each with an associated log probability. In some cases, the number of returned tokens may be fewer than requested.
-
Truncation ResponseTruncationThe truncation strategy to use for the model response.
-
auto: If the input to this Response exceeds the model's context window size, the model will truncate the response to fit the context window by dropping items from the beginning of the conversation. -
disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error. -
const ResponseTruncationAuto ResponseTruncation = "auto" -
const ResponseTruncationDisabled ResponseTruncation = "disabled"
-
-
Usage ResponseUsageRepresents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
-
InputTokens int64The number of input tokens.
-
InputTokensDetails ResponseUsageInputTokensDetailsA detailed breakdown of the input tokens.
-
CachedTokens int64The number of tokens that were retrieved from the cache. More on prompt caching.
-
-
OutputTokens int64The number of output tokens.
-
OutputTokensDetails ResponseUsageOutputTokensDetailsA detailed breakdown of the output tokens.
-
ReasoningTokens int64The number of reasoning tokens.
-
-
TotalTokens int64The total number of tokens used.
-
-
User stringThis field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead to maintain caching optimizations. A stable identifier for your end-users. Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. Learn more.
-
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseInProgressThe type of the event. Always
response.in_progress.const ResponseInProgressResponseInProgress ResponseInProgress = "response.in_progress"
-
Response Includable
-
type ResponseIncludable stringSpecify additional output data to include in the model response. Currently supported values are:
-
web_search_call.results: Include the search results of the web search tool call. -
web_search_call.action.sources: Include the sources of the web search tool call. -
code_interpreter_call.outputs: Includes the outputs of python code execution in code interpreter tool call items. -
computer_call_output.output.image_url: Include image urls from the computer call output. -
file_search_call.results: Include the search results of the file search tool call. -
message.input_image.image_url: Include image urls from the input message. -
message.output_text.logprobs: Include logprobs with assistant messages. -
reasoning.encrypted_content: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when thestoreparameter is set tofalse, or when an organization is enrolled in the zero data retention program). -
const ResponseIncludableFileSearchCallResults ResponseIncludable = "file_search_call.results" -
const ResponseIncludableWebSearchCallResults ResponseIncludable = "web_search_call.results" -
const ResponseIncludableWebSearchCallActionSources ResponseIncludable = "web_search_call.action.sources" -
const ResponseIncludableMessageInputImageImageURL ResponseIncludable = "message.input_image.image_url" -
const ResponseIncludableComputerCallOutputOutputImageURL ResponseIncludable = "computer_call_output.output.image_url" -
const ResponseIncludableCodeInterpreterCallOutputs ResponseIncludable = "code_interpreter_call.outputs" -
const ResponseIncludableReasoningEncryptedContent ResponseIncludable = "reasoning.encrypted_content" -
const ResponseIncludableMessageOutputTextLogprobs ResponseIncludable = "message.output_text.logprobs"
-
Response Incomplete Event
-
type ResponseIncompleteEvent struct{…}An event that is emitted when a response finishes as incomplete.
-
Response ResponseThe response that was incomplete.
-
ID stringUnique identifier for this Response.
-
CreatedAt float64Unix timestamp (in seconds) of when this Response was created.
-
Error ResponseErrorAn error object returned when the model fails to generate a Response.
-
Code ResponseErrorCodeThe error code for the response.
-
const ResponseErrorCodeServerError ResponseErrorCode = "server_error" -
const ResponseErrorCodeRateLimitExceeded ResponseErrorCode = "rate_limit_exceeded" -
const ResponseErrorCodeInvalidPrompt ResponseErrorCode = "invalid_prompt" -
const ResponseErrorCodeVectorStoreTimeout ResponseErrorCode = "vector_store_timeout" -
const ResponseErrorCodeInvalidImage ResponseErrorCode = "invalid_image" -
const ResponseErrorCodeInvalidImageFormat ResponseErrorCode = "invalid_image_format" -
const ResponseErrorCodeInvalidBase64Image ResponseErrorCode = "invalid_base64_image" -
const ResponseErrorCodeInvalidImageURL ResponseErrorCode = "invalid_image_url" -
const ResponseErrorCodeImageTooLarge ResponseErrorCode = "image_too_large" -
const ResponseErrorCodeImageTooSmall ResponseErrorCode = "image_too_small" -
const ResponseErrorCodeImageParseError ResponseErrorCode = "image_parse_error" -
const ResponseErrorCodeImageContentPolicyViolation ResponseErrorCode = "image_content_policy_violation" -
const ResponseErrorCodeInvalidImageMode ResponseErrorCode = "invalid_image_mode" -
const ResponseErrorCodeImageFileTooLarge ResponseErrorCode = "image_file_too_large" -
const ResponseErrorCodeUnsupportedImageMediaType ResponseErrorCode = "unsupported_image_media_type" -
const ResponseErrorCodeEmptyImageFile ResponseErrorCode = "empty_image_file" -
const ResponseErrorCodeFailedToDownloadImage ResponseErrorCode = "failed_to_download_image" -
const ResponseErrorCodeImageFileNotFound ResponseErrorCode = "image_file_not_found"
-
-
Message stringA human-readable description of the error.
-
-
IncompleteDetails ResponseIncompleteDetailsDetails about why the response is incomplete.
-
Reason stringThe reason why the response is incomplete.
-
const ResponseIncompleteDetailsReasonMaxOutputTokens ResponseIncompleteDetailsReason = "max_output_tokens" -
const ResponseIncompleteDetailsReasonContentFilter ResponseIncompleteDetailsReason = "content_filter"
-
-
-
Instructions ResponseInstructionsUnionA system (or developer) message inserted into the model's context.
When using along with
previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses.-
string -
type ResponseInstructionsInputItemList []ResponseInputItemUnionA list of one or many input items to the model, containing different content types.
-
type EasyInputMessage struct{…}A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.-
Content EasyInputMessageContentUnionText, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
-
string -
type ResponseInputMessageContentList []ResponseInputContentUnionA list of one or many input items to the model, containing different content types.
-
type ResponseInputText struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
Detail ResponseInputImageDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageDetailLow ResponseInputImageDetail = "low" -
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high" -
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto" -
const ResponseInputImageDetailOriginal ResponseInputImageDetail = "original"
-
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFile struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileDetailLow ResponseInputFileDetail = "low" -
const ResponseInputFileDetailHigh ResponseInputFileDetail = "high"
-
-
FileData stringThe content of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Role EasyInputMessageRoleThe role of the message input. One of
user,assistant,system, ordeveloper.-
const EasyInputMessageRoleUser EasyInputMessageRole = "user" -
const EasyInputMessageRoleAssistant EasyInputMessageRole = "assistant" -
const EasyInputMessageRoleSystem EasyInputMessageRole = "system" -
const EasyInputMessageRoleDeveloper EasyInputMessageRole = "developer"
-
-
Phase EasyInputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const EasyInputMessagePhaseCommentary EasyInputMessagePhase = "commentary" -
const EasyInputMessagePhaseFinalAnswer EasyInputMessagePhase = "final_answer"
-
-
Type EasyInputMessageTypeThe type of the message input. Always
message.const EasyInputMessageTypeMessage EasyInputMessageType = "message"
-
-
type ResponseInputItemMessage struct{…}A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole.-
Content ResponseInputMessageContentListA list of one or many input items to the model, containing different content types.
-
Role stringThe role of the message input. One of
user,system, ordeveloper.-
const ResponseInputItemMessageRoleUser ResponseInputItemMessageRole = "user" -
const ResponseInputItemMessageRoleSystem ResponseInputItemMessageRole = "system" -
const ResponseInputItemMessageRoleDeveloper ResponseInputItemMessageRole = "developer"
-
-
Status stringThe status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputItemMessageStatusInProgress ResponseInputItemMessageStatus = "in_progress" -
const ResponseInputItemMessageStatusCompleted ResponseInputItemMessageStatus = "completed" -
const ResponseInputItemMessageStatusIncomplete ResponseInputItemMessageStatus = "incomplete"
-
-
Type stringThe type of the message input. Always set to
message.const ResponseInputItemMessageTypeMessage ResponseInputItemMessageType = "message"
-
-
type ResponseOutputMessage struct{…}An output message from the model.
-
ID stringThe unique ID of the output message.
-
Content []ResponseOutputMessageContentUnionThe content of the output message.
-
type ResponseOutputText struct{…}A text output from the model.
-
Annotations []ResponseOutputTextAnnotationUnionThe annotations of the text output.
-
type ResponseOutputTextAnnotationFileCitation struct{…}A citation to a file.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the file cited.
-
Index int64The index of the file in the list of files.
-
Type FileCitationThe type of the file citation. Always
file_citation.const FileCitationFileCitation FileCitation = "file_citation"
-
-
type ResponseOutputTextAnnotationURLCitation struct{…}A citation for a web resource used to generate a model response.
-
EndIndex int64The index of the last character of the URL citation in the message.
-
StartIndex int64The index of the first character of the URL citation in the message.
-
Title stringThe title of the web resource.
-
Type URLCitationThe type of the URL citation. Always
url_citation.const URLCitationURLCitation URLCitation = "url_citation"
-
URL stringThe URL of the web resource.
-
-
type ResponseOutputTextAnnotationContainerFileCitation struct{…}A citation for a container file used to generate a model response.
-
ContainerID stringThe ID of the container file.
-
EndIndex int64The index of the last character of the container file citation in the message.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the container file cited.
-
StartIndex int64The index of the first character of the container file citation in the message.
-
Type ContainerFileCitationThe type of the container file citation. Always
container_file_citation.const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"
-
-
type ResponseOutputTextAnnotationFilePath struct{…}A path to a file.
-
FileID stringThe ID of the file.
-
Index int64The index of the file in the list of files.
-
Type FilePathThe type of the file path. Always
file_path.const FilePathFilePath FilePath = "file_path"
-
-
-
Text stringThe text output from the model.
-
Type OutputTextThe type of the output text. Always
output_text.const OutputTextOutputText OutputText = "output_text"
-
Logprobs []ResponseOutputTextLogprob-
Token string -
Bytes []int64 -
Logprob float64 -
TopLogprobs []ResponseOutputTextLogprobTopLogprob-
Token string -
Bytes []int64 -
Logprob float64
-
-
-
-
type ResponseOutputRefusal struct{…}A refusal from the model.
-
Refusal stringThe refusal explanation from the model.
-
Type RefusalThe type of the refusal. Always
refusal.const RefusalRefusal Refusal = "refusal"
-
-
-
Role AssistantThe role of the output message. Always
assistant.const AssistantAssistant Assistant = "assistant"
-
Status ResponseOutputMessageStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseOutputMessageStatusInProgress ResponseOutputMessageStatus = "in_progress" -
const ResponseOutputMessageStatusCompleted ResponseOutputMessageStatus = "completed" -
const ResponseOutputMessageStatusIncomplete ResponseOutputMessageStatus = "incomplete"
-
-
Type MessageThe type of the output message. Always
message.const MessageMessage Message = "message"
-
Phase ResponseOutputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const ResponseOutputMessagePhaseCommentary ResponseOutputMessagePhase = "commentary" -
const ResponseOutputMessagePhaseFinalAnswer ResponseOutputMessagePhase = "final_answer"
-
-
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
ID stringThe unique ID of the file search tool call.
-
Queries []stringThe queries used to search for files.
-
Status ResponseFileSearchToolCallStatusThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
const ResponseFileSearchToolCallStatusInProgress ResponseFileSearchToolCallStatus = "in_progress" -
const ResponseFileSearchToolCallStatusSearching ResponseFileSearchToolCallStatus = "searching" -
const ResponseFileSearchToolCallStatusCompleted ResponseFileSearchToolCallStatus = "completed" -
const ResponseFileSearchToolCallStatusIncomplete ResponseFileSearchToolCallStatus = "incomplete" -
const ResponseFileSearchToolCallStatusFailed ResponseFileSearchToolCallStatus = "failed"
-
-
Type FileSearchCallThe type of the file search tool call. Always
file_search_call.const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"
-
Results []ResponseFileSearchToolCallResultThe results of the file search tool call.
-
Attributes map[string, ResponseFileSearchToolCallResultAttributeUnion]Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.
-
string -
float64 -
bool
-
-
FileID stringThe unique ID of the file.
-
Filename stringThe name of the file.
-
Score float64The relevance score of the file - a value between 0 and 1.
-
Text stringThe text that was retrieved from the file.
-
-
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
ID stringThe unique ID of the computer call.
-
CallID stringAn identifier used when responding to the tool call with output.
-
PendingSafetyChecks []ResponseComputerToolCallPendingSafetyCheckThe pending safety checks for the computer call.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status ResponseComputerToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseComputerToolCallStatusInProgress ResponseComputerToolCallStatus = "in_progress" -
const ResponseComputerToolCallStatusCompleted ResponseComputerToolCallStatus = "completed" -
const ResponseComputerToolCallStatusIncomplete ResponseComputerToolCallStatus = "incomplete"
-
-
Type ResponseComputerToolCallTypeThe type of the computer call. Always
computer_call.const ResponseComputerToolCallTypeComputerCall ResponseComputerToolCallType = "computer_call"
-
Action ResponseComputerToolCallActionUnionA click action.
-
type ResponseComputerToolCallActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ResponseComputerToolCallActionClickButtonLeft ResponseComputerToolCallActionClickButton = "left" -
const ResponseComputerToolCallActionClickButtonRight ResponseComputerToolCallActionClickButton = "right" -
const ResponseComputerToolCallActionClickButtonWheel ResponseComputerToolCallActionClickButton = "wheel" -
const ResponseComputerToolCallActionClickButtonBack ResponseComputerToolCallActionClickButton = "back" -
const ResponseComputerToolCallActionClickButtonForward ResponseComputerToolCallActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ResponseComputerToolCallActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ResponseComputerToolCallActionDrag struct{…}A drag action.
-
Path []ResponseComputerToolCallActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ResponseComputerToolCallActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ResponseComputerToolCallActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ResponseComputerToolCallActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ResponseComputerToolCallActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ResponseComputerToolCallActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ResponseComputerToolCallActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
Actions ComputerActionListFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
type ComputerActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ComputerActionClickButtonLeft ComputerActionClickButton = "left" -
const ComputerActionClickButtonRight ComputerActionClickButton = "right" -
const ComputerActionClickButtonWheel ComputerActionClickButton = "wheel" -
const ComputerActionClickButtonBack ComputerActionClickButton = "back" -
const ComputerActionClickButtonForward ComputerActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ComputerActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ComputerActionDrag struct{…}A drag action.
-
Path []ComputerActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ComputerActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ComputerActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ComputerActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ComputerActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ComputerActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ComputerActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
-
type ResponseInputItemComputerCallOutput struct{…}The output of a computer tool call.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Type ComputerScreenshotSpecifies the event type. For a computer screenshot, this property is always set to
computer_screenshot.const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"
-
FileID stringThe identifier of an uploaded file that contains the screenshot.
-
ImageURL stringThe URL of the screenshot image.
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
ID stringThe ID of the computer tool call output.
-
AcknowledgedSafetyChecks []ResponseInputItemComputerCallOutputAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status stringThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseInputItemComputerCallOutputStatusInProgress ResponseInputItemComputerCallOutputStatus = "in_progress" -
const ResponseInputItemComputerCallOutputStatusCompleted ResponseInputItemComputerCallOutputStatus = "completed" -
const ResponseInputItemComputerCallOutputStatusIncomplete ResponseInputItemComputerCallOutputStatus = "incomplete"
-
-
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
ID stringThe unique ID of the web search tool call.
-
Action ResponseFunctionWebSearchActionUnionAn object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
type ResponseFunctionWebSearchActionSearch struct{…}Action type "search" - Performs a web search query.
-
Type SearchThe action type.
const SearchSearch Search = "search"
-
Queries []stringThe search queries.
-
Query stringThe search query.
-
Sources []ResponseFunctionWebSearchActionSearchSourceThe sources used in the search.
-
Type URLThe type of source. Always
url.const URLURL URL = "url"
-
URL stringThe URL of the source.
-
-
-
type ResponseFunctionWebSearchActionOpenPage struct{…}Action type "open_page" - Opens a specific URL from search results.
-
Type OpenPageThe action type.
const OpenPageOpenPage OpenPage = "open_page"
-
URL stringThe URL opened by the model.
-
-
type ResponseFunctionWebSearchActionFindInPage struct{…}Action type "find_in_page": Searches for a pattern within a loaded page.
-
Pattern stringThe pattern or text to search for within the page.
-
Type FindInPageThe action type.
const FindInPageFindInPage FindInPage = "find_in_page"
-
URL stringThe URL of the page searched for the pattern.
-
-
-
Status ResponseFunctionWebSearchStatusThe status of the web search tool call.
-
const ResponseFunctionWebSearchStatusInProgress ResponseFunctionWebSearchStatus = "in_progress" -
const ResponseFunctionWebSearchStatusSearching ResponseFunctionWebSearchStatus = "searching" -
const ResponseFunctionWebSearchStatusCompleted ResponseFunctionWebSearchStatus = "completed" -
const ResponseFunctionWebSearchStatusFailed ResponseFunctionWebSearchStatus = "failed"
-
-
Type WebSearchCallThe type of the web search tool call. Always
web_search_call.const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"
-
-
type ResponseFunctionToolCall struct{…}A tool call to run a function. See the function calling guide for more information.
-
Arguments stringA JSON string of the arguments to pass to the function.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Name stringThe name of the function to run.
-
Type FunctionCallThe type of the function tool call. Always
function_call.const FunctionCallFunctionCall FunctionCall = "function_call"
-
ID stringThe unique ID of the function tool call.
-
Namespace stringThe namespace of the function to run.
-
Status ResponseFunctionToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallStatusInProgress ResponseFunctionToolCallStatus = "in_progress" -
const ResponseFunctionToolCallStatusCompleted ResponseFunctionToolCallStatus = "completed" -
const ResponseFunctionToolCallStatusIncomplete ResponseFunctionToolCallStatus = "incomplete"
-
-
-
type ResponseInputItemFunctionCallOutput struct{…}The output of a function tool call.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseInputItemFunctionCallOutputOutputUnionText, image, or file output of the function tool call.
-
string -
type ResponseFunctionCallOutputItemList []ResponseFunctionCallOutputItemUnionAn array of content outputs (text, image, file) for the function tool call.
-
type ResponseInputTextContent struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImageContent struct{…}An image input to the model. Learn about image inputs
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
Detail ResponseInputImageContentDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageContentDetailLow ResponseInputImageContentDetail = "low" -
const ResponseInputImageContentDetailHigh ResponseInputImageContentDetail = "high" -
const ResponseInputImageContentDetailAuto ResponseInputImageContentDetail = "auto" -
const ResponseInputImageContentDetailOriginal ResponseInputImageContentDetail = "original"
-
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFileContent struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileContentDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileContentDetailLow ResponseInputFileContentDetail = "low" -
const ResponseInputFileContentDetailHigh ResponseInputFileContentDetail = "high"
-
-
FileData stringThe base64-encoded data of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
ID stringThe unique ID of the function tool call output. Populated when this item is returned via API.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputItemFunctionCallOutputStatusInProgress ResponseInputItemFunctionCallOutputStatus = "in_progress" -
const ResponseInputItemFunctionCallOutputStatusCompleted ResponseInputItemFunctionCallOutputStatus = "completed" -
const ResponseInputItemFunctionCallOutputStatusIncomplete ResponseInputItemFunctionCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemToolSearchCall struct{…}-
Arguments anyThe arguments supplied to the tool search call.
-
Type ToolSearchCallThe item type. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
ID stringThe unique ID of this tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution stringWhether tool search was executed by the server or by the client.
-
const ResponseInputItemToolSearchCallExecutionServer ResponseInputItemToolSearchCallExecution = "server" -
const ResponseInputItemToolSearchCallExecutionClient ResponseInputItemToolSearchCallExecution = "client"
-
-
Status stringThe status of the tool search call.
-
const ResponseInputItemToolSearchCallStatusInProgress ResponseInputItemToolSearchCallStatus = "in_progress" -
const ResponseInputItemToolSearchCallStatusCompleted ResponseInputItemToolSearchCallStatus = "completed" -
const ResponseInputItemToolSearchCallStatusIncomplete ResponseInputItemToolSearchCallStatus = "incomplete"
-
-
-
type ResponseToolSearchOutputItemParamResp struct{…}-
Tools []ToolUnionThe loaded tool definitions returned by the tool search output.
-
type FunctionTool struct{…}Defines a function in your own code the model can choose to call. Learn more about function calling.
-
Name stringThe name of the function to call.
-
Parameters map[string, any]A JSON schema object describing the parameters of the function.
-
Strict boolWhether to enforce strict parameter validation. Default
true. -
Type FunctionThe type of the function tool. Always
function.const FunctionFunction Function = "function"
-
DeferLoading boolWhether this function is deferred and loaded via tool search.
-
Description stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
type FileSearchTool struct{…}A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
Type FileSearchThe type of the file search tool. Always
file_search.const FileSearchFileSearch FileSearch = "file_search"
-
VectorStoreIDs []stringThe IDs of the vector stores to search.
-
Filters FileSearchToolFiltersUnionA filter to apply.
-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
Key stringThe key to compare against the value.
-
Type ComparisonFilterTypeSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
const ComparisonFilterTypeEq ComparisonFilterType = "eq" -
const ComparisonFilterTypeNe ComparisonFilterType = "ne" -
const ComparisonFilterTypeGt ComparisonFilterType = "gt" -
const ComparisonFilterTypeGte ComparisonFilterType = "gte" -
const ComparisonFilterTypeLt ComparisonFilterType = "lt" -
const ComparisonFilterTypeLte ComparisonFilterType = "lte" -
const ComparisonFilterTypeIn ComparisonFilterType = "in" -
const ComparisonFilterTypeNin ComparisonFilterType = "nin"
-
-
Value ComparisonFilterValueUnionThe value to compare against the attribute key; supports string, number, or boolean types.
-
string -
float64 -
bool -
type ComparisonFilterValueArray []ComparisonFilterValueArrayItemUnion-
string -
float64
-
-
-
-
type CompoundFilter struct{…}Combine multiple filters using
andoror.-
Filters []ComparisonFilterArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
-
Type CompoundFilterTypeType of operation:
andoror.-
const CompoundFilterTypeAnd CompoundFilterType = "and" -
const CompoundFilterTypeOr CompoundFilterType = "or"
-
-
-
-
MaxNumResults int64The maximum number of results to return. This number should be between 1 and 50 inclusive.
-
RankingOptions FileSearchToolRankingOptionsRanking options for search.
-
HybridSearch FileSearchToolRankingOptionsHybridSearchWeights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
EmbeddingWeight float64The weight of the embedding in the reciprocal ranking fusion.
-
TextWeight float64The weight of the text in the reciprocal ranking fusion.
-
-
Ranker stringThe ranker to use for the file search.
-
const FileSearchToolRankingOptionsRankerAuto FileSearchToolRankingOptionsRanker = "auto" -
const FileSearchToolRankingOptionsRankerDefault2024_11_15 FileSearchToolRankingOptionsRanker = "default-2024-11-15"
-
-
ScoreThreshold float64The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
Type ComputerThe type of the computer tool. Always
computer.const ComputerComputer Computer = "computer"
-
-
type ComputerUsePreviewTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
DisplayHeight int64The height of the computer display.
-
DisplayWidth int64The width of the computer display.
-
Environment ComputerUsePreviewToolEnvironmentThe type of computer environment to control.
-
const ComputerUsePreviewToolEnvironmentWindows ComputerUsePreviewToolEnvironment = "windows" -
const ComputerUsePreviewToolEnvironmentMac ComputerUsePreviewToolEnvironment = "mac" -
const ComputerUsePreviewToolEnvironmentLinux ComputerUsePreviewToolEnvironment = "linux" -
const ComputerUsePreviewToolEnvironmentUbuntu ComputerUsePreviewToolEnvironment = "ubuntu" -
const ComputerUsePreviewToolEnvironmentBrowser ComputerUsePreviewToolEnvironment = "browser"
-
-
Type ComputerUsePreviewThe type of the computer use tool. Always
computer_use_preview.const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"
-
-
type WebSearchTool struct{…}Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
Type WebSearchToolTypeThe type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
const WebSearchToolTypeWebSearch WebSearchToolType = "web_search" -
const WebSearchToolTypeWebSearch2025_08_26 WebSearchToolType = "web_search_2025_08_26"
-
-
Filters WebSearchToolFiltersFilters for the search.
-
AllowedDomains []stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
SearchContextSize WebSearchToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchToolSearchContextSizeLow WebSearchToolSearchContextSize = "low" -
const WebSearchToolSearchContextSizeMedium WebSearchToolSearchContextSize = "medium" -
const WebSearchToolSearchContextSizeHigh WebSearchToolSearchContextSize = "high"
-
-
UserLocation WebSearchToolUserLocationThe approximate location of the user.
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
Type stringThe type of location approximation. Always
approximate.const WebSearchToolUserLocationTypeApproximate WebSearchToolUserLocationType = "approximate"
-
-
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
ServerLabel stringA label for this MCP server, used to identify it in tool calls.
-
Type McpThe type of the MCP tool. Always
mcp.const McpMcp Mcp = "mcp"
-
AllowedTools ToolMcpAllowedToolsUnionList of allowed tool names or a filter object.
-
type ToolMcpAllowedToolsMcpAllowedTools []stringA string array of allowed tool names
-
type ToolMcpAllowedToolsMcpToolFilter struct{…}A filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
Authorization stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
ConnectorID stringIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
const ToolMcpConnectorIDConnectorDropbox ToolMcpConnectorID = "connector_dropbox" -
const ToolMcpConnectorIDConnectorGmail ToolMcpConnectorID = "connector_gmail" -
const ToolMcpConnectorIDConnectorGooglecalendar ToolMcpConnectorID = "connector_googlecalendar" -
const ToolMcpConnectorIDConnectorGoogledrive ToolMcpConnectorID = "connector_googledrive" -
const ToolMcpConnectorIDConnectorMicrosoftteams ToolMcpConnectorID = "connector_microsoftteams" -
const ToolMcpConnectorIDConnectorOutlookcalendar ToolMcpConnectorID = "connector_outlookcalendar" -
const ToolMcpConnectorIDConnectorOutlookemail ToolMcpConnectorID = "connector_outlookemail" -
const ToolMcpConnectorIDConnectorSharepoint ToolMcpConnectorID = "connector_sharepoint"
-
-
DeferLoading boolWhether this MCP tool is deferred and discovered via tool search.
-
Headers map[string, string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
RequireApproval ToolMcpRequireApprovalUnionSpecify which of the MCP server's tools require approval.
-
type ToolMcpRequireApprovalMcpToolApprovalFilter 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.-
Always ToolMcpRequireApprovalMcpToolApprovalFilterAlwaysA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
Never ToolMcpRequireApprovalMcpToolApprovalFilterNeverA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
type ToolMcpRequireApprovalMcpToolApprovalSetting stringSpecify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
const ToolMcpRequireApprovalMcpToolApprovalSettingAlways ToolMcpRequireApprovalMcpToolApprovalSetting = "always" -
const ToolMcpRequireApprovalMcpToolApprovalSettingNever ToolMcpRequireApprovalMcpToolApprovalSetting = "never"
-
-
-
ServerDescription stringOptional description of the MCP server, used to provide more context.
-
ServerURL stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
TunnelID stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
Container ToolCodeInterpreterContainerUnionThe code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
string -
type ToolCodeInterpreterContainerCodeInterpreterContainerAuto struct{…}Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
Type AutoAlways
auto.const AutoAuto Auto = "auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit stringThe memory limit for the code interpreter container.
-
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"
-
-
NetworkPolicy ToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…}-
Type DisabledDisable outbound network access. Always
disabled.const DisabledDisabled Disabled = "disabled"
-
-
type ContainerNetworkPolicyAllowlist struct{…}-
AllowedDomains []stringA list of allowed domains when type is
allowlist. -
Type AllowlistAllow outbound network access only to specified domains. Always
allowlist.const AllowlistAllowlist Allowlist = "allowlist"
-
DomainSecrets []ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
Domain stringThe domain associated with the secret.
-
Name stringThe name of the secret to inject for the domain.
-
Value stringThe secret value to inject for the domain.
-
-
-
-
-
-
Type CodeInterpreterThe type of the code interpreter tool. Always
code_interpreter.const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"
-
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
Type ImageGenerationThe type of the image generation tool. Always
image_generation.const ImageGenerationImageGeneration ImageGeneration = "image_generation"
-
Action stringWhether to generate a new image or edit an existing image. Default:
auto.-
const ToolImageGenerationActionGenerate ToolImageGenerationAction = "generate" -
const ToolImageGenerationActionEdit ToolImageGenerationAction = "edit" -
const ToolImageGenerationActionAuto ToolImageGenerationAction = "auto"
-
-
Background stringAllows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
const ToolImageGenerationBackgroundTransparent ToolImageGenerationBackground = "transparent" -
const ToolImageGenerationBackgroundOpaque ToolImageGenerationBackground = "opaque" -
const ToolImageGenerationBackgroundAuto ToolImageGenerationBackground = "auto"
-
-
InputFidelity stringControl how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
const ToolImageGenerationInputFidelityHigh ToolImageGenerationInputFidelity = "high" -
const ToolImageGenerationInputFidelityLow ToolImageGenerationInputFidelity = "low"
-
-
InputImageMask ToolImageGenerationInputImageMaskOptional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
FileID stringFile ID for the mask image.
-
ImageURL stringBase64-encoded mask image.
-
-
Model stringThe image generation model to use. Default:
gpt-image-1.-
string -
string-
const ToolImageGenerationModelGPTImage1 ToolImageGenerationModel = "gpt-image-1" -
const ToolImageGenerationModelGPTImage1Mini ToolImageGenerationModel = "gpt-image-1-mini" -
const ToolImageGenerationModelGPTImage2 ToolImageGenerationModel = "gpt-image-2" -
const ToolImageGenerationModelGPTImage2_2026_04_21 ToolImageGenerationModel = "gpt-image-2-2026-04-21" -
const ToolImageGenerationModelGPTImage1_5 ToolImageGenerationModel = "gpt-image-1.5" -
const ToolImageGenerationModelChatgptImageLatest ToolImageGenerationModel = "chatgpt-image-latest"
-
-
-
Moderation stringModeration level for the generated image. Default:
auto.-
const ToolImageGenerationModerationAuto ToolImageGenerationModeration = "auto" -
const ToolImageGenerationModerationLow ToolImageGenerationModeration = "low"
-
-
OutputCompression int64Compression level for the output image. Default: 100.
-
OutputFormat stringThe output format of the generated image. One of
png,webp, orjpeg. Default:png.-
const ToolImageGenerationOutputFormatPNG ToolImageGenerationOutputFormat = "png" -
const ToolImageGenerationOutputFormatWebP ToolImageGenerationOutputFormat = "webp" -
const ToolImageGenerationOutputFormatJPEG ToolImageGenerationOutputFormat = "jpeg"
-
-
PartialImages int64Number of partial images to generate in streaming mode, from 0 (default value) to 3.
-
Quality stringThe quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
const ToolImageGenerationQualityLow ToolImageGenerationQuality = "low" -
const ToolImageGenerationQualityMedium ToolImageGenerationQuality = "medium" -
const ToolImageGenerationQualityHigh ToolImageGenerationQuality = "high" -
const ToolImageGenerationQualityAuto ToolImageGenerationQuality = "auto"
-
-
Size stringThe size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
string -
string-
const ToolImageGenerationSize1024x1024 ToolImageGenerationSize = "1024x1024" -
const ToolImageGenerationSize1024x1536 ToolImageGenerationSize = "1024x1536" -
const ToolImageGenerationSize1536x1024 ToolImageGenerationSize = "1536x1024" -
const ToolImageGenerationSizeAuto ToolImageGenerationSize = "auto"
-
-
-
-
type ToolLocalShell struct{…}A tool that allows the model to execute shell commands in a local environment.
-
Type LocalShellThe type of the local shell tool. Always
local_shell.const LocalShellLocalShell LocalShell = "local_shell"
-
-
type FunctionShellTool struct{…}A tool that allows the model to execute shell commands.
-
Type ShellThe type of the shell tool. Always
shell.const ShellShell Shell = "shell"
-
Environment FunctionShellToolEnvironmentUnion-
type ContainerAuto struct{…}-
Type ContainerAutoAutomatically creates a container for this request
const ContainerAutoContainerAuto ContainerAuto = "container_auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit ContainerAutoMemoryLimitThe memory limit for the container.
-
const ContainerAutoMemoryLimit1g ContainerAutoMemoryLimit = "1g" -
const ContainerAutoMemoryLimit4g ContainerAutoMemoryLimit = "4g" -
const ContainerAutoMemoryLimit16g ContainerAutoMemoryLimit = "16g" -
const ContainerAutoMemoryLimit64g ContainerAutoMemoryLimit = "64g"
-
-
NetworkPolicy ContainerAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…} -
type ContainerNetworkPolicyAllowlist struct{…}
-
-
Skills []ContainerAutoSkillUnionAn optional list of skills referenced by id or inline data.
-
type SkillReference struct{…}-
SkillID stringThe ID of the referenced skill.
-
Type SkillReferenceReferences a skill created with the /v1/skills endpoint.
const SkillReferenceSkillReference SkillReference = "skill_reference"
-
Version stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
type InlineSkill struct{…}-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Source InlineSkillSourceInline skill payload
-
Data stringBase64-encoded skill zip bundle.
-
MediaType ApplicationZipThe media type of the inline skill payload. Must be
application/zip.const ApplicationZipApplicationZip ApplicationZip = "application/zip"
-
Type Base64The type of the inline skill source. Must be
base64.const Base64Base64 Base64 = "base64"
-
-
Type InlineDefines an inline skill for this request.
const InlineInline Inline = "inline"
-
-
-
-
type LocalEnvironment struct{…}-
Type LocalUse a local computer environment.
const LocalLocal Local = "local"
-
Skills []LocalSkillAn optional list of skills.
-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Path stringThe path to the directory containing the skill.
-
-
-
type ContainerReference struct{…}-
ContainerID stringThe ID of the referenced container.
-
Type ContainerReferenceReferences a container created with the /v1/containers endpoint
const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
Name stringThe name of the custom tool, used to identify it in tool calls.
-
Type CustomThe type of the custom tool. Always
custom.const CustomCustom Custom = "custom"
-
DeferLoading boolWhether this tool should be deferred and discovered via tool search.
-
Description stringOptional description of the custom tool, used to provide more context.
-
Format CustomToolInputFormatUnionThe input format for the custom tool. Default is unconstrained text.
-
type CustomToolInputFormatText struct{…}Unconstrained free-form text.
-
Type TextUnconstrained text format. Always
text.const TextText Text = "text"
-
-
type CustomToolInputFormatGrammar struct{…}A grammar defined by the user.
-
Definition stringThe grammar definition.
-
Syntax stringThe syntax of the grammar definition. One of
larkorregex.-
const CustomToolInputFormatGrammarSyntaxLark CustomToolInputFormatGrammarSyntax = "lark" -
const CustomToolInputFormatGrammarSyntaxRegex CustomToolInputFormatGrammarSyntax = "regex"
-
-
Type GrammarGrammar format. Always
grammar.const GrammarGrammar Grammar = "grammar"
-
-
-
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
Description stringA description of the namespace shown to the model.
-
Name stringThe namespace name used in tool calls (for example,
crm). -
Tools []NamespaceToolToolUnionThe function/custom tools available inside this namespace.
-
type NamespaceToolToolFunction struct{…}-
Name string -
Type Functionconst FunctionFunction Function = "function"
-
DeferLoading boolWhether this function should be deferred and discovered via tool search.
-
Description string -
Parameters any -
Strict bool
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
-
Type NamespaceThe type of the tool. Always
namespace.const NamespaceNamespace Namespace = "namespace"
-
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
Type ToolSearchThe type of the tool. Always
tool_search.const ToolSearchToolSearch ToolSearch = "tool_search"
-
Description stringDescription shown to the model for a client-executed tool search tool.
-
Execution ToolSearchToolExecutionWhether tool search is executed by the server or by the client.
-
const ToolSearchToolExecutionServer ToolSearchToolExecution = "server" -
const ToolSearchToolExecutionClient ToolSearchToolExecution = "client"
-
-
Parameters anyParameter schema for a client-executed tool search tool.
-
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
Type WebSearchPreviewToolTypeThe type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
const WebSearchPreviewToolTypeWebSearchPreview WebSearchPreviewToolType = "web_search_preview" -
const WebSearchPreviewToolTypeWebSearchPreview2025_03_11 WebSearchPreviewToolType = "web_search_preview_2025_03_11"
-
-
SearchContentTypes []string-
const WebSearchPreviewToolSearchContentTypeText WebSearchPreviewToolSearchContentType = "text" -
const WebSearchPreviewToolSearchContentTypeImage WebSearchPreviewToolSearchContentType = "image"
-
-
SearchContextSize WebSearchPreviewToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchPreviewToolSearchContextSizeLow WebSearchPreviewToolSearchContextSize = "low" -
const WebSearchPreviewToolSearchContextSizeMedium WebSearchPreviewToolSearchContextSize = "medium" -
const WebSearchPreviewToolSearchContextSizeHigh WebSearchPreviewToolSearchContextSize = "high"
-
-
UserLocation WebSearchPreviewToolUserLocationThe user's location.
-
Type ApproximateThe type of location approximation. Always
approximate.const ApproximateApproximate Approximate = "approximate"
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
Type ApplyPatchThe type of the tool. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
-
Type ToolSearchOutputThe item type. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
ID stringThe unique ID of this tool search output.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemParamExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemParamExecutionServer ResponseToolSearchOutputItemParamExecution = "server" -
const ResponseToolSearchOutputItemParamExecutionClient ResponseToolSearchOutputItemParamExecution = "client"
-
-
Status ResponseToolSearchOutputItemParamStatusThe status of the tool search output.
-
const ResponseToolSearchOutputItemParamStatusInProgress ResponseToolSearchOutputItemParamStatus = "in_progress" -
const ResponseToolSearchOutputItemParamStatusCompleted ResponseToolSearchOutputItemParamStatus = "completed" -
const ResponseToolSearchOutputItemParamStatusIncomplete ResponseToolSearchOutputItemParamStatus = "incomplete"
-
-
-
type ResponseInputItemAdditionalTools struct{…}-
Role DeveloperThe role that provided the additional tools. Only
developeris supported.const DeveloperDeveloper Developer = "developer"
-
Tools []ToolUnionA list of additional tools made available at this item.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type AdditionalToolsThe item type. Always
additional_tools.const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"
-
ID stringThe unique ID of this additional tools item.
-
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
ID stringThe unique identifier of the reasoning content.
-
Summary []ResponseReasoningItemSummaryReasoning summary content.
-
Text stringA summary of the reasoning output from the model so far.
-
Type SummaryTextThe type of the object. Always
summary_text.const SummaryTextSummaryText SummaryText = "summary_text"
-
-
Type ReasoningThe type of the object. Always
reasoning.const ReasoningReasoning Reasoning = "reasoning"
-
Content []ResponseReasoningItemContentReasoning text content.
-
Text stringThe reasoning text from the model.
-
Type ReasoningTextThe type of the reasoning text. Always
reasoning_text.const ReasoningTextReasoningText ReasoningText = "reasoning_text"
-
-
EncryptedContent stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
Status ResponseReasoningItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseReasoningItemStatusInProgress ResponseReasoningItemStatus = "in_progress" -
const ResponseReasoningItemStatusCompleted ResponseReasoningItemStatus = "completed" -
const ResponseReasoningItemStatusIncomplete ResponseReasoningItemStatus = "incomplete"
-
-
-
type ResponseCompactionItemParamResp struct{…}A compaction item generated by the
v1/responses/compactAPI.-
EncryptedContent stringThe encrypted content of the compaction summary.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
ID stringThe ID of the compaction item.
-
-
type ResponseInputItemImageGenerationCall struct{…}An image generation request made by the model.
-
ID stringThe unique ID of the image generation call.
-
Result stringThe generated image encoded in base64.
-
Status stringThe status of the image generation call.
-
const ResponseInputItemImageGenerationCallStatusInProgress ResponseInputItemImageGenerationCallStatus = "in_progress" -
const ResponseInputItemImageGenerationCallStatusCompleted ResponseInputItemImageGenerationCallStatus = "completed" -
const ResponseInputItemImageGenerationCallStatusGenerating ResponseInputItemImageGenerationCallStatus = "generating" -
const ResponseInputItemImageGenerationCallStatusFailed ResponseInputItemImageGenerationCallStatus = "failed"
-
-
Type ImageGenerationCallThe type of the image generation call. Always
image_generation_call.const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"
-
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
ID stringThe unique ID of the code interpreter tool call.
-
Code stringThe code to run, or null if not available.
-
ContainerID stringThe ID of the container used to run the code.
-
Outputs []ResponseCodeInterpreterToolCallOutputUnionThe outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
type ResponseCodeInterpreterToolCallOutputLogs struct{…}The logs output from the code interpreter.
-
Logs stringThe logs output from the code interpreter.
-
Type LogsThe type of the output. Always
logs.const LogsLogs Logs = "logs"
-
-
type ResponseCodeInterpreterToolCallOutputImage struct{…}The image output from the code interpreter.
-
Type ImageThe type of the output. Always
image.const ImageImage Image = "image"
-
URL stringThe URL of the image output from the code interpreter.
-
-
-
Status ResponseCodeInterpreterToolCallStatusThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
const ResponseCodeInterpreterToolCallStatusInProgress ResponseCodeInterpreterToolCallStatus = "in_progress" -
const ResponseCodeInterpreterToolCallStatusCompleted ResponseCodeInterpreterToolCallStatus = "completed" -
const ResponseCodeInterpreterToolCallStatusIncomplete ResponseCodeInterpreterToolCallStatus = "incomplete" -
const ResponseCodeInterpreterToolCallStatusInterpreting ResponseCodeInterpreterToolCallStatus = "interpreting" -
const ResponseCodeInterpreterToolCallStatusFailed ResponseCodeInterpreterToolCallStatus = "failed"
-
-
Type CodeInterpreterCallThe type of the code interpreter tool call. Always
code_interpreter_call.const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"
-
-
type ResponseInputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
ID stringThe unique ID of the local shell call.
-
Action ResponseInputItemLocalShellCallActionExecute a shell command on the server.
-
Command []stringThe command to run.
-
Env map[string, string]Environment variables to set for the command.
-
Type ExecThe type of the local shell action. Always
exec.const ExecExec Exec = "exec"
-
TimeoutMs int64Optional timeout in milliseconds for the command.
-
User stringOptional user to run the command as.
-
WorkingDirectory stringOptional working directory to run the command in.
-
-
CallID stringThe unique ID of the local shell tool call generated by the model.
-
Status stringThe status of the local shell call.
-
const ResponseInputItemLocalShellCallStatusInProgress ResponseInputItemLocalShellCallStatus = "in_progress" -
const ResponseInputItemLocalShellCallStatusCompleted ResponseInputItemLocalShellCallStatus = "completed" -
const ResponseInputItemLocalShellCallStatusIncomplete ResponseInputItemLocalShellCallStatus = "incomplete"
-
-
Type LocalShellCallThe type of the local shell call. Always
local_shell_call.const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"
-
-
type ResponseInputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
ID stringThe unique ID of the local shell tool call generated by the model.
-
Output stringA JSON string of the output of the local shell tool call.
-
Type LocalShellCallOutputThe type of the local shell tool call output. Always
local_shell_call_output.const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete.-
const ResponseInputItemLocalShellCallOutputStatusInProgress ResponseInputItemLocalShellCallOutputStatus = "in_progress" -
const ResponseInputItemLocalShellCallOutputStatusCompleted ResponseInputItemLocalShellCallOutputStatus = "completed" -
const ResponseInputItemLocalShellCallOutputStatusIncomplete ResponseInputItemLocalShellCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemShellCall struct{…}A tool representing a request to execute one or more shell commands.
-
Action ResponseInputItemShellCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []stringOrdered shell commands for the execution environment to run.
-
MaxOutputLength int64Maximum number of UTF-8 characters to capture from combined stdout and stderr output.
-
TimeoutMs int64Maximum wall-clock time in milliseconds to allow the shell commands to run.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Environment ResponseInputItemShellCallEnvironmentUnionThe environment to execute the shell commands in.
-
type LocalEnvironment struct{…} -
type ContainerReference struct{…}
-
-
Status stringThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseInputItemShellCallStatusInProgress ResponseInputItemShellCallStatus = "in_progress" -
const ResponseInputItemShellCallStatusCompleted ResponseInputItemShellCallStatus = "completed" -
const ResponseInputItemShellCallStatusIncomplete ResponseInputItemShellCallStatus = "incomplete"
-
-
-
type ResponseInputItemShellCallOutput struct{…}The streamed output items emitted by a shell tool call.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Output []ResponseFunctionShellCallOutputContentCaptured chunks of stdout and stderr output, along with their associated outcomes.
-
Outcome ResponseFunctionShellCallOutputContentOutcomeUnionThe exit or timeout outcome associated with this shell call.
-
type ResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellCallOutputContentOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64The exit code returned by the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringCaptured stderr output for the shell call.
-
Stdout stringCaptured stdout output for the shell call.
-
-
Type ShellCallOutputThe type of the item. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
ID stringThe unique ID of the shell tool call output. Populated when this item is returned via API.
-
MaxOutputLength int64The maximum number of UTF-8 characters captured for this shell call's combined output.
-
Status stringThe status of the shell call output.
-
const ResponseInputItemShellCallOutputStatusInProgress ResponseInputItemShellCallOutputStatus = "in_progress" -
const ResponseInputItemShellCallOutputStatusCompleted ResponseInputItemShellCallOutputStatus = "completed" -
const ResponseInputItemShellCallOutputStatusIncomplete ResponseInputItemShellCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemApplyPatchCall struct{…}A tool call representing a request to create, delete, or update files using diff patches.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseInputItemApplyPatchCallOperationUnionThe specific create, delete, or update instruction for the apply_patch tool call.
-
type ResponseInputItemApplyPatchCallOperationCreateFile struct{…}Instruction for creating a new file via the apply_patch tool.
-
Diff stringUnified diff content to apply when creating the file.
-
Path stringPath of the file to create relative to the workspace root.
-
Type CreateFileThe operation type. Always
create_file.const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseInputItemApplyPatchCallOperationDeleteFile struct{…}Instruction for deleting an existing file via the apply_patch tool.
-
Path stringPath of the file to delete relative to the workspace root.
-
Type DeleteFileThe operation type. Always
delete_file.const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseInputItemApplyPatchCallOperationUpdateFile struct{…}Instruction for updating an existing file via the apply_patch tool.
-
Diff stringUnified diff content to apply to the existing file.
-
Path stringPath of the file to update relative to the workspace root.
-
Type UpdateFileThe operation type. Always
update_file.const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status stringThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseInputItemApplyPatchCallStatusInProgress ResponseInputItemApplyPatchCallStatus = "in_progress" -
const ResponseInputItemApplyPatchCallStatusCompleted ResponseInputItemApplyPatchCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
-
type ResponseInputItemApplyPatchCallOutput struct{…}The streamed output emitted by an apply patch tool call.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status stringThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseInputItemApplyPatchCallOutputStatusCompleted ResponseInputItemApplyPatchCallOutputStatus = "completed" -
const ResponseInputItemApplyPatchCallOutputStatusFailed ResponseInputItemApplyPatchCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
Output stringOptional human-readable log text from the apply patch tool (e.g., patch results or errors).
-
-
type ResponseInputItemMcpListTools struct{…}A list of tools available on an MCP server.
-
ID stringThe unique ID of the list.
-
ServerLabel stringThe label of the MCP server.
-
Tools []ResponseInputItemMcpListToolsToolThe tools available on the server.
-
InputSchema anyThe JSON schema describing the tool's input.
-
Name stringThe name of the tool.
-
Annotations anyAdditional annotations about the tool.
-
Description stringThe description of the tool.
-
-
Type McpListToolsThe type of the item. Always
mcp_list_tools.const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
-
Error stringError message if the server could not list tools.
-
-
type ResponseInputItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
ID stringThe unique ID of the approval request.
-
Arguments stringA JSON string of arguments for the tool.
-
Name stringThe name of the tool to run.
-
ServerLabel stringThe label of the MCP server making the request.
-
Type McpApprovalRequestThe type of the item. Always
mcp_approval_request.const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"
-
-
type ResponseInputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
ApprovalRequestID stringThe ID of the approval request being answered.
-
Approve boolWhether the request was approved.
-
Type McpApprovalResponseThe type of the item. Always
mcp_approval_response.const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
-
ID stringThe unique ID of the approval response
-
Reason stringOptional reason for the decision.
-
-
type ResponseInputItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
ID stringThe unique ID of the tool call.
-
Arguments stringA JSON string of the arguments passed to the tool.
-
Name stringThe name of the tool that was run.
-
ServerLabel stringThe label of the MCP server running the tool.
-
Type McpCallThe type of the item. Always
mcp_call.const McpCallMcpCall McpCall = "mcp_call"
-
ApprovalRequestID stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
Error stringThe error from the tool call, if any.
-
Output stringThe output from the tool call.
-
Status stringThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
const ResponseInputItemMcpCallStatusInProgress ResponseInputItemMcpCallStatus = "in_progress" -
const ResponseInputItemMcpCallStatusCompleted ResponseInputItemMcpCallStatus = "completed" -
const ResponseInputItemMcpCallStatusIncomplete ResponseInputItemMcpCallStatus = "incomplete" -
const ResponseInputItemMcpCallStatusCalling ResponseInputItemMcpCallStatus = "calling" -
const ResponseInputItemMcpCallStatusFailed ResponseInputItemMcpCallStatus = "failed"
-
-
-
type ResponseCustomToolCallOutput struct{…}The output of a custom tool call from your code, being sent back to the model.
-
CallID stringThe call ID, used to map this custom tool call output to a custom tool call.
-
Output ResponseCustomToolCallOutputOutputUnionThe output from the custom tool call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseCustomToolCallOutputOutputOutputContentList []ResponseCustomToolCallOutputOutputOutputContentListItemUnionText, image, or file output of the custom tool call.
-
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
-
Type CustomToolCallOutputThe type of the custom tool call output. Always
custom_tool_call_output.const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"
-
ID stringThe unique ID of the custom tool call output in the OpenAI platform.
-
-
type ResponseCustomToolCall struct{…}A call to a custom tool created by the model.
-
CallID stringAn identifier used to map this custom tool call to a tool call output.
-
Input stringThe input for the custom tool call generated by the model.
-
Name stringThe name of the custom tool being called.
-
Type CustomToolCallThe type of the custom tool call. Always
custom_tool_call.const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"
-
ID stringThe unique ID of the custom tool call in the OpenAI platform.
-
Namespace stringThe namespace of the custom tool being called.
-
-
type ResponseInputItemCompactionTrigger struct{…}Compacts the current context. Must be the final input item.
-
Type CompactionTriggerThe type of the item. Always
compaction_trigger.const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"
-
-
type ResponseInputItemItemReference struct{…}An internal identifier for an item to reference.
-
ID stringThe ID of the item to reference.
-
Type stringThe type of item to reference. Always
item_reference.const ResponseInputItemItemReferenceTypeItemReference ResponseInputItemItemReferenceType = "item_reference"
-
-
-
-
Metadata MetadataSet of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
-
Model ResponsesModelModel ID used to generate the response, like
gpt-4ooro3. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models.-
string -
type ChatModel string-
const ChatModelGPT5_4 ChatModel = "gpt-5.4" -
const ChatModelGPT5_4Mini ChatModel = "gpt-5.4-mini" -
const ChatModelGPT5_4Nano ChatModel = "gpt-5.4-nano" -
const ChatModelGPT5_4Mini2026_03_17 ChatModel = "gpt-5.4-mini-2026-03-17" -
const ChatModelGPT5_4Nano2026_03_17 ChatModel = "gpt-5.4-nano-2026-03-17" -
const ChatModelGPT5_3ChatLatest ChatModel = "gpt-5.3-chat-latest" -
const ChatModelGPT5_2 ChatModel = "gpt-5.2" -
const ChatModelGPT5_2_2025_12_11 ChatModel = "gpt-5.2-2025-12-11" -
const ChatModelGPT5_2ChatLatest ChatModel = "gpt-5.2-chat-latest" -
const ChatModelGPT5_2Pro ChatModel = "gpt-5.2-pro" -
const ChatModelGPT5_2Pro2025_12_11 ChatModel = "gpt-5.2-pro-2025-12-11" -
const ChatModelGPT5_1 ChatModel = "gpt-5.1" -
const ChatModelGPT5_1_2025_11_13 ChatModel = "gpt-5.1-2025-11-13" -
const ChatModelGPT5_1Codex ChatModel = "gpt-5.1-codex" -
const ChatModelGPT5_1Mini ChatModel = "gpt-5.1-mini" -
const ChatModelGPT5_1ChatLatest ChatModel = "gpt-5.1-chat-latest" -
const ChatModelGPT5 ChatModel = "gpt-5" -
const ChatModelGPT5Mini ChatModel = "gpt-5-mini" -
const ChatModelGPT5Nano ChatModel = "gpt-5-nano" -
const ChatModelGPT5_2025_08_07 ChatModel = "gpt-5-2025-08-07" -
const ChatModelGPT5Mini2025_08_07 ChatModel = "gpt-5-mini-2025-08-07" -
const ChatModelGPT5Nano2025_08_07 ChatModel = "gpt-5-nano-2025-08-07" -
const ChatModelGPT5ChatLatest ChatModel = "gpt-5-chat-latest" -
const ChatModelGPT4_1 ChatModel = "gpt-4.1" -
const ChatModelGPT4_1Mini ChatModel = "gpt-4.1-mini" -
const ChatModelGPT4_1Nano ChatModel = "gpt-4.1-nano" -
const ChatModelGPT4_1_2025_04_14 ChatModel = "gpt-4.1-2025-04-14" -
const ChatModelGPT4_1Mini2025_04_14 ChatModel = "gpt-4.1-mini-2025-04-14" -
const ChatModelGPT4_1Nano2025_04_14 ChatModel = "gpt-4.1-nano-2025-04-14" -
const ChatModelO4Mini ChatModel = "o4-mini" -
const ChatModelO4Mini2025_04_16 ChatModel = "o4-mini-2025-04-16" -
const ChatModelO3 ChatModel = "o3" -
const ChatModelO3_2025_04_16 ChatModel = "o3-2025-04-16" -
const ChatModelO3Mini ChatModel = "o3-mini" -
const ChatModelO3Mini2025_01_31 ChatModel = "o3-mini-2025-01-31" -
const ChatModelO1 ChatModel = "o1" -
const ChatModelO1_2024_12_17 ChatModel = "o1-2024-12-17" -
const ChatModelO1Preview ChatModel = "o1-preview" -
const ChatModelO1Preview2024_09_12 ChatModel = "o1-preview-2024-09-12" -
const ChatModelO1Mini ChatModel = "o1-mini" -
const ChatModelO1Mini2024_09_12 ChatModel = "o1-mini-2024-09-12" -
const ChatModelGPT4o ChatModel = "gpt-4o" -
const ChatModelGPT4o2024_11_20 ChatModel = "gpt-4o-2024-11-20" -
const ChatModelGPT4o2024_08_06 ChatModel = "gpt-4o-2024-08-06" -
const ChatModelGPT4o2024_05_13 ChatModel = "gpt-4o-2024-05-13" -
const ChatModelGPT4oAudioPreview ChatModel = "gpt-4o-audio-preview" -
const ChatModelGPT4oAudioPreview2024_10_01 ChatModel = "gpt-4o-audio-preview-2024-10-01" -
const ChatModelGPT4oAudioPreview2024_12_17 ChatModel = "gpt-4o-audio-preview-2024-12-17" -
const ChatModelGPT4oAudioPreview2025_06_03 ChatModel = "gpt-4o-audio-preview-2025-06-03" -
const ChatModelGPT4oMiniAudioPreview ChatModel = "gpt-4o-mini-audio-preview" -
const ChatModelGPT4oMiniAudioPreview2024_12_17 ChatModel = "gpt-4o-mini-audio-preview-2024-12-17" -
const ChatModelGPT4oSearchPreview ChatModel = "gpt-4o-search-preview" -
const ChatModelGPT4oMiniSearchPreview ChatModel = "gpt-4o-mini-search-preview" -
const ChatModelGPT4oSearchPreview2025_03_11 ChatModel = "gpt-4o-search-preview-2025-03-11" -
const ChatModelGPT4oMiniSearchPreview2025_03_11 ChatModel = "gpt-4o-mini-search-preview-2025-03-11" -
const ChatModelChatgpt4oLatest ChatModel = "chatgpt-4o-latest" -
const ChatModelCodexMiniLatest ChatModel = "codex-mini-latest" -
const ChatModelGPT4oMini ChatModel = "gpt-4o-mini" -
const ChatModelGPT4oMini2024_07_18 ChatModel = "gpt-4o-mini-2024-07-18" -
const ChatModelGPT4Turbo ChatModel = "gpt-4-turbo" -
const ChatModelGPT4Turbo2024_04_09 ChatModel = "gpt-4-turbo-2024-04-09" -
const ChatModelGPT4_0125Preview ChatModel = "gpt-4-0125-preview" -
const ChatModelGPT4TurboPreview ChatModel = "gpt-4-turbo-preview" -
const ChatModelGPT4_1106Preview ChatModel = "gpt-4-1106-preview" -
const ChatModelGPT4VisionPreview ChatModel = "gpt-4-vision-preview" -
const ChatModelGPT4 ChatModel = "gpt-4" -
const ChatModelGPT4_0314 ChatModel = "gpt-4-0314" -
const ChatModelGPT4_0613 ChatModel = "gpt-4-0613" -
const ChatModelGPT4_32k ChatModel = "gpt-4-32k" -
const ChatModelGPT4_32k0314 ChatModel = "gpt-4-32k-0314" -
const ChatModelGPT4_32k0613 ChatModel = "gpt-4-32k-0613" -
const ChatModelGPT3_5Turbo ChatModel = "gpt-3.5-turbo" -
const ChatModelGPT3_5Turbo16k ChatModel = "gpt-3.5-turbo-16k" -
const ChatModelGPT3_5Turbo0301 ChatModel = "gpt-3.5-turbo-0301" -
const ChatModelGPT3_5Turbo0613 ChatModel = "gpt-3.5-turbo-0613" -
const ChatModelGPT3_5Turbo1106 ChatModel = "gpt-3.5-turbo-1106" -
const ChatModelGPT3_5Turbo0125 ChatModel = "gpt-3.5-turbo-0125" -
const ChatModelGPT3_5Turbo16k0613 ChatModel = "gpt-3.5-turbo-16k-0613"
-
-
type ResponsesModel string-
const ResponsesModelO1Pro ResponsesModel = "o1-pro" -
const ResponsesModelO1Pro2025_03_19 ResponsesModel = "o1-pro-2025-03-19" -
const ResponsesModelO3Pro ResponsesModel = "o3-pro" -
const ResponsesModelO3Pro2025_06_10 ResponsesModel = "o3-pro-2025-06-10" -
const ResponsesModelO3DeepResearch ResponsesModel = "o3-deep-research" -
const ResponsesModelO3DeepResearch2025_06_26 ResponsesModel = "o3-deep-research-2025-06-26" -
const ResponsesModelO4MiniDeepResearch ResponsesModel = "o4-mini-deep-research" -
const ResponsesModelO4MiniDeepResearch2025_06_26 ResponsesModel = "o4-mini-deep-research-2025-06-26" -
const ResponsesModelComputerUsePreview ResponsesModel = "computer-use-preview" -
const ResponsesModelComputerUsePreview2025_03_11 ResponsesModel = "computer-use-preview-2025-03-11" -
const ResponsesModelGPT5Codex ResponsesModel = "gpt-5-codex" -
const ResponsesModelGPT5Pro ResponsesModel = "gpt-5-pro" -
const ResponsesModelGPT5Pro2025_10_06 ResponsesModel = "gpt-5-pro-2025-10-06" -
const ResponsesModelGPT5_1CodexMax ResponsesModel = "gpt-5.1-codex-max"
-
-
-
Object ResponseThe object type of this resource - always set to
response.const ResponseResponse Response = "response"
-
Output []ResponseOutputItemUnionAn array of content items generated by the model.
-
The length and order of items in the
outputarray is dependent on the model's response. -
Rather than accessing the first item in the
outputarray and assuming it's anassistantmessage with the content generated by the model, you might consider using theoutput_textproperty where supported in SDKs. -
type ResponseOutputMessage struct{…}An output message from the model.
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
type ResponseFunctionToolCall struct{…}A tool call to run a function. See the function calling guide for more information.
-
type ResponseFunctionToolCallOutputItem struct{…}-
ID stringThe unique ID of the function call tool output.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseFunctionToolCallOutputItemOutputUnionThe output from the function call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseFunctionToolCallOutputItemOutputOutputContentList []ResponseFunctionToolCallOutputItemOutputOutputContentListItemUnionText, image, or file output of the function call.
-
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
-
Status ResponseFunctionToolCallOutputItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallOutputItemStatusInProgress ResponseFunctionToolCallOutputItemStatus = "in_progress" -
const ResponseFunctionToolCallOutputItemStatusCompleted ResponseFunctionToolCallOutputItemStatus = "completed" -
const ResponseFunctionToolCallOutputItemStatusIncomplete ResponseFunctionToolCallOutputItemStatus = "incomplete"
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
type ResponseComputerToolCallOutputItem struct{…}-
ID stringThe unique ID of the computer call tool output.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Status ResponseComputerToolCallOutputItemStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseComputerToolCallOutputItemStatusCompleted ResponseComputerToolCallOutputItemStatus = "completed" -
const ResponseComputerToolCallOutputItemStatusIncomplete ResponseComputerToolCallOutputItemStatus = "incomplete" -
const ResponseComputerToolCallOutputItemStatusFailed ResponseComputerToolCallOutputItemStatus = "failed" -
const ResponseComputerToolCallOutputItemStatusInProgress ResponseComputerToolCallOutputItemStatus = "in_progress"
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
AcknowledgedSafetyChecks []ResponseComputerToolCallOutputItemAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context. -
type ResponseToolSearchCall struct{…}-
ID stringThe unique ID of the tool search call item.
-
Arguments anyArguments used for the tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchCallExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchCallExecutionServer ResponseToolSearchCallExecution = "server" -
const ResponseToolSearchCallExecutionClient ResponseToolSearchCallExecution = "client"
-
-
Status ResponseToolSearchCallStatusThe status of the tool search call item that was recorded.
-
const ResponseToolSearchCallStatusInProgress ResponseToolSearchCallStatus = "in_progress" -
const ResponseToolSearchCallStatusCompleted ResponseToolSearchCallStatus = "completed" -
const ResponseToolSearchCallStatusIncomplete ResponseToolSearchCallStatus = "incomplete"
-
-
Type ToolSearchCallThe type of the item. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseToolSearchOutputItem struct{…}-
ID stringThe unique ID of the tool search output item.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemExecutionServer ResponseToolSearchOutputItemExecution = "server" -
const ResponseToolSearchOutputItemExecutionClient ResponseToolSearchOutputItemExecution = "client"
-
-
Status ResponseToolSearchOutputItemStatusThe status of the tool search output item that was recorded.
-
const ResponseToolSearchOutputItemStatusInProgress ResponseToolSearchOutputItemStatus = "in_progress" -
const ResponseToolSearchOutputItemStatusCompleted ResponseToolSearchOutputItemStatus = "completed" -
const ResponseToolSearchOutputItemStatusIncomplete ResponseToolSearchOutputItemStatus = "incomplete"
-
-
Tools []ToolUnionThe loaded tool definitions returned by tool search.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type ToolSearchOutputThe type of the item. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseOutputItemAdditionalTools struct{…}-
ID stringThe unique ID of the additional tools item.
-
Role stringThe role that provided the additional tools.
-
const ResponseOutputItemAdditionalToolsRoleUnknown ResponseOutputItemAdditionalToolsRole = "unknown" -
const ResponseOutputItemAdditionalToolsRoleUser ResponseOutputItemAdditionalToolsRole = "user" -
const ResponseOutputItemAdditionalToolsRoleAssistant ResponseOutputItemAdditionalToolsRole = "assistant" -
const ResponseOutputItemAdditionalToolsRoleSystem ResponseOutputItemAdditionalToolsRole = "system" -
const ResponseOutputItemAdditionalToolsRoleCritic ResponseOutputItemAdditionalToolsRole = "critic" -
const ResponseOutputItemAdditionalToolsRoleDiscriminator ResponseOutputItemAdditionalToolsRole = "discriminator" -
const ResponseOutputItemAdditionalToolsRoleDeveloper ResponseOutputItemAdditionalToolsRole = "developer" -
const ResponseOutputItemAdditionalToolsRoleTool ResponseOutputItemAdditionalToolsRole = "tool"
-
-
Tools []ToolUnionThe additional tool definitions made available at this item.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type AdditionalToolsThe type of the item. Always
additional_tools.const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"
-
-
type ResponseCompactionItem struct{…}A compaction item generated by the
v1/responses/compactAPI.-
ID stringThe unique ID of the compaction item.
-
EncryptedContent stringThe encrypted content that was produced by compaction.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseOutputItemImageGenerationCall struct{…}An image generation request made by the model.
-
ID stringThe unique ID of the image generation call.
-
Result stringThe generated image encoded in base64.
-
Status stringThe status of the image generation call.
-
const ResponseOutputItemImageGenerationCallStatusInProgress ResponseOutputItemImageGenerationCallStatus = "in_progress" -
const ResponseOutputItemImageGenerationCallStatusCompleted ResponseOutputItemImageGenerationCallStatus = "completed" -
const ResponseOutputItemImageGenerationCallStatusGenerating ResponseOutputItemImageGenerationCallStatus = "generating" -
const ResponseOutputItemImageGenerationCallStatusFailed ResponseOutputItemImageGenerationCallStatus = "failed"
-
-
Type ImageGenerationCallThe type of the image generation call. Always
image_generation_call.const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"
-
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
type ResponseOutputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
ID stringThe unique ID of the local shell call.
-
Action ResponseOutputItemLocalShellCallActionExecute a shell command on the server.
-
Command []stringThe command to run.
-
Env map[string, string]Environment variables to set for the command.
-
Type ExecThe type of the local shell action. Always
exec.const ExecExec Exec = "exec"
-
TimeoutMs int64Optional timeout in milliseconds for the command.
-
User stringOptional user to run the command as.
-
WorkingDirectory stringOptional working directory to run the command in.
-
-
CallID stringThe unique ID of the local shell tool call generated by the model.
-
Status stringThe status of the local shell call.
-
const ResponseOutputItemLocalShellCallStatusInProgress ResponseOutputItemLocalShellCallStatus = "in_progress" -
const ResponseOutputItemLocalShellCallStatusCompleted ResponseOutputItemLocalShellCallStatus = "completed" -
const ResponseOutputItemLocalShellCallStatusIncomplete ResponseOutputItemLocalShellCallStatus = "incomplete"
-
-
Type LocalShellCallThe type of the local shell call. Always
local_shell_call.const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"
-
-
type ResponseOutputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
ID stringThe unique ID of the local shell tool call generated by the model.
-
Output stringA JSON string of the output of the local shell tool call.
-
Type LocalShellCallOutputThe type of the local shell tool call output. Always
local_shell_call_output.const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete.-
const ResponseOutputItemLocalShellCallOutputStatusInProgress ResponseOutputItemLocalShellCallOutputStatus = "in_progress" -
const ResponseOutputItemLocalShellCallOutputStatusCompleted ResponseOutputItemLocalShellCallOutputStatus = "completed" -
const ResponseOutputItemLocalShellCallOutputStatusIncomplete ResponseOutputItemLocalShellCallOutputStatus = "incomplete"
-
-
-
type ResponseFunctionShellToolCall struct{…}A tool call that executes one or more shell commands in a managed environment.
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Action ResponseFunctionShellToolCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []string -
MaxOutputLength int64Optional maximum number of characters to return from each command.
-
TimeoutMs int64Optional timeout in milliseconds for the commands.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Environment ResponseFunctionShellToolCallEnvironmentUnionRepresents the use of a local environment to perform shell actions.
-
type ResponseLocalEnvironment struct{…}Represents the use of a local environment to perform shell actions.
-
Type LocalThe environment type. Always
local.const LocalLocal Local = "local"
-
-
type ResponseContainerReference struct{…}Represents a container created with /v1/containers.
-
ContainerID string -
Type ContainerReferenceThe environment type. Always
container_reference.const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
Status ResponseFunctionShellToolCallStatusThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallStatusInProgress ResponseFunctionShellToolCallStatus = "in_progress" -
const ResponseFunctionShellToolCallStatusCompleted ResponseFunctionShellToolCallStatus = "completed" -
const ResponseFunctionShellToolCallStatusIncomplete ResponseFunctionShellToolCallStatus = "incomplete"
-
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseFunctionShellToolCallOutput struct{…}The output of a shell tool call that was emitted.
-
ID stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
MaxOutputLength int64The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
Output []ResponseFunctionShellToolCallOutputOutputAn array of shell call output contents
-
Outcome ResponseFunctionShellToolCallOutputOutputOutcomeUnionRepresents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
type ResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64Exit code from the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringThe standard error output that was captured.
-
Stdout stringThe standard output that was captured.
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
Status ResponseFunctionShellToolCallOutputStatusThe status of the shell call output. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallOutputStatusInProgress ResponseFunctionShellToolCallOutputStatus = "in_progress" -
const ResponseFunctionShellToolCallOutputStatusCompleted ResponseFunctionShellToolCallOutputStatus = "completed" -
const ResponseFunctionShellToolCallOutputStatusIncomplete ResponseFunctionShellToolCallOutputStatus = "incomplete"
-
-
Type ShellCallOutputThe type of the shell call output. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseApplyPatchToolCall struct{…}A tool call that applies file diffs by creating, deleting, or updating files.
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseApplyPatchToolCallOperationUnionOne of the create_file, delete_file, or update_file operations applied via apply_patch.
-
type ResponseApplyPatchToolCallOperationCreateFile struct{…}Instruction describing how to create a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to create.
-
Type CreateFileCreate a new file with the provided diff.
const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseApplyPatchToolCallOperationDeleteFile struct{…}Instruction describing how to delete a file via the apply_patch tool.
-
Path stringPath of the file to delete.
-
Type DeleteFileDelete the specified file.
const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseApplyPatchToolCallOperationUpdateFile struct{…}Instruction describing how to update a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to update.
-
Type UpdateFileUpdate an existing file with the provided diff.
const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status ResponseApplyPatchToolCallStatusThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseApplyPatchToolCallStatusInProgress ResponseApplyPatchToolCallStatus = "in_progress" -
const ResponseApplyPatchToolCallStatusCompleted ResponseApplyPatchToolCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseApplyPatchToolCallOutput struct{…}The output emitted by an apply patch tool call.
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status ResponseApplyPatchToolCallOutputStatusThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseApplyPatchToolCallOutputStatusCompleted ResponseApplyPatchToolCallOutputStatus = "completed" -
const ResponseApplyPatchToolCallOutputStatusFailed ResponseApplyPatchToolCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
CreatedBy stringThe ID of the entity that created this tool call output.
-
Output stringOptional textual output returned by the apply patch tool.
-
-
type ResponseOutputItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
ID stringThe unique ID of the tool call.
-
Arguments stringA JSON string of the arguments passed to the tool.
-
Name stringThe name of the tool that was run.
-
ServerLabel stringThe label of the MCP server running the tool.
-
Type McpCallThe type of the item. Always
mcp_call.const McpCallMcpCall McpCall = "mcp_call"
-
ApprovalRequestID stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
Error stringThe error from the tool call, if any.
-
Output stringThe output from the tool call.
-
Status stringThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
const ResponseOutputItemMcpCallStatusInProgress ResponseOutputItemMcpCallStatus = "in_progress" -
const ResponseOutputItemMcpCallStatusCompleted ResponseOutputItemMcpCallStatus = "completed" -
const ResponseOutputItemMcpCallStatusIncomplete ResponseOutputItemMcpCallStatus = "incomplete" -
const ResponseOutputItemMcpCallStatusCalling ResponseOutputItemMcpCallStatus = "calling" -
const ResponseOutputItemMcpCallStatusFailed ResponseOutputItemMcpCallStatus = "failed"
-
-
-
type ResponseOutputItemMcpListTools struct{…}A list of tools available on an MCP server.
-
ID stringThe unique ID of the list.
-
ServerLabel stringThe label of the MCP server.
-
Tools []ResponseOutputItemMcpListToolsToolThe tools available on the server.
-
InputSchema anyThe JSON schema describing the tool's input.
-
Name stringThe name of the tool.
-
Annotations anyAdditional annotations about the tool.
-
Description stringThe description of the tool.
-
-
Type McpListToolsThe type of the item. Always
mcp_list_tools.const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
-
Error stringError message if the server could not list tools.
-
-
type ResponseOutputItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
ID stringThe unique ID of the approval request.
-
Arguments stringA JSON string of arguments for the tool.
-
Name stringThe name of the tool to run.
-
ServerLabel stringThe label of the MCP server making the request.
-
Type McpApprovalRequestThe type of the item. Always
mcp_approval_request.const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"
-
-
type ResponseOutputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
ID stringThe unique ID of the approval response
-
ApprovalRequestID stringThe ID of the approval request being answered.
-
Approve boolWhether the request was approved.
-
Type McpApprovalResponseThe type of the item. Always
mcp_approval_response.const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
-
Reason stringOptional reason for the decision.
-
-
type ResponseCustomToolCall struct{…}A call to a custom tool created by the model.
-
type ResponseCustomToolCallOutputItem struct{…}The output of a custom tool call from your code, being sent back to the model.
-
ID stringThe unique ID of the custom tool call output item.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseCustomToolCallOutputItemStatusInProgress ResponseCustomToolCallOutputItemStatus = "in_progress" -
const ResponseCustomToolCallOutputItemStatusCompleted ResponseCustomToolCallOutputItemStatus = "completed" -
const ResponseCustomToolCallOutputItemStatusIncomplete ResponseCustomToolCallOutputItemStatus = "incomplete"
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
-
ParallelToolCalls boolWhether to allow the model to run tool calls in parallel.
-
Temperature float64What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or
top_pbut not both. -
ToolChoice ResponseToolChoiceUnionHow the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call.-
type ToolChoiceOptions stringControls which (if any) tool is called by the model.
nonemeans the model will not call any tool and instead generates a message.automeans the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools.-
const ToolChoiceOptionsNone ToolChoiceOptions = "none" -
const ToolChoiceOptionsAuto ToolChoiceOptions = "auto" -
const ToolChoiceOptionsRequired ToolChoiceOptions = "required"
-
-
type ToolChoiceAllowed struct{…}Constrains the tools available to the model to a pre-defined set.
-
Mode ToolChoiceAllowedModeConstrains the tools available to the model to a pre-defined set.
autoallows the model to pick from among the allowed tools and generate a message.requiredrequires the model to call one or more of the allowed tools.-
const ToolChoiceAllowedModeAuto ToolChoiceAllowedMode = "auto" -
const ToolChoiceAllowedModeRequired ToolChoiceAllowedMode = "required"
-
-
Tools []map[string, any]A list of tool definitions that the model should be allowed to call.
For the Responses API, the list of tool definitions might look like:
[ { "type": "function", "name": "get_weather" }, { "type": "mcp", "server_label": "deepwiki" }, { "type": "image_generation" } ] -
Type AllowedToolsAllowed tool configuration type. Always
allowed_tools.const AllowedToolsAllowedTools AllowedTools = "allowed_tools"
-
-
type ToolChoiceTypes struct{…}Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
-
Type ToolChoiceTypesTypeThe type of hosted tool the model should to use. Learn more about built-in tools.
Allowed values are:
-
file_search -
web_search_preview -
computer -
computer_use_preview -
computer_use -
code_interpreter -
image_generation -
const ToolChoiceTypesTypeFileSearch ToolChoiceTypesType = "file_search" -
const ToolChoiceTypesTypeWebSearchPreview ToolChoiceTypesType = "web_search_preview" -
const ToolChoiceTypesTypeComputer ToolChoiceTypesType = "computer" -
const ToolChoiceTypesTypeComputerUsePreview ToolChoiceTypesType = "computer_use_preview" -
const ToolChoiceTypesTypeComputerUse ToolChoiceTypesType = "computer_use" -
const ToolChoiceTypesTypeWebSearchPreview2025_03_11 ToolChoiceTypesType = "web_search_preview_2025_03_11" -
const ToolChoiceTypesTypeImageGeneration ToolChoiceTypesType = "image_generation" -
const ToolChoiceTypesTypeCodeInterpreter ToolChoiceTypesType = "code_interpreter"
-
-
-
type ToolChoiceFunction struct{…}Use this option to force the model to call a specific function.
-
Name stringThe name of the function to call.
-
Type FunctionFor function calling, the type is always
function.const FunctionFunction Function = "function"
-
-
type ToolChoiceMcp struct{…}Use this option to force the model to call a specific tool on a remote MCP server.
-
ServerLabel stringThe label of the MCP server to use.
-
Type McpFor MCP tools, the type is always
mcp.const McpMcp Mcp = "mcp"
-
Name stringThe name of the tool to call on the server.
-
-
type ToolChoiceCustom struct{…}Use this option to force the model to call a specific custom tool.
-
Name stringThe name of the custom tool to call.
-
Type CustomFor custom tool calling, the type is always
custom.const CustomCustom Custom = "custom"
-
-
type ToolChoiceApplyPatch struct{…}Forces the model to call the apply_patch tool when executing a tool call.
-
Type ApplyPatchThe tool to call. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
type ToolChoiceShell struct{…}Forces the model to call the shell tool when a tool call is required.
-
Type ShellThe tool to call. Always
shell.const ShellShell Shell = "shell"
-
-
-
Tools []ToolUnionAn array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.We support the following categories of tools:
-
Built-in tools: Tools that are provided by OpenAI that extend the model's capabilities, like web search or file search. Learn more about built-in tools.
-
MCP Tools: Integrations with third-party systems via custom MCP servers or predefined connectors such as Google Drive and SharePoint. Learn more about MCP Tools.
-
Function calls (custom tools): Functions that are defined by you, enabling the model to call your own code with strongly typed arguments and outputs. Learn more about function calling. You can also use custom tools to call your own code.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
TopP float64An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
We generally recommend altering this or
temperaturebut not both. -
Background boolWhether to run the model response in the background. Learn more.
-
CompletedAt float64Unix timestamp (in seconds) of when this Response was completed. Only present when the status is
completed. -
Conversation ResponseConversationThe conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
-
ID stringThe unique ID of the conversation that this response was associated with.
-
-
MaxOutputTokens int64An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
MaxToolCalls int64The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored.
-
Moderation ResponseModerationModeration results for the response input and output, if moderated completions were requested.
-
Input ResponseModerationInputUnionModeration for the response input.
-
type ResponseModerationInputModerationResult struct{…}A moderation result produced for the response input or output.
-
Categories map[string, bool]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
CategoryAppliedInputTypes map[string, []string]Which modalities of input are reflected by the score for each category.
-
const ResponseModerationInputModerationResultCategoryAppliedInputTypeText ResponseModerationInputModerationResultCategoryAppliedInputType = "text" -
const ResponseModerationInputModerationResultCategoryAppliedInputTypeImage ResponseModerationInputModerationResultCategoryAppliedInputType = "image"
-
-
CategoryScores map[string, float64]A dictionary of moderation categories to scores.
-
Flagged boolA boolean indicating whether the content was flagged by any category.
-
Model stringThe moderation model that produced this result.
-
Type ModerationResultThe object type, which was always
moderation_resultfor successful moderation results.const ModerationResultModerationResult ModerationResult = "moderation_result"
-
-
type ResponseModerationInputError struct{…}An error produced while attempting moderation for the response input or output.
-
Code stringThe error code.
-
Message stringThe error message.
-
Type ErrorThe object type, which was always
errorfor moderation failures.const ErrorError Error = "error"
-
-
-
Output ResponseModerationOutputUnionModeration for the response output.
-
type ResponseModerationOutputModerationResult struct{…}A moderation result produced for the response input or output.
-
Categories map[string, bool]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
CategoryAppliedInputTypes map[string, []string]Which modalities of input are reflected by the score for each category.
-
const ResponseModerationOutputModerationResultCategoryAppliedInputTypeText ResponseModerationOutputModerationResultCategoryAppliedInputType = "text" -
const ResponseModerationOutputModerationResultCategoryAppliedInputTypeImage ResponseModerationOutputModerationResultCategoryAppliedInputType = "image"
-
-
CategoryScores map[string, float64]A dictionary of moderation categories to scores.
-
Flagged boolA boolean indicating whether the content was flagged by any category.
-
Model stringThe moderation model that produced this result.
-
Type ModerationResultThe object type, which was always
moderation_resultfor successful moderation results.const ModerationResultModerationResult ModerationResult = "moderation_result"
-
-
type ResponseModerationOutputError struct{…}An error produced while attempting moderation for the response input or output.
-
Code stringThe error code.
-
Message stringThe error message.
-
Type ErrorThe object type, which was always
errorfor moderation failures.const ErrorError Error = "error"
-
-
-
-
PreviousResponseID stringThe unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about conversation state. Cannot be used in conjunction with
conversation. -
Prompt ResponsePromptReference to a prompt template and its variables. Learn more.
-
ID stringThe unique identifier of the prompt template to use.
-
Variables map[string, ResponsePromptVariableUnion]Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files.
-
string -
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
Version stringOptional version of the prompt template.
-
-
PromptCacheKey stringUsed by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more. -
PromptCacheRetention ResponsePromptCacheRetentionThe retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. Forgpt-5.5,gpt-5.5-pro, and future models, only24his supported.For older models that support both
in_memoryand24h, the default depends on your organization's data retention policy:-
Organizations without ZDR enabled default to
24h. -
Organizations with ZDR enabled default to
in_memorywhenprompt_cache_retentionis not specified. -
const ResponsePromptCacheRetentionInMemory ResponsePromptCacheRetention = "in_memory" -
const ResponsePromptCacheRetention24h ResponsePromptCacheRetention = "24h"
-
-
Reasoning Reasoninggpt-5 and o-series models only
Configuration options for reasoning models.
-
Context ReasoningContextControls which reasoning items are rendered back to the model on later turns. When returned on a response, this is the effective reasoning context mode used for the response.
-
const ReasoningContextAuto ReasoningContext = "auto" -
const ReasoningContextCurrentTurn ReasoningContext = "current_turn" -
const ReasoningContextAllTurns ReasoningContext = "all_turns"
-
-
Effort ReasoningEffortConstrains effort on reasoning for reasoning models. Currently supported values are
none,minimal,low,medium,high, andxhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.-
gpt-5.1defaults tonone, which does not perform reasoning. The supported reasoning values forgpt-5.1arenone,low,medium, andhigh. Tool calls are supported for all reasoning values in gpt-5.1. -
All models before
gpt-5.1default tomediumreasoning effort, and do not supportnone. -
The
gpt-5-promodel defaults to (and only supports)highreasoning effort. -
xhighis supported for all models aftergpt-5.1-codex-max. -
const ReasoningEffortNone ReasoningEffort = "none" -
const ReasoningEffortMinimal ReasoningEffort = "minimal" -
const ReasoningEffortLow ReasoningEffort = "low" -
const ReasoningEffortMedium ReasoningEffort = "medium" -
const ReasoningEffortHigh ReasoningEffort = "high" -
const ReasoningEffortXhigh ReasoningEffort = "xhigh"
-
-
GenerateSummary ReasoningGenerateSummaryDeprecated: use
summaryinstead.A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.-
const ReasoningGenerateSummaryAuto ReasoningGenerateSummary = "auto" -
const ReasoningGenerateSummaryConcise ReasoningGenerateSummary = "concise" -
const ReasoningGenerateSummaryDetailed ReasoningGenerateSummary = "detailed"
-
-
Summary ReasoningSummaryA summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.conciseis supported forcomputer-use-previewmodels and all reasoning models aftergpt-5.-
const ReasoningSummaryAuto ReasoningSummary = "auto" -
const ReasoningSummaryConcise ReasoningSummary = "concise" -
const ReasoningSummaryDetailed ReasoningSummary = "detailed"
-
-
-
SafetyIdentifier stringA stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
ServiceTier ResponseServiceTierSpecifies the processing type used for serving the request.
- If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'.
- If set to 'default', then the request will be processed with the standard pricing and performance for the selected model.
- If set to 'flex' or 'priority', then the request will be processed with the corresponding service tier.
- When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.-
const ResponseServiceTierAuto ResponseServiceTier = "auto" -
const ResponseServiceTierDefault ResponseServiceTier = "default" -
const ResponseServiceTierFlex ResponseServiceTier = "flex" -
const ResponseServiceTierScale ResponseServiceTier = "scale" -
const ResponseServiceTierPriority ResponseServiceTier = "priority"
-
Status ResponseStatusThe status of the response generation. One of
completed,failed,in_progress,cancelled,queued, orincomplete.-
const ResponseStatusCompleted ResponseStatus = "completed" -
const ResponseStatusFailed ResponseStatus = "failed" -
const ResponseStatusInProgress ResponseStatus = "in_progress" -
const ResponseStatusCancelled ResponseStatus = "cancelled" -
const ResponseStatusQueued ResponseStatus = "queued" -
const ResponseStatusIncomplete ResponseStatus = "incomplete"
-
-
Text ResponseTextConfigConfiguration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
Format ResponseFormatTextConfigUnionAn object specifying the format that the model must output.
Configuring
{ "type": "json_schema" }enables Structured Outputs, which ensures the model will match your supplied JSON schema. Learn more in the Structured Outputs guide.The default format is
{ "type": "text" }with no additional options.Not recommended for gpt-4o and newer models:
Setting to
{ "type": "json_object" }enables the older JSON mode, which ensures the message the model generates is valid JSON. Usingjson_schemais preferred for models that support it.-
type ResponseFormatText struct{…}Default response format. Used to generate text responses.
-
Type TextThe type of response format being defined. Always
text.const TextText Text = "text"
-
-
type ResponseFormatTextJSONSchemaConfig struct{…}JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
Name stringThe name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
-
Schema map[string, any]The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
-
Type JSONSchemaThe type of response format being defined. Always
json_schema.const JSONSchemaJSONSchema JSONSchema = "json_schema"
-
Description stringA description of what the response format is for, used by the model to determine how to respond in the format.
-
Strict boolWhether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the
schemafield. Only a subset of JSON Schema is supported whenstrictistrue. To learn more, read the Structured Outputs guide.
-
-
type ResponseFormatJSONObject struct{…}JSON object response format. An older method of generating JSON responses. Using
json_schemais 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 JSONObjectThe type of response format being defined. Always
json_object.const JSONObjectJSONObject JSONObject = "json_object"
-
-
-
Verbosity ResponseTextConfigVerbosityConstrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses. Currently supported values are
low,medium, andhigh.-
const ResponseTextConfigVerbosityLow ResponseTextConfigVerbosity = "low" -
const ResponseTextConfigVerbosityMedium ResponseTextConfigVerbosity = "medium" -
const ResponseTextConfigVerbosityHigh ResponseTextConfigVerbosity = "high"
-
-
TopLogprobs int64An integer between 0 and 20 specifying the maximum number of most likely tokens to return at each token position, each with an associated log probability. In some cases, the number of returned tokens may be fewer than requested.
-
Truncation ResponseTruncationThe truncation strategy to use for the model response.
-
auto: If the input to this Response exceeds the model's context window size, the model will truncate the response to fit the context window by dropping items from the beginning of the conversation. -
disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error. -
const ResponseTruncationAuto ResponseTruncation = "auto" -
const ResponseTruncationDisabled ResponseTruncation = "disabled"
-
-
Usage ResponseUsageRepresents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
-
InputTokens int64The number of input tokens.
-
InputTokensDetails ResponseUsageInputTokensDetailsA detailed breakdown of the input tokens.
-
CachedTokens int64The number of tokens that were retrieved from the cache. More on prompt caching.
-
-
OutputTokens int64The number of output tokens.
-
OutputTokensDetails ResponseUsageOutputTokensDetailsA detailed breakdown of the output tokens.
-
ReasoningTokens int64The number of reasoning tokens.
-
-
TotalTokens int64The total number of tokens used.
-
-
User stringThis field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead to maintain caching optimizations. A stable identifier for your end-users. Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. Learn more.
-
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseIncompleteThe type of the event. Always
response.incomplete.const ResponseIncompleteResponseIncomplete ResponseIncomplete = "response.incomplete"
-
Response Input
-
type ResponseInput []ResponseInputItemUnionA list of one or many input items to the model, containing different content types.
-
type EasyInputMessage struct{…}A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.-
Content EasyInputMessageContentUnionText, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
-
string -
type ResponseInputMessageContentList []ResponseInputContentUnionA list of one or many input items to the model, containing different content types.
-
type ResponseInputText struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
Detail ResponseInputImageDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageDetailLow ResponseInputImageDetail = "low" -
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high" -
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto" -
const ResponseInputImageDetailOriginal ResponseInputImageDetail = "original"
-
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFile struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileDetailLow ResponseInputFileDetail = "low" -
const ResponseInputFileDetailHigh ResponseInputFileDetail = "high"
-
-
FileData stringThe content of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Role EasyInputMessageRoleThe role of the message input. One of
user,assistant,system, ordeveloper.-
const EasyInputMessageRoleUser EasyInputMessageRole = "user" -
const EasyInputMessageRoleAssistant EasyInputMessageRole = "assistant" -
const EasyInputMessageRoleSystem EasyInputMessageRole = "system" -
const EasyInputMessageRoleDeveloper EasyInputMessageRole = "developer"
-
-
Phase EasyInputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const EasyInputMessagePhaseCommentary EasyInputMessagePhase = "commentary" -
const EasyInputMessagePhaseFinalAnswer EasyInputMessagePhase = "final_answer"
-
-
Type EasyInputMessageTypeThe type of the message input. Always
message.const EasyInputMessageTypeMessage EasyInputMessageType = "message"
-
-
type ResponseInputItemMessage struct{…}A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole.-
Content ResponseInputMessageContentListA list of one or many input items to the model, containing different content types.
-
Role stringThe role of the message input. One of
user,system, ordeveloper.-
const ResponseInputItemMessageRoleUser ResponseInputItemMessageRole = "user" -
const ResponseInputItemMessageRoleSystem ResponseInputItemMessageRole = "system" -
const ResponseInputItemMessageRoleDeveloper ResponseInputItemMessageRole = "developer"
-
-
Status stringThe status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputItemMessageStatusInProgress ResponseInputItemMessageStatus = "in_progress" -
const ResponseInputItemMessageStatusCompleted ResponseInputItemMessageStatus = "completed" -
const ResponseInputItemMessageStatusIncomplete ResponseInputItemMessageStatus = "incomplete"
-
-
Type stringThe type of the message input. Always set to
message.const ResponseInputItemMessageTypeMessage ResponseInputItemMessageType = "message"
-
-
type ResponseOutputMessage struct{…}An output message from the model.
-
ID stringThe unique ID of the output message.
-
Content []ResponseOutputMessageContentUnionThe content of the output message.
-
type ResponseOutputText struct{…}A text output from the model.
-
Annotations []ResponseOutputTextAnnotationUnionThe annotations of the text output.
-
type ResponseOutputTextAnnotationFileCitation struct{…}A citation to a file.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the file cited.
-
Index int64The index of the file in the list of files.
-
Type FileCitationThe type of the file citation. Always
file_citation.const FileCitationFileCitation FileCitation = "file_citation"
-
-
type ResponseOutputTextAnnotationURLCitation struct{…}A citation for a web resource used to generate a model response.
-
EndIndex int64The index of the last character of the URL citation in the message.
-
StartIndex int64The index of the first character of the URL citation in the message.
-
Title stringThe title of the web resource.
-
Type URLCitationThe type of the URL citation. Always
url_citation.const URLCitationURLCitation URLCitation = "url_citation"
-
URL stringThe URL of the web resource.
-
-
type ResponseOutputTextAnnotationContainerFileCitation struct{…}A citation for a container file used to generate a model response.
-
ContainerID stringThe ID of the container file.
-
EndIndex int64The index of the last character of the container file citation in the message.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the container file cited.
-
StartIndex int64The index of the first character of the container file citation in the message.
-
Type ContainerFileCitationThe type of the container file citation. Always
container_file_citation.const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"
-
-
type ResponseOutputTextAnnotationFilePath struct{…}A path to a file.
-
FileID stringThe ID of the file.
-
Index int64The index of the file in the list of files.
-
Type FilePathThe type of the file path. Always
file_path.const FilePathFilePath FilePath = "file_path"
-
-
-
Text stringThe text output from the model.
-
Type OutputTextThe type of the output text. Always
output_text.const OutputTextOutputText OutputText = "output_text"
-
Logprobs []ResponseOutputTextLogprob-
Token string -
Bytes []int64 -
Logprob float64 -
TopLogprobs []ResponseOutputTextLogprobTopLogprob-
Token string -
Bytes []int64 -
Logprob float64
-
-
-
-
type ResponseOutputRefusal struct{…}A refusal from the model.
-
Refusal stringThe refusal explanation from the model.
-
Type RefusalThe type of the refusal. Always
refusal.const RefusalRefusal Refusal = "refusal"
-
-
-
Role AssistantThe role of the output message. Always
assistant.const AssistantAssistant Assistant = "assistant"
-
Status ResponseOutputMessageStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseOutputMessageStatusInProgress ResponseOutputMessageStatus = "in_progress" -
const ResponseOutputMessageStatusCompleted ResponseOutputMessageStatus = "completed" -
const ResponseOutputMessageStatusIncomplete ResponseOutputMessageStatus = "incomplete"
-
-
Type MessageThe type of the output message. Always
message.const MessageMessage Message = "message"
-
Phase ResponseOutputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const ResponseOutputMessagePhaseCommentary ResponseOutputMessagePhase = "commentary" -
const ResponseOutputMessagePhaseFinalAnswer ResponseOutputMessagePhase = "final_answer"
-
-
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
ID stringThe unique ID of the file search tool call.
-
Queries []stringThe queries used to search for files.
-
Status ResponseFileSearchToolCallStatusThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
const ResponseFileSearchToolCallStatusInProgress ResponseFileSearchToolCallStatus = "in_progress" -
const ResponseFileSearchToolCallStatusSearching ResponseFileSearchToolCallStatus = "searching" -
const ResponseFileSearchToolCallStatusCompleted ResponseFileSearchToolCallStatus = "completed" -
const ResponseFileSearchToolCallStatusIncomplete ResponseFileSearchToolCallStatus = "incomplete" -
const ResponseFileSearchToolCallStatusFailed ResponseFileSearchToolCallStatus = "failed"
-
-
Type FileSearchCallThe type of the file search tool call. Always
file_search_call.const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"
-
Results []ResponseFileSearchToolCallResultThe results of the file search tool call.
-
Attributes map[string, ResponseFileSearchToolCallResultAttributeUnion]Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.
-
string -
float64 -
bool
-
-
FileID stringThe unique ID of the file.
-
Filename stringThe name of the file.
-
Score float64The relevance score of the file - a value between 0 and 1.
-
Text stringThe text that was retrieved from the file.
-
-
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
ID stringThe unique ID of the computer call.
-
CallID stringAn identifier used when responding to the tool call with output.
-
PendingSafetyChecks []ResponseComputerToolCallPendingSafetyCheckThe pending safety checks for the computer call.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status ResponseComputerToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseComputerToolCallStatusInProgress ResponseComputerToolCallStatus = "in_progress" -
const ResponseComputerToolCallStatusCompleted ResponseComputerToolCallStatus = "completed" -
const ResponseComputerToolCallStatusIncomplete ResponseComputerToolCallStatus = "incomplete"
-
-
Type ResponseComputerToolCallTypeThe type of the computer call. Always
computer_call.const ResponseComputerToolCallTypeComputerCall ResponseComputerToolCallType = "computer_call"
-
Action ResponseComputerToolCallActionUnionA click action.
-
type ResponseComputerToolCallActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ResponseComputerToolCallActionClickButtonLeft ResponseComputerToolCallActionClickButton = "left" -
const ResponseComputerToolCallActionClickButtonRight ResponseComputerToolCallActionClickButton = "right" -
const ResponseComputerToolCallActionClickButtonWheel ResponseComputerToolCallActionClickButton = "wheel" -
const ResponseComputerToolCallActionClickButtonBack ResponseComputerToolCallActionClickButton = "back" -
const ResponseComputerToolCallActionClickButtonForward ResponseComputerToolCallActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ResponseComputerToolCallActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ResponseComputerToolCallActionDrag struct{…}A drag action.
-
Path []ResponseComputerToolCallActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ResponseComputerToolCallActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ResponseComputerToolCallActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ResponseComputerToolCallActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ResponseComputerToolCallActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ResponseComputerToolCallActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ResponseComputerToolCallActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
Actions ComputerActionListFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
type ComputerActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ComputerActionClickButtonLeft ComputerActionClickButton = "left" -
const ComputerActionClickButtonRight ComputerActionClickButton = "right" -
const ComputerActionClickButtonWheel ComputerActionClickButton = "wheel" -
const ComputerActionClickButtonBack ComputerActionClickButton = "back" -
const ComputerActionClickButtonForward ComputerActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ComputerActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ComputerActionDrag struct{…}A drag action.
-
Path []ComputerActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ComputerActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ComputerActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ComputerActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ComputerActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ComputerActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ComputerActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
-
type ResponseInputItemComputerCallOutput struct{…}The output of a computer tool call.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Type ComputerScreenshotSpecifies the event type. For a computer screenshot, this property is always set to
computer_screenshot.const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"
-
FileID stringThe identifier of an uploaded file that contains the screenshot.
-
ImageURL stringThe URL of the screenshot image.
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
ID stringThe ID of the computer tool call output.
-
AcknowledgedSafetyChecks []ResponseInputItemComputerCallOutputAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status stringThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseInputItemComputerCallOutputStatusInProgress ResponseInputItemComputerCallOutputStatus = "in_progress" -
const ResponseInputItemComputerCallOutputStatusCompleted ResponseInputItemComputerCallOutputStatus = "completed" -
const ResponseInputItemComputerCallOutputStatusIncomplete ResponseInputItemComputerCallOutputStatus = "incomplete"
-
-
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
ID stringThe unique ID of the web search tool call.
-
Action ResponseFunctionWebSearchActionUnionAn object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
type ResponseFunctionWebSearchActionSearch struct{…}Action type "search" - Performs a web search query.
-
Type SearchThe action type.
const SearchSearch Search = "search"
-
Queries []stringThe search queries.
-
Query stringThe search query.
-
Sources []ResponseFunctionWebSearchActionSearchSourceThe sources used in the search.
-
Type URLThe type of source. Always
url.const URLURL URL = "url"
-
URL stringThe URL of the source.
-
-
-
type ResponseFunctionWebSearchActionOpenPage struct{…}Action type "open_page" - Opens a specific URL from search results.
-
Type OpenPageThe action type.
const OpenPageOpenPage OpenPage = "open_page"
-
URL stringThe URL opened by the model.
-
-
type ResponseFunctionWebSearchActionFindInPage struct{…}Action type "find_in_page": Searches for a pattern within a loaded page.
-
Pattern stringThe pattern or text to search for within the page.
-
Type FindInPageThe action type.
const FindInPageFindInPage FindInPage = "find_in_page"
-
URL stringThe URL of the page searched for the pattern.
-
-
-
Status ResponseFunctionWebSearchStatusThe status of the web search tool call.
-
const ResponseFunctionWebSearchStatusInProgress ResponseFunctionWebSearchStatus = "in_progress" -
const ResponseFunctionWebSearchStatusSearching ResponseFunctionWebSearchStatus = "searching" -
const ResponseFunctionWebSearchStatusCompleted ResponseFunctionWebSearchStatus = "completed" -
const ResponseFunctionWebSearchStatusFailed ResponseFunctionWebSearchStatus = "failed"
-
-
Type WebSearchCallThe type of the web search tool call. Always
web_search_call.const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"
-
-
type ResponseFunctionToolCall struct{…}A tool call to run a function. See the function calling guide for more information.
-
Arguments stringA JSON string of the arguments to pass to the function.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Name stringThe name of the function to run.
-
Type FunctionCallThe type of the function tool call. Always
function_call.const FunctionCallFunctionCall FunctionCall = "function_call"
-
ID stringThe unique ID of the function tool call.
-
Namespace stringThe namespace of the function to run.
-
Status ResponseFunctionToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallStatusInProgress ResponseFunctionToolCallStatus = "in_progress" -
const ResponseFunctionToolCallStatusCompleted ResponseFunctionToolCallStatus = "completed" -
const ResponseFunctionToolCallStatusIncomplete ResponseFunctionToolCallStatus = "incomplete"
-
-
-
type ResponseInputItemFunctionCallOutput struct{…}The output of a function tool call.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseInputItemFunctionCallOutputOutputUnionText, image, or file output of the function tool call.
-
string -
type ResponseFunctionCallOutputItemList []ResponseFunctionCallOutputItemUnionAn array of content outputs (text, image, file) for the function tool call.
-
type ResponseInputTextContent struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImageContent struct{…}An image input to the model. Learn about image inputs
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
Detail ResponseInputImageContentDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageContentDetailLow ResponseInputImageContentDetail = "low" -
const ResponseInputImageContentDetailHigh ResponseInputImageContentDetail = "high" -
const ResponseInputImageContentDetailAuto ResponseInputImageContentDetail = "auto" -
const ResponseInputImageContentDetailOriginal ResponseInputImageContentDetail = "original"
-
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFileContent struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileContentDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileContentDetailLow ResponseInputFileContentDetail = "low" -
const ResponseInputFileContentDetailHigh ResponseInputFileContentDetail = "high"
-
-
FileData stringThe base64-encoded data of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
ID stringThe unique ID of the function tool call output. Populated when this item is returned via API.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputItemFunctionCallOutputStatusInProgress ResponseInputItemFunctionCallOutputStatus = "in_progress" -
const ResponseInputItemFunctionCallOutputStatusCompleted ResponseInputItemFunctionCallOutputStatus = "completed" -
const ResponseInputItemFunctionCallOutputStatusIncomplete ResponseInputItemFunctionCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemToolSearchCall struct{…}-
Arguments anyThe arguments supplied to the tool search call.
-
Type ToolSearchCallThe item type. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
ID stringThe unique ID of this tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution stringWhether tool search was executed by the server or by the client.
-
const ResponseInputItemToolSearchCallExecutionServer ResponseInputItemToolSearchCallExecution = "server" -
const ResponseInputItemToolSearchCallExecutionClient ResponseInputItemToolSearchCallExecution = "client"
-
-
Status stringThe status of the tool search call.
-
const ResponseInputItemToolSearchCallStatusInProgress ResponseInputItemToolSearchCallStatus = "in_progress" -
const ResponseInputItemToolSearchCallStatusCompleted ResponseInputItemToolSearchCallStatus = "completed" -
const ResponseInputItemToolSearchCallStatusIncomplete ResponseInputItemToolSearchCallStatus = "incomplete"
-
-
-
type ResponseToolSearchOutputItemParamResp struct{…}-
Tools []ToolUnionThe loaded tool definitions returned by the tool search output.
-
type FunctionTool struct{…}Defines a function in your own code the model can choose to call. Learn more about function calling.
-
Name stringThe name of the function to call.
-
Parameters map[string, any]A JSON schema object describing the parameters of the function.
-
Strict boolWhether to enforce strict parameter validation. Default
true. -
Type FunctionThe type of the function tool. Always
function.const FunctionFunction Function = "function"
-
DeferLoading boolWhether this function is deferred and loaded via tool search.
-
Description stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
type FileSearchTool struct{…}A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
Type FileSearchThe type of the file search tool. Always
file_search.const FileSearchFileSearch FileSearch = "file_search"
-
VectorStoreIDs []stringThe IDs of the vector stores to search.
-
Filters FileSearchToolFiltersUnionA filter to apply.
-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
Key stringThe key to compare against the value.
-
Type ComparisonFilterTypeSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
const ComparisonFilterTypeEq ComparisonFilterType = "eq" -
const ComparisonFilterTypeNe ComparisonFilterType = "ne" -
const ComparisonFilterTypeGt ComparisonFilterType = "gt" -
const ComparisonFilterTypeGte ComparisonFilterType = "gte" -
const ComparisonFilterTypeLt ComparisonFilterType = "lt" -
const ComparisonFilterTypeLte ComparisonFilterType = "lte" -
const ComparisonFilterTypeIn ComparisonFilterType = "in" -
const ComparisonFilterTypeNin ComparisonFilterType = "nin"
-
-
Value ComparisonFilterValueUnionThe value to compare against the attribute key; supports string, number, or boolean types.
-
string -
float64 -
bool -
type ComparisonFilterValueArray []ComparisonFilterValueArrayItemUnion-
string -
float64
-
-
-
-
type CompoundFilter struct{…}Combine multiple filters using
andoror.-
Filters []ComparisonFilterArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
-
Type CompoundFilterTypeType of operation:
andoror.-
const CompoundFilterTypeAnd CompoundFilterType = "and" -
const CompoundFilterTypeOr CompoundFilterType = "or"
-
-
-
-
MaxNumResults int64The maximum number of results to return. This number should be between 1 and 50 inclusive.
-
RankingOptions FileSearchToolRankingOptionsRanking options for search.
-
HybridSearch FileSearchToolRankingOptionsHybridSearchWeights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
EmbeddingWeight float64The weight of the embedding in the reciprocal ranking fusion.
-
TextWeight float64The weight of the text in the reciprocal ranking fusion.
-
-
Ranker stringThe ranker to use for the file search.
-
const FileSearchToolRankingOptionsRankerAuto FileSearchToolRankingOptionsRanker = "auto" -
const FileSearchToolRankingOptionsRankerDefault2024_11_15 FileSearchToolRankingOptionsRanker = "default-2024-11-15"
-
-
ScoreThreshold float64The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
Type ComputerThe type of the computer tool. Always
computer.const ComputerComputer Computer = "computer"
-
-
type ComputerUsePreviewTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
DisplayHeight int64The height of the computer display.
-
DisplayWidth int64The width of the computer display.
-
Environment ComputerUsePreviewToolEnvironmentThe type of computer environment to control.
-
const ComputerUsePreviewToolEnvironmentWindows ComputerUsePreviewToolEnvironment = "windows" -
const ComputerUsePreviewToolEnvironmentMac ComputerUsePreviewToolEnvironment = "mac" -
const ComputerUsePreviewToolEnvironmentLinux ComputerUsePreviewToolEnvironment = "linux" -
const ComputerUsePreviewToolEnvironmentUbuntu ComputerUsePreviewToolEnvironment = "ubuntu" -
const ComputerUsePreviewToolEnvironmentBrowser ComputerUsePreviewToolEnvironment = "browser"
-
-
Type ComputerUsePreviewThe type of the computer use tool. Always
computer_use_preview.const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"
-
-
type WebSearchTool struct{…}Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
Type WebSearchToolTypeThe type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
const WebSearchToolTypeWebSearch WebSearchToolType = "web_search" -
const WebSearchToolTypeWebSearch2025_08_26 WebSearchToolType = "web_search_2025_08_26"
-
-
Filters WebSearchToolFiltersFilters for the search.
-
AllowedDomains []stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
SearchContextSize WebSearchToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchToolSearchContextSizeLow WebSearchToolSearchContextSize = "low" -
const WebSearchToolSearchContextSizeMedium WebSearchToolSearchContextSize = "medium" -
const WebSearchToolSearchContextSizeHigh WebSearchToolSearchContextSize = "high"
-
-
UserLocation WebSearchToolUserLocationThe approximate location of the user.
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
Type stringThe type of location approximation. Always
approximate.const WebSearchToolUserLocationTypeApproximate WebSearchToolUserLocationType = "approximate"
-
-
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
ServerLabel stringA label for this MCP server, used to identify it in tool calls.
-
Type McpThe type of the MCP tool. Always
mcp.const McpMcp Mcp = "mcp"
-
AllowedTools ToolMcpAllowedToolsUnionList of allowed tool names or a filter object.
-
type ToolMcpAllowedToolsMcpAllowedTools []stringA string array of allowed tool names
-
type ToolMcpAllowedToolsMcpToolFilter struct{…}A filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
Authorization stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
ConnectorID stringIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
const ToolMcpConnectorIDConnectorDropbox ToolMcpConnectorID = "connector_dropbox" -
const ToolMcpConnectorIDConnectorGmail ToolMcpConnectorID = "connector_gmail" -
const ToolMcpConnectorIDConnectorGooglecalendar ToolMcpConnectorID = "connector_googlecalendar" -
const ToolMcpConnectorIDConnectorGoogledrive ToolMcpConnectorID = "connector_googledrive" -
const ToolMcpConnectorIDConnectorMicrosoftteams ToolMcpConnectorID = "connector_microsoftteams" -
const ToolMcpConnectorIDConnectorOutlookcalendar ToolMcpConnectorID = "connector_outlookcalendar" -
const ToolMcpConnectorIDConnectorOutlookemail ToolMcpConnectorID = "connector_outlookemail" -
const ToolMcpConnectorIDConnectorSharepoint ToolMcpConnectorID = "connector_sharepoint"
-
-
DeferLoading boolWhether this MCP tool is deferred and discovered via tool search.
-
Headers map[string, string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
RequireApproval ToolMcpRequireApprovalUnionSpecify which of the MCP server's tools require approval.
-
type ToolMcpRequireApprovalMcpToolApprovalFilter 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.-
Always ToolMcpRequireApprovalMcpToolApprovalFilterAlwaysA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
Never ToolMcpRequireApprovalMcpToolApprovalFilterNeverA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
type ToolMcpRequireApprovalMcpToolApprovalSetting stringSpecify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
const ToolMcpRequireApprovalMcpToolApprovalSettingAlways ToolMcpRequireApprovalMcpToolApprovalSetting = "always" -
const ToolMcpRequireApprovalMcpToolApprovalSettingNever ToolMcpRequireApprovalMcpToolApprovalSetting = "never"
-
-
-
ServerDescription stringOptional description of the MCP server, used to provide more context.
-
ServerURL stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
TunnelID stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
Container ToolCodeInterpreterContainerUnionThe code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
string -
type ToolCodeInterpreterContainerCodeInterpreterContainerAuto struct{…}Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
Type AutoAlways
auto.const AutoAuto Auto = "auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit stringThe memory limit for the code interpreter container.
-
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"
-
-
NetworkPolicy ToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…}-
Type DisabledDisable outbound network access. Always
disabled.const DisabledDisabled Disabled = "disabled"
-
-
type ContainerNetworkPolicyAllowlist struct{…}-
AllowedDomains []stringA list of allowed domains when type is
allowlist. -
Type AllowlistAllow outbound network access only to specified domains. Always
allowlist.const AllowlistAllowlist Allowlist = "allowlist"
-
DomainSecrets []ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
Domain stringThe domain associated with the secret.
-
Name stringThe name of the secret to inject for the domain.
-
Value stringThe secret value to inject for the domain.
-
-
-
-
-
-
Type CodeInterpreterThe type of the code interpreter tool. Always
code_interpreter.const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"
-
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
Type ImageGenerationThe type of the image generation tool. Always
image_generation.const ImageGenerationImageGeneration ImageGeneration = "image_generation"
-
Action stringWhether to generate a new image or edit an existing image. Default:
auto.-
const ToolImageGenerationActionGenerate ToolImageGenerationAction = "generate" -
const ToolImageGenerationActionEdit ToolImageGenerationAction = "edit" -
const ToolImageGenerationActionAuto ToolImageGenerationAction = "auto"
-
-
Background stringAllows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
const ToolImageGenerationBackgroundTransparent ToolImageGenerationBackground = "transparent" -
const ToolImageGenerationBackgroundOpaque ToolImageGenerationBackground = "opaque" -
const ToolImageGenerationBackgroundAuto ToolImageGenerationBackground = "auto"
-
-
InputFidelity stringControl how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
const ToolImageGenerationInputFidelityHigh ToolImageGenerationInputFidelity = "high" -
const ToolImageGenerationInputFidelityLow ToolImageGenerationInputFidelity = "low"
-
-
InputImageMask ToolImageGenerationInputImageMaskOptional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
FileID stringFile ID for the mask image.
-
ImageURL stringBase64-encoded mask image.
-
-
Model stringThe image generation model to use. Default:
gpt-image-1.-
string -
string-
const ToolImageGenerationModelGPTImage1 ToolImageGenerationModel = "gpt-image-1" -
const ToolImageGenerationModelGPTImage1Mini ToolImageGenerationModel = "gpt-image-1-mini" -
const ToolImageGenerationModelGPTImage2 ToolImageGenerationModel = "gpt-image-2" -
const ToolImageGenerationModelGPTImage2_2026_04_21 ToolImageGenerationModel = "gpt-image-2-2026-04-21" -
const ToolImageGenerationModelGPTImage1_5 ToolImageGenerationModel = "gpt-image-1.5" -
const ToolImageGenerationModelChatgptImageLatest ToolImageGenerationModel = "chatgpt-image-latest"
-
-
-
Moderation stringModeration level for the generated image. Default:
auto.-
const ToolImageGenerationModerationAuto ToolImageGenerationModeration = "auto" -
const ToolImageGenerationModerationLow ToolImageGenerationModeration = "low"
-
-
OutputCompression int64Compression level for the output image. Default: 100.
-
OutputFormat stringThe output format of the generated image. One of
png,webp, orjpeg. Default:png.-
const ToolImageGenerationOutputFormatPNG ToolImageGenerationOutputFormat = "png" -
const ToolImageGenerationOutputFormatWebP ToolImageGenerationOutputFormat = "webp" -
const ToolImageGenerationOutputFormatJPEG ToolImageGenerationOutputFormat = "jpeg"
-
-
PartialImages int64Number of partial images to generate in streaming mode, from 0 (default value) to 3.
-
Quality stringThe quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
const ToolImageGenerationQualityLow ToolImageGenerationQuality = "low" -
const ToolImageGenerationQualityMedium ToolImageGenerationQuality = "medium" -
const ToolImageGenerationQualityHigh ToolImageGenerationQuality = "high" -
const ToolImageGenerationQualityAuto ToolImageGenerationQuality = "auto"
-
-
Size stringThe size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
string -
string-
const ToolImageGenerationSize1024x1024 ToolImageGenerationSize = "1024x1024" -
const ToolImageGenerationSize1024x1536 ToolImageGenerationSize = "1024x1536" -
const ToolImageGenerationSize1536x1024 ToolImageGenerationSize = "1536x1024" -
const ToolImageGenerationSizeAuto ToolImageGenerationSize = "auto"
-
-
-
-
type ToolLocalShell struct{…}A tool that allows the model to execute shell commands in a local environment.
-
Type LocalShellThe type of the local shell tool. Always
local_shell.const LocalShellLocalShell LocalShell = "local_shell"
-
-
type FunctionShellTool struct{…}A tool that allows the model to execute shell commands.
-
Type ShellThe type of the shell tool. Always
shell.const ShellShell Shell = "shell"
-
Environment FunctionShellToolEnvironmentUnion-
type ContainerAuto struct{…}-
Type ContainerAutoAutomatically creates a container for this request
const ContainerAutoContainerAuto ContainerAuto = "container_auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit ContainerAutoMemoryLimitThe memory limit for the container.
-
const ContainerAutoMemoryLimit1g ContainerAutoMemoryLimit = "1g" -
const ContainerAutoMemoryLimit4g ContainerAutoMemoryLimit = "4g" -
const ContainerAutoMemoryLimit16g ContainerAutoMemoryLimit = "16g" -
const ContainerAutoMemoryLimit64g ContainerAutoMemoryLimit = "64g"
-
-
NetworkPolicy ContainerAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…} -
type ContainerNetworkPolicyAllowlist struct{…}
-
-
Skills []ContainerAutoSkillUnionAn optional list of skills referenced by id or inline data.
-
type SkillReference struct{…}-
SkillID stringThe ID of the referenced skill.
-
Type SkillReferenceReferences a skill created with the /v1/skills endpoint.
const SkillReferenceSkillReference SkillReference = "skill_reference"
-
Version stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
type InlineSkill struct{…}-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Source InlineSkillSourceInline skill payload
-
Data stringBase64-encoded skill zip bundle.
-
MediaType ApplicationZipThe media type of the inline skill payload. Must be
application/zip.const ApplicationZipApplicationZip ApplicationZip = "application/zip"
-
Type Base64The type of the inline skill source. Must be
base64.const Base64Base64 Base64 = "base64"
-
-
Type InlineDefines an inline skill for this request.
const InlineInline Inline = "inline"
-
-
-
-
type LocalEnvironment struct{…}-
Type LocalUse a local computer environment.
const LocalLocal Local = "local"
-
Skills []LocalSkillAn optional list of skills.
-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Path stringThe path to the directory containing the skill.
-
-
-
type ContainerReference struct{…}-
ContainerID stringThe ID of the referenced container.
-
Type ContainerReferenceReferences a container created with the /v1/containers endpoint
const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
Name stringThe name of the custom tool, used to identify it in tool calls.
-
Type CustomThe type of the custom tool. Always
custom.const CustomCustom Custom = "custom"
-
DeferLoading boolWhether this tool should be deferred and discovered via tool search.
-
Description stringOptional description of the custom tool, used to provide more context.
-
Format CustomToolInputFormatUnionThe input format for the custom tool. Default is unconstrained text.
-
type CustomToolInputFormatText struct{…}Unconstrained free-form text.
-
Type TextUnconstrained text format. Always
text.const TextText Text = "text"
-
-
type CustomToolInputFormatGrammar struct{…}A grammar defined by the user.
-
Definition stringThe grammar definition.
-
Syntax stringThe syntax of the grammar definition. One of
larkorregex.-
const CustomToolInputFormatGrammarSyntaxLark CustomToolInputFormatGrammarSyntax = "lark" -
const CustomToolInputFormatGrammarSyntaxRegex CustomToolInputFormatGrammarSyntax = "regex"
-
-
Type GrammarGrammar format. Always
grammar.const GrammarGrammar Grammar = "grammar"
-
-
-
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
Description stringA description of the namespace shown to the model.
-
Name stringThe namespace name used in tool calls (for example,
crm). -
Tools []NamespaceToolToolUnionThe function/custom tools available inside this namespace.
-
type NamespaceToolToolFunction struct{…}-
Name string -
Type Functionconst FunctionFunction Function = "function"
-
DeferLoading boolWhether this function should be deferred and discovered via tool search.
-
Description string -
Parameters any -
Strict bool
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
-
Type NamespaceThe type of the tool. Always
namespace.const NamespaceNamespace Namespace = "namespace"
-
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
Type ToolSearchThe type of the tool. Always
tool_search.const ToolSearchToolSearch ToolSearch = "tool_search"
-
Description stringDescription shown to the model for a client-executed tool search tool.
-
Execution ToolSearchToolExecutionWhether tool search is executed by the server or by the client.
-
const ToolSearchToolExecutionServer ToolSearchToolExecution = "server" -
const ToolSearchToolExecutionClient ToolSearchToolExecution = "client"
-
-
Parameters anyParameter schema for a client-executed tool search tool.
-
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
Type WebSearchPreviewToolTypeThe type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
const WebSearchPreviewToolTypeWebSearchPreview WebSearchPreviewToolType = "web_search_preview" -
const WebSearchPreviewToolTypeWebSearchPreview2025_03_11 WebSearchPreviewToolType = "web_search_preview_2025_03_11"
-
-
SearchContentTypes []string-
const WebSearchPreviewToolSearchContentTypeText WebSearchPreviewToolSearchContentType = "text" -
const WebSearchPreviewToolSearchContentTypeImage WebSearchPreviewToolSearchContentType = "image"
-
-
SearchContextSize WebSearchPreviewToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchPreviewToolSearchContextSizeLow WebSearchPreviewToolSearchContextSize = "low" -
const WebSearchPreviewToolSearchContextSizeMedium WebSearchPreviewToolSearchContextSize = "medium" -
const WebSearchPreviewToolSearchContextSizeHigh WebSearchPreviewToolSearchContextSize = "high"
-
-
UserLocation WebSearchPreviewToolUserLocationThe user's location.
-
Type ApproximateThe type of location approximation. Always
approximate.const ApproximateApproximate Approximate = "approximate"
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
Type ApplyPatchThe type of the tool. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
-
Type ToolSearchOutputThe item type. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
ID stringThe unique ID of this tool search output.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemParamExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemParamExecutionServer ResponseToolSearchOutputItemParamExecution = "server" -
const ResponseToolSearchOutputItemParamExecutionClient ResponseToolSearchOutputItemParamExecution = "client"
-
-
Status ResponseToolSearchOutputItemParamStatusThe status of the tool search output.
-
const ResponseToolSearchOutputItemParamStatusInProgress ResponseToolSearchOutputItemParamStatus = "in_progress" -
const ResponseToolSearchOutputItemParamStatusCompleted ResponseToolSearchOutputItemParamStatus = "completed" -
const ResponseToolSearchOutputItemParamStatusIncomplete ResponseToolSearchOutputItemParamStatus = "incomplete"
-
-
-
type ResponseInputItemAdditionalTools struct{…}-
Role DeveloperThe role that provided the additional tools. Only
developeris supported.const DeveloperDeveloper Developer = "developer"
-
Tools []ToolUnionA list of additional tools made available at this item.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type AdditionalToolsThe item type. Always
additional_tools.const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"
-
ID stringThe unique ID of this additional tools item.
-
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
ID stringThe unique identifier of the reasoning content.
-
Summary []ResponseReasoningItemSummaryReasoning summary content.
-
Text stringA summary of the reasoning output from the model so far.
-
Type SummaryTextThe type of the object. Always
summary_text.const SummaryTextSummaryText SummaryText = "summary_text"
-
-
Type ReasoningThe type of the object. Always
reasoning.const ReasoningReasoning Reasoning = "reasoning"
-
Content []ResponseReasoningItemContentReasoning text content.
-
Text stringThe reasoning text from the model.
-
Type ReasoningTextThe type of the reasoning text. Always
reasoning_text.const ReasoningTextReasoningText ReasoningText = "reasoning_text"
-
-
EncryptedContent stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
Status ResponseReasoningItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseReasoningItemStatusInProgress ResponseReasoningItemStatus = "in_progress" -
const ResponseReasoningItemStatusCompleted ResponseReasoningItemStatus = "completed" -
const ResponseReasoningItemStatusIncomplete ResponseReasoningItemStatus = "incomplete"
-
-
-
type ResponseCompactionItemParamResp struct{…}A compaction item generated by the
v1/responses/compactAPI.-
EncryptedContent stringThe encrypted content of the compaction summary.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
ID stringThe ID of the compaction item.
-
-
type ResponseInputItemImageGenerationCall struct{…}An image generation request made by the model.
-
ID stringThe unique ID of the image generation call.
-
Result stringThe generated image encoded in base64.
-
Status stringThe status of the image generation call.
-
const ResponseInputItemImageGenerationCallStatusInProgress ResponseInputItemImageGenerationCallStatus = "in_progress" -
const ResponseInputItemImageGenerationCallStatusCompleted ResponseInputItemImageGenerationCallStatus = "completed" -
const ResponseInputItemImageGenerationCallStatusGenerating ResponseInputItemImageGenerationCallStatus = "generating" -
const ResponseInputItemImageGenerationCallStatusFailed ResponseInputItemImageGenerationCallStatus = "failed"
-
-
Type ImageGenerationCallThe type of the image generation call. Always
image_generation_call.const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"
-
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
ID stringThe unique ID of the code interpreter tool call.
-
Code stringThe code to run, or null if not available.
-
ContainerID stringThe ID of the container used to run the code.
-
Outputs []ResponseCodeInterpreterToolCallOutputUnionThe outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
type ResponseCodeInterpreterToolCallOutputLogs struct{…}The logs output from the code interpreter.
-
Logs stringThe logs output from the code interpreter.
-
Type LogsThe type of the output. Always
logs.const LogsLogs Logs = "logs"
-
-
type ResponseCodeInterpreterToolCallOutputImage struct{…}The image output from the code interpreter.
-
Type ImageThe type of the output. Always
image.const ImageImage Image = "image"
-
URL stringThe URL of the image output from the code interpreter.
-
-
-
Status ResponseCodeInterpreterToolCallStatusThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
const ResponseCodeInterpreterToolCallStatusInProgress ResponseCodeInterpreterToolCallStatus = "in_progress" -
const ResponseCodeInterpreterToolCallStatusCompleted ResponseCodeInterpreterToolCallStatus = "completed" -
const ResponseCodeInterpreterToolCallStatusIncomplete ResponseCodeInterpreterToolCallStatus = "incomplete" -
const ResponseCodeInterpreterToolCallStatusInterpreting ResponseCodeInterpreterToolCallStatus = "interpreting" -
const ResponseCodeInterpreterToolCallStatusFailed ResponseCodeInterpreterToolCallStatus = "failed"
-
-
Type CodeInterpreterCallThe type of the code interpreter tool call. Always
code_interpreter_call.const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"
-
-
type ResponseInputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
ID stringThe unique ID of the local shell call.
-
Action ResponseInputItemLocalShellCallActionExecute a shell command on the server.
-
Command []stringThe command to run.
-
Env map[string, string]Environment variables to set for the command.
-
Type ExecThe type of the local shell action. Always
exec.const ExecExec Exec = "exec"
-
TimeoutMs int64Optional timeout in milliseconds for the command.
-
User stringOptional user to run the command as.
-
WorkingDirectory stringOptional working directory to run the command in.
-
-
CallID stringThe unique ID of the local shell tool call generated by the model.
-
Status stringThe status of the local shell call.
-
const ResponseInputItemLocalShellCallStatusInProgress ResponseInputItemLocalShellCallStatus = "in_progress" -
const ResponseInputItemLocalShellCallStatusCompleted ResponseInputItemLocalShellCallStatus = "completed" -
const ResponseInputItemLocalShellCallStatusIncomplete ResponseInputItemLocalShellCallStatus = "incomplete"
-
-
Type LocalShellCallThe type of the local shell call. Always
local_shell_call.const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"
-
-
type ResponseInputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
ID stringThe unique ID of the local shell tool call generated by the model.
-
Output stringA JSON string of the output of the local shell tool call.
-
Type LocalShellCallOutputThe type of the local shell tool call output. Always
local_shell_call_output.const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete.-
const ResponseInputItemLocalShellCallOutputStatusInProgress ResponseInputItemLocalShellCallOutputStatus = "in_progress" -
const ResponseInputItemLocalShellCallOutputStatusCompleted ResponseInputItemLocalShellCallOutputStatus = "completed" -
const ResponseInputItemLocalShellCallOutputStatusIncomplete ResponseInputItemLocalShellCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemShellCall struct{…}A tool representing a request to execute one or more shell commands.
-
Action ResponseInputItemShellCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []stringOrdered shell commands for the execution environment to run.
-
MaxOutputLength int64Maximum number of UTF-8 characters to capture from combined stdout and stderr output.
-
TimeoutMs int64Maximum wall-clock time in milliseconds to allow the shell commands to run.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Environment ResponseInputItemShellCallEnvironmentUnionThe environment to execute the shell commands in.
-
type LocalEnvironment struct{…} -
type ContainerReference struct{…}
-
-
Status stringThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseInputItemShellCallStatusInProgress ResponseInputItemShellCallStatus = "in_progress" -
const ResponseInputItemShellCallStatusCompleted ResponseInputItemShellCallStatus = "completed" -
const ResponseInputItemShellCallStatusIncomplete ResponseInputItemShellCallStatus = "incomplete"
-
-
-
type ResponseInputItemShellCallOutput struct{…}The streamed output items emitted by a shell tool call.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Output []ResponseFunctionShellCallOutputContentCaptured chunks of stdout and stderr output, along with their associated outcomes.
-
Outcome ResponseFunctionShellCallOutputContentOutcomeUnionThe exit or timeout outcome associated with this shell call.
-
type ResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellCallOutputContentOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64The exit code returned by the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringCaptured stderr output for the shell call.
-
Stdout stringCaptured stdout output for the shell call.
-
-
Type ShellCallOutputThe type of the item. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
ID stringThe unique ID of the shell tool call output. Populated when this item is returned via API.
-
MaxOutputLength int64The maximum number of UTF-8 characters captured for this shell call's combined output.
-
Status stringThe status of the shell call output.
-
const ResponseInputItemShellCallOutputStatusInProgress ResponseInputItemShellCallOutputStatus = "in_progress" -
const ResponseInputItemShellCallOutputStatusCompleted ResponseInputItemShellCallOutputStatus = "completed" -
const ResponseInputItemShellCallOutputStatusIncomplete ResponseInputItemShellCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemApplyPatchCall struct{…}A tool call representing a request to create, delete, or update files using diff patches.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseInputItemApplyPatchCallOperationUnionThe specific create, delete, or update instruction for the apply_patch tool call.
-
type ResponseInputItemApplyPatchCallOperationCreateFile struct{…}Instruction for creating a new file via the apply_patch tool.
-
Diff stringUnified diff content to apply when creating the file.
-
Path stringPath of the file to create relative to the workspace root.
-
Type CreateFileThe operation type. Always
create_file.const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseInputItemApplyPatchCallOperationDeleteFile struct{…}Instruction for deleting an existing file via the apply_patch tool.
-
Path stringPath of the file to delete relative to the workspace root.
-
Type DeleteFileThe operation type. Always
delete_file.const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseInputItemApplyPatchCallOperationUpdateFile struct{…}Instruction for updating an existing file via the apply_patch tool.
-
Diff stringUnified diff content to apply to the existing file.
-
Path stringPath of the file to update relative to the workspace root.
-
Type UpdateFileThe operation type. Always
update_file.const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status stringThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseInputItemApplyPatchCallStatusInProgress ResponseInputItemApplyPatchCallStatus = "in_progress" -
const ResponseInputItemApplyPatchCallStatusCompleted ResponseInputItemApplyPatchCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
-
type ResponseInputItemApplyPatchCallOutput struct{…}The streamed output emitted by an apply patch tool call.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status stringThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseInputItemApplyPatchCallOutputStatusCompleted ResponseInputItemApplyPatchCallOutputStatus = "completed" -
const ResponseInputItemApplyPatchCallOutputStatusFailed ResponseInputItemApplyPatchCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
Output stringOptional human-readable log text from the apply patch tool (e.g., patch results or errors).
-
-
type ResponseInputItemMcpListTools struct{…}A list of tools available on an MCP server.
-
ID stringThe unique ID of the list.
-
ServerLabel stringThe label of the MCP server.
-
Tools []ResponseInputItemMcpListToolsToolThe tools available on the server.
-
InputSchema anyThe JSON schema describing the tool's input.
-
Name stringThe name of the tool.
-
Annotations anyAdditional annotations about the tool.
-
Description stringThe description of the tool.
-
-
Type McpListToolsThe type of the item. Always
mcp_list_tools.const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
-
Error stringError message if the server could not list tools.
-
-
type ResponseInputItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
ID stringThe unique ID of the approval request.
-
Arguments stringA JSON string of arguments for the tool.
-
Name stringThe name of the tool to run.
-
ServerLabel stringThe label of the MCP server making the request.
-
Type McpApprovalRequestThe type of the item. Always
mcp_approval_request.const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"
-
-
type ResponseInputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
ApprovalRequestID stringThe ID of the approval request being answered.
-
Approve boolWhether the request was approved.
-
Type McpApprovalResponseThe type of the item. Always
mcp_approval_response.const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
-
ID stringThe unique ID of the approval response
-
Reason stringOptional reason for the decision.
-
-
type ResponseInputItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
ID stringThe unique ID of the tool call.
-
Arguments stringA JSON string of the arguments passed to the tool.
-
Name stringThe name of the tool that was run.
-
ServerLabel stringThe label of the MCP server running the tool.
-
Type McpCallThe type of the item. Always
mcp_call.const McpCallMcpCall McpCall = "mcp_call"
-
ApprovalRequestID stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
Error stringThe error from the tool call, if any.
-
Output stringThe output from the tool call.
-
Status stringThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
const ResponseInputItemMcpCallStatusInProgress ResponseInputItemMcpCallStatus = "in_progress" -
const ResponseInputItemMcpCallStatusCompleted ResponseInputItemMcpCallStatus = "completed" -
const ResponseInputItemMcpCallStatusIncomplete ResponseInputItemMcpCallStatus = "incomplete" -
const ResponseInputItemMcpCallStatusCalling ResponseInputItemMcpCallStatus = "calling" -
const ResponseInputItemMcpCallStatusFailed ResponseInputItemMcpCallStatus = "failed"
-
-
-
type ResponseCustomToolCallOutput struct{…}The output of a custom tool call from your code, being sent back to the model.
-
CallID stringThe call ID, used to map this custom tool call output to a custom tool call.
-
Output ResponseCustomToolCallOutputOutputUnionThe output from the custom tool call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseCustomToolCallOutputOutputOutputContentList []ResponseCustomToolCallOutputOutputOutputContentListItemUnionText, image, or file output of the custom tool call.
-
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
-
Type CustomToolCallOutputThe type of the custom tool call output. Always
custom_tool_call_output.const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"
-
ID stringThe unique ID of the custom tool call output in the OpenAI platform.
-
-
type ResponseCustomToolCall struct{…}A call to a custom tool created by the model.
-
CallID stringAn identifier used to map this custom tool call to a tool call output.
-
Input stringThe input for the custom tool call generated by the model.
-
Name stringThe name of the custom tool being called.
-
Type CustomToolCallThe type of the custom tool call. Always
custom_tool_call.const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"
-
ID stringThe unique ID of the custom tool call in the OpenAI platform.
-
Namespace stringThe namespace of the custom tool being called.
-
-
type ResponseInputItemCompactionTrigger struct{…}Compacts the current context. Must be the final input item.
-
Type CompactionTriggerThe type of the item. Always
compaction_trigger.const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"
-
-
type ResponseInputItemItemReference struct{…}An internal identifier for an item to reference.
-
ID stringThe ID of the item to reference.
-
Type stringThe type of item to reference. Always
item_reference.const ResponseInputItemItemReferenceTypeItemReference ResponseInputItemItemReferenceType = "item_reference"
-
-
Response Input Audio
-
type ResponseInputAudio struct{…}An audio input to the model.
-
InputAudio ResponseInputAudioInputAudio-
Data stringBase64-encoded audio data.
-
Format stringThe format of the audio data. Currently supported formats are
mp3andwav.-
const ResponseInputAudioInputAudioFormatMP3 ResponseInputAudioInputAudioFormat = "mp3" -
const ResponseInputAudioInputAudioFormatWAV ResponseInputAudioInputAudioFormat = "wav"
-
-
-
Type InputAudioThe type of the input item. Always
input_audio.const InputAudioInputAudio InputAudio = "input_audio"
-
Response Input Content
-
type ResponseInputContentUnion interface{…}A text input to the model.
-
type ResponseInputText struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
Detail ResponseInputImageDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageDetailLow ResponseInputImageDetail = "low" -
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high" -
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto" -
const ResponseInputImageDetailOriginal ResponseInputImageDetail = "original"
-
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFile struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileDetailLow ResponseInputFileDetail = "low" -
const ResponseInputFileDetailHigh ResponseInputFileDetail = "high"
-
-
FileData stringThe content of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
Response Input File
-
type ResponseInputFile struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileDetailLow ResponseInputFileDetail = "low" -
const ResponseInputFileDetailHigh ResponseInputFileDetail = "high"
-
-
FileData stringThe content of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
Response Input File Content
-
type ResponseInputFileContent struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileContentDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileContentDetailLow ResponseInputFileContentDetail = "low" -
const ResponseInputFileContentDetailHigh ResponseInputFileContentDetail = "high"
-
-
FileData stringThe base64-encoded data of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
Response Input Image
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
Detail ResponseInputImageDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageDetailLow ResponseInputImageDetail = "low" -
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high" -
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto" -
const ResponseInputImageDetailOriginal ResponseInputImageDetail = "original"
-
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
Response Input Image Content
-
type ResponseInputImageContent struct{…}An image input to the model. Learn about image inputs
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
Detail ResponseInputImageContentDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageContentDetailLow ResponseInputImageContentDetail = "low" -
const ResponseInputImageContentDetailHigh ResponseInputImageContentDetail = "high" -
const ResponseInputImageContentDetailAuto ResponseInputImageContentDetail = "auto" -
const ResponseInputImageContentDetailOriginal ResponseInputImageContentDetail = "original"
-
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
Response Input Item
-
type ResponseInputItemUnion interface{…}A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.-
type EasyInputMessage struct{…}A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.-
Content EasyInputMessageContentUnionText, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
-
string -
type ResponseInputMessageContentList []ResponseInputContentUnionA list of one or many input items to the model, containing different content types.
-
type ResponseInputText struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
Detail ResponseInputImageDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageDetailLow ResponseInputImageDetail = "low" -
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high" -
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto" -
const ResponseInputImageDetailOriginal ResponseInputImageDetail = "original"
-
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFile struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileDetailLow ResponseInputFileDetail = "low" -
const ResponseInputFileDetailHigh ResponseInputFileDetail = "high"
-
-
FileData stringThe content of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Role EasyInputMessageRoleThe role of the message input. One of
user,assistant,system, ordeveloper.-
const EasyInputMessageRoleUser EasyInputMessageRole = "user" -
const EasyInputMessageRoleAssistant EasyInputMessageRole = "assistant" -
const EasyInputMessageRoleSystem EasyInputMessageRole = "system" -
const EasyInputMessageRoleDeveloper EasyInputMessageRole = "developer"
-
-
Phase EasyInputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const EasyInputMessagePhaseCommentary EasyInputMessagePhase = "commentary" -
const EasyInputMessagePhaseFinalAnswer EasyInputMessagePhase = "final_answer"
-
-
Type EasyInputMessageTypeThe type of the message input. Always
message.const EasyInputMessageTypeMessage EasyInputMessageType = "message"
-
-
type ResponseInputItemMessage struct{…}A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole.-
Content ResponseInputMessageContentListA list of one or many input items to the model, containing different content types.
-
Role stringThe role of the message input. One of
user,system, ordeveloper.-
const ResponseInputItemMessageRoleUser ResponseInputItemMessageRole = "user" -
const ResponseInputItemMessageRoleSystem ResponseInputItemMessageRole = "system" -
const ResponseInputItemMessageRoleDeveloper ResponseInputItemMessageRole = "developer"
-
-
Status stringThe status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputItemMessageStatusInProgress ResponseInputItemMessageStatus = "in_progress" -
const ResponseInputItemMessageStatusCompleted ResponseInputItemMessageStatus = "completed" -
const ResponseInputItemMessageStatusIncomplete ResponseInputItemMessageStatus = "incomplete"
-
-
Type stringThe type of the message input. Always set to
message.const ResponseInputItemMessageTypeMessage ResponseInputItemMessageType = "message"
-
-
type ResponseOutputMessage struct{…}An output message from the model.
-
ID stringThe unique ID of the output message.
-
Content []ResponseOutputMessageContentUnionThe content of the output message.
-
type ResponseOutputText struct{…}A text output from the model.
-
Annotations []ResponseOutputTextAnnotationUnionThe annotations of the text output.
-
type ResponseOutputTextAnnotationFileCitation struct{…}A citation to a file.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the file cited.
-
Index int64The index of the file in the list of files.
-
Type FileCitationThe type of the file citation. Always
file_citation.const FileCitationFileCitation FileCitation = "file_citation"
-
-
type ResponseOutputTextAnnotationURLCitation struct{…}A citation for a web resource used to generate a model response.
-
EndIndex int64The index of the last character of the URL citation in the message.
-
StartIndex int64The index of the first character of the URL citation in the message.
-
Title stringThe title of the web resource.
-
Type URLCitationThe type of the URL citation. Always
url_citation.const URLCitationURLCitation URLCitation = "url_citation"
-
URL stringThe URL of the web resource.
-
-
type ResponseOutputTextAnnotationContainerFileCitation struct{…}A citation for a container file used to generate a model response.
-
ContainerID stringThe ID of the container file.
-
EndIndex int64The index of the last character of the container file citation in the message.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the container file cited.
-
StartIndex int64The index of the first character of the container file citation in the message.
-
Type ContainerFileCitationThe type of the container file citation. Always
container_file_citation.const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"
-
-
type ResponseOutputTextAnnotationFilePath struct{…}A path to a file.
-
FileID stringThe ID of the file.
-
Index int64The index of the file in the list of files.
-
Type FilePathThe type of the file path. Always
file_path.const FilePathFilePath FilePath = "file_path"
-
-
-
Text stringThe text output from the model.
-
Type OutputTextThe type of the output text. Always
output_text.const OutputTextOutputText OutputText = "output_text"
-
Logprobs []ResponseOutputTextLogprob-
Token string -
Bytes []int64 -
Logprob float64 -
TopLogprobs []ResponseOutputTextLogprobTopLogprob-
Token string -
Bytes []int64 -
Logprob float64
-
-
-
-
type ResponseOutputRefusal struct{…}A refusal from the model.
-
Refusal stringThe refusal explanation from the model.
-
Type RefusalThe type of the refusal. Always
refusal.const RefusalRefusal Refusal = "refusal"
-
-
-
Role AssistantThe role of the output message. Always
assistant.const AssistantAssistant Assistant = "assistant"
-
Status ResponseOutputMessageStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseOutputMessageStatusInProgress ResponseOutputMessageStatus = "in_progress" -
const ResponseOutputMessageStatusCompleted ResponseOutputMessageStatus = "completed" -
const ResponseOutputMessageStatusIncomplete ResponseOutputMessageStatus = "incomplete"
-
-
Type MessageThe type of the output message. Always
message.const MessageMessage Message = "message"
-
Phase ResponseOutputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const ResponseOutputMessagePhaseCommentary ResponseOutputMessagePhase = "commentary" -
const ResponseOutputMessagePhaseFinalAnswer ResponseOutputMessagePhase = "final_answer"
-
-
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
ID stringThe unique ID of the file search tool call.
-
Queries []stringThe queries used to search for files.
-
Status ResponseFileSearchToolCallStatusThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
const ResponseFileSearchToolCallStatusInProgress ResponseFileSearchToolCallStatus = "in_progress" -
const ResponseFileSearchToolCallStatusSearching ResponseFileSearchToolCallStatus = "searching" -
const ResponseFileSearchToolCallStatusCompleted ResponseFileSearchToolCallStatus = "completed" -
const ResponseFileSearchToolCallStatusIncomplete ResponseFileSearchToolCallStatus = "incomplete" -
const ResponseFileSearchToolCallStatusFailed ResponseFileSearchToolCallStatus = "failed"
-
-
Type FileSearchCallThe type of the file search tool call. Always
file_search_call.const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"
-
Results []ResponseFileSearchToolCallResultThe results of the file search tool call.
-
Attributes map[string, ResponseFileSearchToolCallResultAttributeUnion]Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.
-
string -
float64 -
bool
-
-
FileID stringThe unique ID of the file.
-
Filename stringThe name of the file.
-
Score float64The relevance score of the file - a value between 0 and 1.
-
Text stringThe text that was retrieved from the file.
-
-
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
ID stringThe unique ID of the computer call.
-
CallID stringAn identifier used when responding to the tool call with output.
-
PendingSafetyChecks []ResponseComputerToolCallPendingSafetyCheckThe pending safety checks for the computer call.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status ResponseComputerToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseComputerToolCallStatusInProgress ResponseComputerToolCallStatus = "in_progress" -
const ResponseComputerToolCallStatusCompleted ResponseComputerToolCallStatus = "completed" -
const ResponseComputerToolCallStatusIncomplete ResponseComputerToolCallStatus = "incomplete"
-
-
Type ResponseComputerToolCallTypeThe type of the computer call. Always
computer_call.const ResponseComputerToolCallTypeComputerCall ResponseComputerToolCallType = "computer_call"
-
Action ResponseComputerToolCallActionUnionA click action.
-
type ResponseComputerToolCallActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ResponseComputerToolCallActionClickButtonLeft ResponseComputerToolCallActionClickButton = "left" -
const ResponseComputerToolCallActionClickButtonRight ResponseComputerToolCallActionClickButton = "right" -
const ResponseComputerToolCallActionClickButtonWheel ResponseComputerToolCallActionClickButton = "wheel" -
const ResponseComputerToolCallActionClickButtonBack ResponseComputerToolCallActionClickButton = "back" -
const ResponseComputerToolCallActionClickButtonForward ResponseComputerToolCallActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ResponseComputerToolCallActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ResponseComputerToolCallActionDrag struct{…}A drag action.
-
Path []ResponseComputerToolCallActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ResponseComputerToolCallActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ResponseComputerToolCallActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ResponseComputerToolCallActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ResponseComputerToolCallActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ResponseComputerToolCallActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ResponseComputerToolCallActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
Actions ComputerActionListFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
type ComputerActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ComputerActionClickButtonLeft ComputerActionClickButton = "left" -
const ComputerActionClickButtonRight ComputerActionClickButton = "right" -
const ComputerActionClickButtonWheel ComputerActionClickButton = "wheel" -
const ComputerActionClickButtonBack ComputerActionClickButton = "back" -
const ComputerActionClickButtonForward ComputerActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ComputerActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ComputerActionDrag struct{…}A drag action.
-
Path []ComputerActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ComputerActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ComputerActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ComputerActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ComputerActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ComputerActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ComputerActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
-
type ResponseInputItemComputerCallOutput struct{…}The output of a computer tool call.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Type ComputerScreenshotSpecifies the event type. For a computer screenshot, this property is always set to
computer_screenshot.const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"
-
FileID stringThe identifier of an uploaded file that contains the screenshot.
-
ImageURL stringThe URL of the screenshot image.
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
ID stringThe ID of the computer tool call output.
-
AcknowledgedSafetyChecks []ResponseInputItemComputerCallOutputAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status stringThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseInputItemComputerCallOutputStatusInProgress ResponseInputItemComputerCallOutputStatus = "in_progress" -
const ResponseInputItemComputerCallOutputStatusCompleted ResponseInputItemComputerCallOutputStatus = "completed" -
const ResponseInputItemComputerCallOutputStatusIncomplete ResponseInputItemComputerCallOutputStatus = "incomplete"
-
-
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
ID stringThe unique ID of the web search tool call.
-
Action ResponseFunctionWebSearchActionUnionAn object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
type ResponseFunctionWebSearchActionSearch struct{…}Action type "search" - Performs a web search query.
-
Type SearchThe action type.
const SearchSearch Search = "search"
-
Queries []stringThe search queries.
-
Query stringThe search query.
-
Sources []ResponseFunctionWebSearchActionSearchSourceThe sources used in the search.
-
Type URLThe type of source. Always
url.const URLURL URL = "url"
-
URL stringThe URL of the source.
-
-
-
type ResponseFunctionWebSearchActionOpenPage struct{…}Action type "open_page" - Opens a specific URL from search results.
-
Type OpenPageThe action type.
const OpenPageOpenPage OpenPage = "open_page"
-
URL stringThe URL opened by the model.
-
-
type ResponseFunctionWebSearchActionFindInPage struct{…}Action type "find_in_page": Searches for a pattern within a loaded page.
-
Pattern stringThe pattern or text to search for within the page.
-
Type FindInPageThe action type.
const FindInPageFindInPage FindInPage = "find_in_page"
-
URL stringThe URL of the page searched for the pattern.
-
-
-
Status ResponseFunctionWebSearchStatusThe status of the web search tool call.
-
const ResponseFunctionWebSearchStatusInProgress ResponseFunctionWebSearchStatus = "in_progress" -
const ResponseFunctionWebSearchStatusSearching ResponseFunctionWebSearchStatus = "searching" -
const ResponseFunctionWebSearchStatusCompleted ResponseFunctionWebSearchStatus = "completed" -
const ResponseFunctionWebSearchStatusFailed ResponseFunctionWebSearchStatus = "failed"
-
-
Type WebSearchCallThe type of the web search tool call. Always
web_search_call.const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"
-
-
type ResponseFunctionToolCall struct{…}A tool call to run a function. See the function calling guide for more information.
-
Arguments stringA JSON string of the arguments to pass to the function.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Name stringThe name of the function to run.
-
Type FunctionCallThe type of the function tool call. Always
function_call.const FunctionCallFunctionCall FunctionCall = "function_call"
-
ID stringThe unique ID of the function tool call.
-
Namespace stringThe namespace of the function to run.
-
Status ResponseFunctionToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallStatusInProgress ResponseFunctionToolCallStatus = "in_progress" -
const ResponseFunctionToolCallStatusCompleted ResponseFunctionToolCallStatus = "completed" -
const ResponseFunctionToolCallStatusIncomplete ResponseFunctionToolCallStatus = "incomplete"
-
-
-
type ResponseInputItemFunctionCallOutput struct{…}The output of a function tool call.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseInputItemFunctionCallOutputOutputUnionText, image, or file output of the function tool call.
-
string -
type ResponseFunctionCallOutputItemList []ResponseFunctionCallOutputItemUnionAn array of content outputs (text, image, file) for the function tool call.
-
type ResponseInputTextContent struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImageContent struct{…}An image input to the model. Learn about image inputs
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
Detail ResponseInputImageContentDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageContentDetailLow ResponseInputImageContentDetail = "low" -
const ResponseInputImageContentDetailHigh ResponseInputImageContentDetail = "high" -
const ResponseInputImageContentDetailAuto ResponseInputImageContentDetail = "auto" -
const ResponseInputImageContentDetailOriginal ResponseInputImageContentDetail = "original"
-
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFileContent struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileContentDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileContentDetailLow ResponseInputFileContentDetail = "low" -
const ResponseInputFileContentDetailHigh ResponseInputFileContentDetail = "high"
-
-
FileData stringThe base64-encoded data of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
ID stringThe unique ID of the function tool call output. Populated when this item is returned via API.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputItemFunctionCallOutputStatusInProgress ResponseInputItemFunctionCallOutputStatus = "in_progress" -
const ResponseInputItemFunctionCallOutputStatusCompleted ResponseInputItemFunctionCallOutputStatus = "completed" -
const ResponseInputItemFunctionCallOutputStatusIncomplete ResponseInputItemFunctionCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemToolSearchCall struct{…}-
Arguments anyThe arguments supplied to the tool search call.
-
Type ToolSearchCallThe item type. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
ID stringThe unique ID of this tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution stringWhether tool search was executed by the server or by the client.
-
const ResponseInputItemToolSearchCallExecutionServer ResponseInputItemToolSearchCallExecution = "server" -
const ResponseInputItemToolSearchCallExecutionClient ResponseInputItemToolSearchCallExecution = "client"
-
-
Status stringThe status of the tool search call.
-
const ResponseInputItemToolSearchCallStatusInProgress ResponseInputItemToolSearchCallStatus = "in_progress" -
const ResponseInputItemToolSearchCallStatusCompleted ResponseInputItemToolSearchCallStatus = "completed" -
const ResponseInputItemToolSearchCallStatusIncomplete ResponseInputItemToolSearchCallStatus = "incomplete"
-
-
-
type ResponseToolSearchOutputItemParamResp struct{…}-
Tools []ToolUnionThe loaded tool definitions returned by the tool search output.
-
type FunctionTool struct{…}Defines a function in your own code the model can choose to call. Learn more about function calling.
-
Name stringThe name of the function to call.
-
Parameters map[string, any]A JSON schema object describing the parameters of the function.
-
Strict boolWhether to enforce strict parameter validation. Default
true. -
Type FunctionThe type of the function tool. Always
function.const FunctionFunction Function = "function"
-
DeferLoading boolWhether this function is deferred and loaded via tool search.
-
Description stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
type FileSearchTool struct{…}A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
Type FileSearchThe type of the file search tool. Always
file_search.const FileSearchFileSearch FileSearch = "file_search"
-
VectorStoreIDs []stringThe IDs of the vector stores to search.
-
Filters FileSearchToolFiltersUnionA filter to apply.
-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
Key stringThe key to compare against the value.
-
Type ComparisonFilterTypeSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
const ComparisonFilterTypeEq ComparisonFilterType = "eq" -
const ComparisonFilterTypeNe ComparisonFilterType = "ne" -
const ComparisonFilterTypeGt ComparisonFilterType = "gt" -
const ComparisonFilterTypeGte ComparisonFilterType = "gte" -
const ComparisonFilterTypeLt ComparisonFilterType = "lt" -
const ComparisonFilterTypeLte ComparisonFilterType = "lte" -
const ComparisonFilterTypeIn ComparisonFilterType = "in" -
const ComparisonFilterTypeNin ComparisonFilterType = "nin"
-
-
Value ComparisonFilterValueUnionThe value to compare against the attribute key; supports string, number, or boolean types.
-
string -
float64 -
bool -
type ComparisonFilterValueArray []ComparisonFilterValueArrayItemUnion-
string -
float64
-
-
-
-
type CompoundFilter struct{…}Combine multiple filters using
andoror.-
Filters []ComparisonFilterArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
-
Type CompoundFilterTypeType of operation:
andoror.-
const CompoundFilterTypeAnd CompoundFilterType = "and" -
const CompoundFilterTypeOr CompoundFilterType = "or"
-
-
-
-
MaxNumResults int64The maximum number of results to return. This number should be between 1 and 50 inclusive.
-
RankingOptions FileSearchToolRankingOptionsRanking options for search.
-
HybridSearch FileSearchToolRankingOptionsHybridSearchWeights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
EmbeddingWeight float64The weight of the embedding in the reciprocal ranking fusion.
-
TextWeight float64The weight of the text in the reciprocal ranking fusion.
-
-
Ranker stringThe ranker to use for the file search.
-
const FileSearchToolRankingOptionsRankerAuto FileSearchToolRankingOptionsRanker = "auto" -
const FileSearchToolRankingOptionsRankerDefault2024_11_15 FileSearchToolRankingOptionsRanker = "default-2024-11-15"
-
-
ScoreThreshold float64The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
Type ComputerThe type of the computer tool. Always
computer.const ComputerComputer Computer = "computer"
-
-
type ComputerUsePreviewTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
DisplayHeight int64The height of the computer display.
-
DisplayWidth int64The width of the computer display.
-
Environment ComputerUsePreviewToolEnvironmentThe type of computer environment to control.
-
const ComputerUsePreviewToolEnvironmentWindows ComputerUsePreviewToolEnvironment = "windows" -
const ComputerUsePreviewToolEnvironmentMac ComputerUsePreviewToolEnvironment = "mac" -
const ComputerUsePreviewToolEnvironmentLinux ComputerUsePreviewToolEnvironment = "linux" -
const ComputerUsePreviewToolEnvironmentUbuntu ComputerUsePreviewToolEnvironment = "ubuntu" -
const ComputerUsePreviewToolEnvironmentBrowser ComputerUsePreviewToolEnvironment = "browser"
-
-
Type ComputerUsePreviewThe type of the computer use tool. Always
computer_use_preview.const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"
-
-
type WebSearchTool struct{…}Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
Type WebSearchToolTypeThe type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
const WebSearchToolTypeWebSearch WebSearchToolType = "web_search" -
const WebSearchToolTypeWebSearch2025_08_26 WebSearchToolType = "web_search_2025_08_26"
-
-
Filters WebSearchToolFiltersFilters for the search.
-
AllowedDomains []stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
SearchContextSize WebSearchToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchToolSearchContextSizeLow WebSearchToolSearchContextSize = "low" -
const WebSearchToolSearchContextSizeMedium WebSearchToolSearchContextSize = "medium" -
const WebSearchToolSearchContextSizeHigh WebSearchToolSearchContextSize = "high"
-
-
UserLocation WebSearchToolUserLocationThe approximate location of the user.
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
Type stringThe type of location approximation. Always
approximate.const WebSearchToolUserLocationTypeApproximate WebSearchToolUserLocationType = "approximate"
-
-
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
ServerLabel stringA label for this MCP server, used to identify it in tool calls.
-
Type McpThe type of the MCP tool. Always
mcp.const McpMcp Mcp = "mcp"
-
AllowedTools ToolMcpAllowedToolsUnionList of allowed tool names or a filter object.
-
type ToolMcpAllowedToolsMcpAllowedTools []stringA string array of allowed tool names
-
type ToolMcpAllowedToolsMcpToolFilter struct{…}A filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
Authorization stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
ConnectorID stringIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
const ToolMcpConnectorIDConnectorDropbox ToolMcpConnectorID = "connector_dropbox" -
const ToolMcpConnectorIDConnectorGmail ToolMcpConnectorID = "connector_gmail" -
const ToolMcpConnectorIDConnectorGooglecalendar ToolMcpConnectorID = "connector_googlecalendar" -
const ToolMcpConnectorIDConnectorGoogledrive ToolMcpConnectorID = "connector_googledrive" -
const ToolMcpConnectorIDConnectorMicrosoftteams ToolMcpConnectorID = "connector_microsoftteams" -
const ToolMcpConnectorIDConnectorOutlookcalendar ToolMcpConnectorID = "connector_outlookcalendar" -
const ToolMcpConnectorIDConnectorOutlookemail ToolMcpConnectorID = "connector_outlookemail" -
const ToolMcpConnectorIDConnectorSharepoint ToolMcpConnectorID = "connector_sharepoint"
-
-
DeferLoading boolWhether this MCP tool is deferred and discovered via tool search.
-
Headers map[string, string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
RequireApproval ToolMcpRequireApprovalUnionSpecify which of the MCP server's tools require approval.
-
type ToolMcpRequireApprovalMcpToolApprovalFilter 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.-
Always ToolMcpRequireApprovalMcpToolApprovalFilterAlwaysA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
Never ToolMcpRequireApprovalMcpToolApprovalFilterNeverA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
type ToolMcpRequireApprovalMcpToolApprovalSetting stringSpecify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
const ToolMcpRequireApprovalMcpToolApprovalSettingAlways ToolMcpRequireApprovalMcpToolApprovalSetting = "always" -
const ToolMcpRequireApprovalMcpToolApprovalSettingNever ToolMcpRequireApprovalMcpToolApprovalSetting = "never"
-
-
-
ServerDescription stringOptional description of the MCP server, used to provide more context.
-
ServerURL stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
TunnelID stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
Container ToolCodeInterpreterContainerUnionThe code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
string -
type ToolCodeInterpreterContainerCodeInterpreterContainerAuto struct{…}Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
Type AutoAlways
auto.const AutoAuto Auto = "auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit stringThe memory limit for the code interpreter container.
-
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"
-
-
NetworkPolicy ToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…}-
Type DisabledDisable outbound network access. Always
disabled.const DisabledDisabled Disabled = "disabled"
-
-
type ContainerNetworkPolicyAllowlist struct{…}-
AllowedDomains []stringA list of allowed domains when type is
allowlist. -
Type AllowlistAllow outbound network access only to specified domains. Always
allowlist.const AllowlistAllowlist Allowlist = "allowlist"
-
DomainSecrets []ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
Domain stringThe domain associated with the secret.
-
Name stringThe name of the secret to inject for the domain.
-
Value stringThe secret value to inject for the domain.
-
-
-
-
-
-
Type CodeInterpreterThe type of the code interpreter tool. Always
code_interpreter.const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"
-
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
Type ImageGenerationThe type of the image generation tool. Always
image_generation.const ImageGenerationImageGeneration ImageGeneration = "image_generation"
-
Action stringWhether to generate a new image or edit an existing image. Default:
auto.-
const ToolImageGenerationActionGenerate ToolImageGenerationAction = "generate" -
const ToolImageGenerationActionEdit ToolImageGenerationAction = "edit" -
const ToolImageGenerationActionAuto ToolImageGenerationAction = "auto"
-
-
Background stringAllows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
const ToolImageGenerationBackgroundTransparent ToolImageGenerationBackground = "transparent" -
const ToolImageGenerationBackgroundOpaque ToolImageGenerationBackground = "opaque" -
const ToolImageGenerationBackgroundAuto ToolImageGenerationBackground = "auto"
-
-
InputFidelity stringControl how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
const ToolImageGenerationInputFidelityHigh ToolImageGenerationInputFidelity = "high" -
const ToolImageGenerationInputFidelityLow ToolImageGenerationInputFidelity = "low"
-
-
InputImageMask ToolImageGenerationInputImageMaskOptional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
FileID stringFile ID for the mask image.
-
ImageURL stringBase64-encoded mask image.
-
-
Model stringThe image generation model to use. Default:
gpt-image-1.-
string -
string-
const ToolImageGenerationModelGPTImage1 ToolImageGenerationModel = "gpt-image-1" -
const ToolImageGenerationModelGPTImage1Mini ToolImageGenerationModel = "gpt-image-1-mini" -
const ToolImageGenerationModelGPTImage2 ToolImageGenerationModel = "gpt-image-2" -
const ToolImageGenerationModelGPTImage2_2026_04_21 ToolImageGenerationModel = "gpt-image-2-2026-04-21" -
const ToolImageGenerationModelGPTImage1_5 ToolImageGenerationModel = "gpt-image-1.5" -
const ToolImageGenerationModelChatgptImageLatest ToolImageGenerationModel = "chatgpt-image-latest"
-
-
-
Moderation stringModeration level for the generated image. Default:
auto.-
const ToolImageGenerationModerationAuto ToolImageGenerationModeration = "auto" -
const ToolImageGenerationModerationLow ToolImageGenerationModeration = "low"
-
-
OutputCompression int64Compression level for the output image. Default: 100.
-
OutputFormat stringThe output format of the generated image. One of
png,webp, orjpeg. Default:png.-
const ToolImageGenerationOutputFormatPNG ToolImageGenerationOutputFormat = "png" -
const ToolImageGenerationOutputFormatWebP ToolImageGenerationOutputFormat = "webp" -
const ToolImageGenerationOutputFormatJPEG ToolImageGenerationOutputFormat = "jpeg"
-
-
PartialImages int64Number of partial images to generate in streaming mode, from 0 (default value) to 3.
-
Quality stringThe quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
const ToolImageGenerationQualityLow ToolImageGenerationQuality = "low" -
const ToolImageGenerationQualityMedium ToolImageGenerationQuality = "medium" -
const ToolImageGenerationQualityHigh ToolImageGenerationQuality = "high" -
const ToolImageGenerationQualityAuto ToolImageGenerationQuality = "auto"
-
-
Size stringThe size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
string -
string-
const ToolImageGenerationSize1024x1024 ToolImageGenerationSize = "1024x1024" -
const ToolImageGenerationSize1024x1536 ToolImageGenerationSize = "1024x1536" -
const ToolImageGenerationSize1536x1024 ToolImageGenerationSize = "1536x1024" -
const ToolImageGenerationSizeAuto ToolImageGenerationSize = "auto"
-
-
-
-
type ToolLocalShell struct{…}A tool that allows the model to execute shell commands in a local environment.
-
Type LocalShellThe type of the local shell tool. Always
local_shell.const LocalShellLocalShell LocalShell = "local_shell"
-
-
type FunctionShellTool struct{…}A tool that allows the model to execute shell commands.
-
Type ShellThe type of the shell tool. Always
shell.const ShellShell Shell = "shell"
-
Environment FunctionShellToolEnvironmentUnion-
type ContainerAuto struct{…}-
Type ContainerAutoAutomatically creates a container for this request
const ContainerAutoContainerAuto ContainerAuto = "container_auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit ContainerAutoMemoryLimitThe memory limit for the container.
-
const ContainerAutoMemoryLimit1g ContainerAutoMemoryLimit = "1g" -
const ContainerAutoMemoryLimit4g ContainerAutoMemoryLimit = "4g" -
const ContainerAutoMemoryLimit16g ContainerAutoMemoryLimit = "16g" -
const ContainerAutoMemoryLimit64g ContainerAutoMemoryLimit = "64g"
-
-
NetworkPolicy ContainerAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…} -
type ContainerNetworkPolicyAllowlist struct{…}
-
-
Skills []ContainerAutoSkillUnionAn optional list of skills referenced by id or inline data.
-
type SkillReference struct{…}-
SkillID stringThe ID of the referenced skill.
-
Type SkillReferenceReferences a skill created with the /v1/skills endpoint.
const SkillReferenceSkillReference SkillReference = "skill_reference"
-
Version stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
type InlineSkill struct{…}-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Source InlineSkillSourceInline skill payload
-
Data stringBase64-encoded skill zip bundle.
-
MediaType ApplicationZipThe media type of the inline skill payload. Must be
application/zip.const ApplicationZipApplicationZip ApplicationZip = "application/zip"
-
Type Base64The type of the inline skill source. Must be
base64.const Base64Base64 Base64 = "base64"
-
-
Type InlineDefines an inline skill for this request.
const InlineInline Inline = "inline"
-
-
-
-
type LocalEnvironment struct{…}-
Type LocalUse a local computer environment.
const LocalLocal Local = "local"
-
Skills []LocalSkillAn optional list of skills.
-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Path stringThe path to the directory containing the skill.
-
-
-
type ContainerReference struct{…}-
ContainerID stringThe ID of the referenced container.
-
Type ContainerReferenceReferences a container created with the /v1/containers endpoint
const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
Name stringThe name of the custom tool, used to identify it in tool calls.
-
Type CustomThe type of the custom tool. Always
custom.const CustomCustom Custom = "custom"
-
DeferLoading boolWhether this tool should be deferred and discovered via tool search.
-
Description stringOptional description of the custom tool, used to provide more context.
-
Format CustomToolInputFormatUnionThe input format for the custom tool. Default is unconstrained text.
-
type CustomToolInputFormatText struct{…}Unconstrained free-form text.
-
Type TextUnconstrained text format. Always
text.const TextText Text = "text"
-
-
type CustomToolInputFormatGrammar struct{…}A grammar defined by the user.
-
Definition stringThe grammar definition.
-
Syntax stringThe syntax of the grammar definition. One of
larkorregex.-
const CustomToolInputFormatGrammarSyntaxLark CustomToolInputFormatGrammarSyntax = "lark" -
const CustomToolInputFormatGrammarSyntaxRegex CustomToolInputFormatGrammarSyntax = "regex"
-
-
Type GrammarGrammar format. Always
grammar.const GrammarGrammar Grammar = "grammar"
-
-
-
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
Description stringA description of the namespace shown to the model.
-
Name stringThe namespace name used in tool calls (for example,
crm). -
Tools []NamespaceToolToolUnionThe function/custom tools available inside this namespace.
-
type NamespaceToolToolFunction struct{…}-
Name string -
Type Functionconst FunctionFunction Function = "function"
-
DeferLoading boolWhether this function should be deferred and discovered via tool search.
-
Description string -
Parameters any -
Strict bool
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
-
Type NamespaceThe type of the tool. Always
namespace.const NamespaceNamespace Namespace = "namespace"
-
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
Type ToolSearchThe type of the tool. Always
tool_search.const ToolSearchToolSearch ToolSearch = "tool_search"
-
Description stringDescription shown to the model for a client-executed tool search tool.
-
Execution ToolSearchToolExecutionWhether tool search is executed by the server or by the client.
-
const ToolSearchToolExecutionServer ToolSearchToolExecution = "server" -
const ToolSearchToolExecutionClient ToolSearchToolExecution = "client"
-
-
Parameters anyParameter schema for a client-executed tool search tool.
-
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
Type WebSearchPreviewToolTypeThe type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
const WebSearchPreviewToolTypeWebSearchPreview WebSearchPreviewToolType = "web_search_preview" -
const WebSearchPreviewToolTypeWebSearchPreview2025_03_11 WebSearchPreviewToolType = "web_search_preview_2025_03_11"
-
-
SearchContentTypes []string-
const WebSearchPreviewToolSearchContentTypeText WebSearchPreviewToolSearchContentType = "text" -
const WebSearchPreviewToolSearchContentTypeImage WebSearchPreviewToolSearchContentType = "image"
-
-
SearchContextSize WebSearchPreviewToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchPreviewToolSearchContextSizeLow WebSearchPreviewToolSearchContextSize = "low" -
const WebSearchPreviewToolSearchContextSizeMedium WebSearchPreviewToolSearchContextSize = "medium" -
const WebSearchPreviewToolSearchContextSizeHigh WebSearchPreviewToolSearchContextSize = "high"
-
-
UserLocation WebSearchPreviewToolUserLocationThe user's location.
-
Type ApproximateThe type of location approximation. Always
approximate.const ApproximateApproximate Approximate = "approximate"
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
Type ApplyPatchThe type of the tool. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
-
Type ToolSearchOutputThe item type. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
ID stringThe unique ID of this tool search output.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemParamExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemParamExecutionServer ResponseToolSearchOutputItemParamExecution = "server" -
const ResponseToolSearchOutputItemParamExecutionClient ResponseToolSearchOutputItemParamExecution = "client"
-
-
Status ResponseToolSearchOutputItemParamStatusThe status of the tool search output.
-
const ResponseToolSearchOutputItemParamStatusInProgress ResponseToolSearchOutputItemParamStatus = "in_progress" -
const ResponseToolSearchOutputItemParamStatusCompleted ResponseToolSearchOutputItemParamStatus = "completed" -
const ResponseToolSearchOutputItemParamStatusIncomplete ResponseToolSearchOutputItemParamStatus = "incomplete"
-
-
-
type ResponseInputItemAdditionalTools struct{…}-
Role DeveloperThe role that provided the additional tools. Only
developeris supported.const DeveloperDeveloper Developer = "developer"
-
Tools []ToolUnionA list of additional tools made available at this item.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type AdditionalToolsThe item type. Always
additional_tools.const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"
-
ID stringThe unique ID of this additional tools item.
-
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
ID stringThe unique identifier of the reasoning content.
-
Summary []ResponseReasoningItemSummaryReasoning summary content.
-
Text stringA summary of the reasoning output from the model so far.
-
Type SummaryTextThe type of the object. Always
summary_text.const SummaryTextSummaryText SummaryText = "summary_text"
-
-
Type ReasoningThe type of the object. Always
reasoning.const ReasoningReasoning Reasoning = "reasoning"
-
Content []ResponseReasoningItemContentReasoning text content.
-
Text stringThe reasoning text from the model.
-
Type ReasoningTextThe type of the reasoning text. Always
reasoning_text.const ReasoningTextReasoningText ReasoningText = "reasoning_text"
-
-
EncryptedContent stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
Status ResponseReasoningItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseReasoningItemStatusInProgress ResponseReasoningItemStatus = "in_progress" -
const ResponseReasoningItemStatusCompleted ResponseReasoningItemStatus = "completed" -
const ResponseReasoningItemStatusIncomplete ResponseReasoningItemStatus = "incomplete"
-
-
-
type ResponseCompactionItemParamResp struct{…}A compaction item generated by the
v1/responses/compactAPI.-
EncryptedContent stringThe encrypted content of the compaction summary.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
ID stringThe ID of the compaction item.
-
-
type ResponseInputItemImageGenerationCall struct{…}An image generation request made by the model.
-
ID stringThe unique ID of the image generation call.
-
Result stringThe generated image encoded in base64.
-
Status stringThe status of the image generation call.
-
const ResponseInputItemImageGenerationCallStatusInProgress ResponseInputItemImageGenerationCallStatus = "in_progress" -
const ResponseInputItemImageGenerationCallStatusCompleted ResponseInputItemImageGenerationCallStatus = "completed" -
const ResponseInputItemImageGenerationCallStatusGenerating ResponseInputItemImageGenerationCallStatus = "generating" -
const ResponseInputItemImageGenerationCallStatusFailed ResponseInputItemImageGenerationCallStatus = "failed"
-
-
Type ImageGenerationCallThe type of the image generation call. Always
image_generation_call.const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"
-
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
ID stringThe unique ID of the code interpreter tool call.
-
Code stringThe code to run, or null if not available.
-
ContainerID stringThe ID of the container used to run the code.
-
Outputs []ResponseCodeInterpreterToolCallOutputUnionThe outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
type ResponseCodeInterpreterToolCallOutputLogs struct{…}The logs output from the code interpreter.
-
Logs stringThe logs output from the code interpreter.
-
Type LogsThe type of the output. Always
logs.const LogsLogs Logs = "logs"
-
-
type ResponseCodeInterpreterToolCallOutputImage struct{…}The image output from the code interpreter.
-
Type ImageThe type of the output. Always
image.const ImageImage Image = "image"
-
URL stringThe URL of the image output from the code interpreter.
-
-
-
Status ResponseCodeInterpreterToolCallStatusThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
const ResponseCodeInterpreterToolCallStatusInProgress ResponseCodeInterpreterToolCallStatus = "in_progress" -
const ResponseCodeInterpreterToolCallStatusCompleted ResponseCodeInterpreterToolCallStatus = "completed" -
const ResponseCodeInterpreterToolCallStatusIncomplete ResponseCodeInterpreterToolCallStatus = "incomplete" -
const ResponseCodeInterpreterToolCallStatusInterpreting ResponseCodeInterpreterToolCallStatus = "interpreting" -
const ResponseCodeInterpreterToolCallStatusFailed ResponseCodeInterpreterToolCallStatus = "failed"
-
-
Type CodeInterpreterCallThe type of the code interpreter tool call. Always
code_interpreter_call.const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"
-
-
type ResponseInputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
ID stringThe unique ID of the local shell call.
-
Action ResponseInputItemLocalShellCallActionExecute a shell command on the server.
-
Command []stringThe command to run.
-
Env map[string, string]Environment variables to set for the command.
-
Type ExecThe type of the local shell action. Always
exec.const ExecExec Exec = "exec"
-
TimeoutMs int64Optional timeout in milliseconds for the command.
-
User stringOptional user to run the command as.
-
WorkingDirectory stringOptional working directory to run the command in.
-
-
CallID stringThe unique ID of the local shell tool call generated by the model.
-
Status stringThe status of the local shell call.
-
const ResponseInputItemLocalShellCallStatusInProgress ResponseInputItemLocalShellCallStatus = "in_progress" -
const ResponseInputItemLocalShellCallStatusCompleted ResponseInputItemLocalShellCallStatus = "completed" -
const ResponseInputItemLocalShellCallStatusIncomplete ResponseInputItemLocalShellCallStatus = "incomplete"
-
-
Type LocalShellCallThe type of the local shell call. Always
local_shell_call.const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"
-
-
type ResponseInputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
ID stringThe unique ID of the local shell tool call generated by the model.
-
Output stringA JSON string of the output of the local shell tool call.
-
Type LocalShellCallOutputThe type of the local shell tool call output. Always
local_shell_call_output.const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete.-
const ResponseInputItemLocalShellCallOutputStatusInProgress ResponseInputItemLocalShellCallOutputStatus = "in_progress" -
const ResponseInputItemLocalShellCallOutputStatusCompleted ResponseInputItemLocalShellCallOutputStatus = "completed" -
const ResponseInputItemLocalShellCallOutputStatusIncomplete ResponseInputItemLocalShellCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemShellCall struct{…}A tool representing a request to execute one or more shell commands.
-
Action ResponseInputItemShellCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []stringOrdered shell commands for the execution environment to run.
-
MaxOutputLength int64Maximum number of UTF-8 characters to capture from combined stdout and stderr output.
-
TimeoutMs int64Maximum wall-clock time in milliseconds to allow the shell commands to run.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Environment ResponseInputItemShellCallEnvironmentUnionThe environment to execute the shell commands in.
-
type LocalEnvironment struct{…} -
type ContainerReference struct{…}
-
-
Status stringThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseInputItemShellCallStatusInProgress ResponseInputItemShellCallStatus = "in_progress" -
const ResponseInputItemShellCallStatusCompleted ResponseInputItemShellCallStatus = "completed" -
const ResponseInputItemShellCallStatusIncomplete ResponseInputItemShellCallStatus = "incomplete"
-
-
-
type ResponseInputItemShellCallOutput struct{…}The streamed output items emitted by a shell tool call.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Output []ResponseFunctionShellCallOutputContentCaptured chunks of stdout and stderr output, along with their associated outcomes.
-
Outcome ResponseFunctionShellCallOutputContentOutcomeUnionThe exit or timeout outcome associated with this shell call.
-
type ResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellCallOutputContentOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64The exit code returned by the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringCaptured stderr output for the shell call.
-
Stdout stringCaptured stdout output for the shell call.
-
-
Type ShellCallOutputThe type of the item. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
ID stringThe unique ID of the shell tool call output. Populated when this item is returned via API.
-
MaxOutputLength int64The maximum number of UTF-8 characters captured for this shell call's combined output.
-
Status stringThe status of the shell call output.
-
const ResponseInputItemShellCallOutputStatusInProgress ResponseInputItemShellCallOutputStatus = "in_progress" -
const ResponseInputItemShellCallOutputStatusCompleted ResponseInputItemShellCallOutputStatus = "completed" -
const ResponseInputItemShellCallOutputStatusIncomplete ResponseInputItemShellCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemApplyPatchCall struct{…}A tool call representing a request to create, delete, or update files using diff patches.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseInputItemApplyPatchCallOperationUnionThe specific create, delete, or update instruction for the apply_patch tool call.
-
type ResponseInputItemApplyPatchCallOperationCreateFile struct{…}Instruction for creating a new file via the apply_patch tool.
-
Diff stringUnified diff content to apply when creating the file.
-
Path stringPath of the file to create relative to the workspace root.
-
Type CreateFileThe operation type. Always
create_file.const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseInputItemApplyPatchCallOperationDeleteFile struct{…}Instruction for deleting an existing file via the apply_patch tool.
-
Path stringPath of the file to delete relative to the workspace root.
-
Type DeleteFileThe operation type. Always
delete_file.const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseInputItemApplyPatchCallOperationUpdateFile struct{…}Instruction for updating an existing file via the apply_patch tool.
-
Diff stringUnified diff content to apply to the existing file.
-
Path stringPath of the file to update relative to the workspace root.
-
Type UpdateFileThe operation type. Always
update_file.const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status stringThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseInputItemApplyPatchCallStatusInProgress ResponseInputItemApplyPatchCallStatus = "in_progress" -
const ResponseInputItemApplyPatchCallStatusCompleted ResponseInputItemApplyPatchCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
-
type ResponseInputItemApplyPatchCallOutput struct{…}The streamed output emitted by an apply patch tool call.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status stringThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseInputItemApplyPatchCallOutputStatusCompleted ResponseInputItemApplyPatchCallOutputStatus = "completed" -
const ResponseInputItemApplyPatchCallOutputStatusFailed ResponseInputItemApplyPatchCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
Output stringOptional human-readable log text from the apply patch tool (e.g., patch results or errors).
-
-
type ResponseInputItemMcpListTools struct{…}A list of tools available on an MCP server.
-
ID stringThe unique ID of the list.
-
ServerLabel stringThe label of the MCP server.
-
Tools []ResponseInputItemMcpListToolsToolThe tools available on the server.
-
InputSchema anyThe JSON schema describing the tool's input.
-
Name stringThe name of the tool.
-
Annotations anyAdditional annotations about the tool.
-
Description stringThe description of the tool.
-
-
Type McpListToolsThe type of the item. Always
mcp_list_tools.const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
-
Error stringError message if the server could not list tools.
-
-
type ResponseInputItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
ID stringThe unique ID of the approval request.
-
Arguments stringA JSON string of arguments for the tool.
-
Name stringThe name of the tool to run.
-
ServerLabel stringThe label of the MCP server making the request.
-
Type McpApprovalRequestThe type of the item. Always
mcp_approval_request.const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"
-
-
type ResponseInputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
ApprovalRequestID stringThe ID of the approval request being answered.
-
Approve boolWhether the request was approved.
-
Type McpApprovalResponseThe type of the item. Always
mcp_approval_response.const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
-
ID stringThe unique ID of the approval response
-
Reason stringOptional reason for the decision.
-
-
type ResponseInputItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
ID stringThe unique ID of the tool call.
-
Arguments stringA JSON string of the arguments passed to the tool.
-
Name stringThe name of the tool that was run.
-
ServerLabel stringThe label of the MCP server running the tool.
-
Type McpCallThe type of the item. Always
mcp_call.const McpCallMcpCall McpCall = "mcp_call"
-
ApprovalRequestID stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
Error stringThe error from the tool call, if any.
-
Output stringThe output from the tool call.
-
Status stringThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
const ResponseInputItemMcpCallStatusInProgress ResponseInputItemMcpCallStatus = "in_progress" -
const ResponseInputItemMcpCallStatusCompleted ResponseInputItemMcpCallStatus = "completed" -
const ResponseInputItemMcpCallStatusIncomplete ResponseInputItemMcpCallStatus = "incomplete" -
const ResponseInputItemMcpCallStatusCalling ResponseInputItemMcpCallStatus = "calling" -
const ResponseInputItemMcpCallStatusFailed ResponseInputItemMcpCallStatus = "failed"
-
-
-
type ResponseCustomToolCallOutput struct{…}The output of a custom tool call from your code, being sent back to the model.
-
CallID stringThe call ID, used to map this custom tool call output to a custom tool call.
-
Output ResponseCustomToolCallOutputOutputUnionThe output from the custom tool call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseCustomToolCallOutputOutputOutputContentList []ResponseCustomToolCallOutputOutputOutputContentListItemUnionText, image, or file output of the custom tool call.
-
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
-
Type CustomToolCallOutputThe type of the custom tool call output. Always
custom_tool_call_output.const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"
-
ID stringThe unique ID of the custom tool call output in the OpenAI platform.
-
-
type ResponseCustomToolCall struct{…}A call to a custom tool created by the model.
-
CallID stringAn identifier used to map this custom tool call to a tool call output.
-
Input stringThe input for the custom tool call generated by the model.
-
Name stringThe name of the custom tool being called.
-
Type CustomToolCallThe type of the custom tool call. Always
custom_tool_call.const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"
-
ID stringThe unique ID of the custom tool call in the OpenAI platform.
-
Namespace stringThe namespace of the custom tool being called.
-
-
type ResponseInputItemCompactionTrigger struct{…}Compacts the current context. Must be the final input item.
-
Type CompactionTriggerThe type of the item. Always
compaction_trigger.const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"
-
-
type ResponseInputItemItemReference struct{…}An internal identifier for an item to reference.
-
ID stringThe ID of the item to reference.
-
Type stringThe type of item to reference. Always
item_reference.const ResponseInputItemItemReferenceTypeItemReference ResponseInputItemItemReferenceType = "item_reference"
-
-
Response Input Message Content List
-
type ResponseInputMessageContentList []ResponseInputContentUnionA list of one or many input items to the model, containing different content types.
-
type ResponseInputText struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
Detail ResponseInputImageDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageDetailLow ResponseInputImageDetail = "low" -
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high" -
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto" -
const ResponseInputImageDetailOriginal ResponseInputImageDetail = "original"
-
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFile struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileDetailLow ResponseInputFileDetail = "low" -
const ResponseInputFileDetailHigh ResponseInputFileDetail = "high"
-
-
FileData stringThe content of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
Response Input Message Item
-
type ResponseInputMessageItem struct{…}-
ID stringThe unique ID of the message input.
-
Content ResponseInputMessageContentListA list of one or many input items to the model, containing different content types.
-
type ResponseInputText struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
Detail ResponseInputImageDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageDetailLow ResponseInputImageDetail = "low" -
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high" -
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto" -
const ResponseInputImageDetailOriginal ResponseInputImageDetail = "original"
-
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFile struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileDetailLow ResponseInputFileDetail = "low" -
const ResponseInputFileDetailHigh ResponseInputFileDetail = "high"
-
-
FileData stringThe content of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
Role ResponseInputMessageItemRoleThe role of the message input. One of
user,system, ordeveloper.-
const ResponseInputMessageItemRoleUser ResponseInputMessageItemRole = "user" -
const ResponseInputMessageItemRoleSystem ResponseInputMessageItemRole = "system" -
const ResponseInputMessageItemRoleDeveloper ResponseInputMessageItemRole = "developer"
-
-
Type MessageThe type of the message input. Always set to
message.const MessageMessage Message = "message"
-
Status ResponseInputMessageItemStatusThe status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputMessageItemStatusInProgress ResponseInputMessageItemStatus = "in_progress" -
const ResponseInputMessageItemStatusCompleted ResponseInputMessageItemStatus = "completed" -
const ResponseInputMessageItemStatusIncomplete ResponseInputMessageItemStatus = "incomplete"
-
-
Response Input Text
-
type ResponseInputText struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
Response Input Text Content
-
type ResponseInputTextContent struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
Response Item
-
type ResponseItemUnion interface{…}Content item used to generate a response.
-
type ResponseInputMessageItem struct{…}-
ID stringThe unique ID of the message input.
-
Content ResponseInputMessageContentListA list of one or many input items to the model, containing different content types.
-
type ResponseInputText struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
Detail ResponseInputImageDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageDetailLow ResponseInputImageDetail = "low" -
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high" -
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto" -
const ResponseInputImageDetailOriginal ResponseInputImageDetail = "original"
-
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFile struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileDetailLow ResponseInputFileDetail = "low" -
const ResponseInputFileDetailHigh ResponseInputFileDetail = "high"
-
-
FileData stringThe content of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
Role ResponseInputMessageItemRoleThe role of the message input. One of
user,system, ordeveloper.-
const ResponseInputMessageItemRoleUser ResponseInputMessageItemRole = "user" -
const ResponseInputMessageItemRoleSystem ResponseInputMessageItemRole = "system" -
const ResponseInputMessageItemRoleDeveloper ResponseInputMessageItemRole = "developer"
-
-
Type MessageThe type of the message input. Always set to
message.const MessageMessage Message = "message"
-
Status ResponseInputMessageItemStatusThe status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputMessageItemStatusInProgress ResponseInputMessageItemStatus = "in_progress" -
const ResponseInputMessageItemStatusCompleted ResponseInputMessageItemStatus = "completed" -
const ResponseInputMessageItemStatusIncomplete ResponseInputMessageItemStatus = "incomplete"
-
-
-
type ResponseOutputMessage struct{…}An output message from the model.
-
ID stringThe unique ID of the output message.
-
Content []ResponseOutputMessageContentUnionThe content of the output message.
-
type ResponseOutputText struct{…}A text output from the model.
-
Annotations []ResponseOutputTextAnnotationUnionThe annotations of the text output.
-
type ResponseOutputTextAnnotationFileCitation struct{…}A citation to a file.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the file cited.
-
Index int64The index of the file in the list of files.
-
Type FileCitationThe type of the file citation. Always
file_citation.const FileCitationFileCitation FileCitation = "file_citation"
-
-
type ResponseOutputTextAnnotationURLCitation struct{…}A citation for a web resource used to generate a model response.
-
EndIndex int64The index of the last character of the URL citation in the message.
-
StartIndex int64The index of the first character of the URL citation in the message.
-
Title stringThe title of the web resource.
-
Type URLCitationThe type of the URL citation. Always
url_citation.const URLCitationURLCitation URLCitation = "url_citation"
-
URL stringThe URL of the web resource.
-
-
type ResponseOutputTextAnnotationContainerFileCitation struct{…}A citation for a container file used to generate a model response.
-
ContainerID stringThe ID of the container file.
-
EndIndex int64The index of the last character of the container file citation in the message.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the container file cited.
-
StartIndex int64The index of the first character of the container file citation in the message.
-
Type ContainerFileCitationThe type of the container file citation. Always
container_file_citation.const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"
-
-
type ResponseOutputTextAnnotationFilePath struct{…}A path to a file.
-
FileID stringThe ID of the file.
-
Index int64The index of the file in the list of files.
-
Type FilePathThe type of the file path. Always
file_path.const FilePathFilePath FilePath = "file_path"
-
-
-
Text stringThe text output from the model.
-
Type OutputTextThe type of the output text. Always
output_text.const OutputTextOutputText OutputText = "output_text"
-
Logprobs []ResponseOutputTextLogprob-
Token string -
Bytes []int64 -
Logprob float64 -
TopLogprobs []ResponseOutputTextLogprobTopLogprob-
Token string -
Bytes []int64 -
Logprob float64
-
-
-
-
type ResponseOutputRefusal struct{…}A refusal from the model.
-
Refusal stringThe refusal explanation from the model.
-
Type RefusalThe type of the refusal. Always
refusal.const RefusalRefusal Refusal = "refusal"
-
-
-
Role AssistantThe role of the output message. Always
assistant.const AssistantAssistant Assistant = "assistant"
-
Status ResponseOutputMessageStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseOutputMessageStatusInProgress ResponseOutputMessageStatus = "in_progress" -
const ResponseOutputMessageStatusCompleted ResponseOutputMessageStatus = "completed" -
const ResponseOutputMessageStatusIncomplete ResponseOutputMessageStatus = "incomplete"
-
-
Type MessageThe type of the output message. Always
message.const MessageMessage Message = "message"
-
Phase ResponseOutputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const ResponseOutputMessagePhaseCommentary ResponseOutputMessagePhase = "commentary" -
const ResponseOutputMessagePhaseFinalAnswer ResponseOutputMessagePhase = "final_answer"
-
-
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
ID stringThe unique ID of the file search tool call.
-
Queries []stringThe queries used to search for files.
-
Status ResponseFileSearchToolCallStatusThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
const ResponseFileSearchToolCallStatusInProgress ResponseFileSearchToolCallStatus = "in_progress" -
const ResponseFileSearchToolCallStatusSearching ResponseFileSearchToolCallStatus = "searching" -
const ResponseFileSearchToolCallStatusCompleted ResponseFileSearchToolCallStatus = "completed" -
const ResponseFileSearchToolCallStatusIncomplete ResponseFileSearchToolCallStatus = "incomplete" -
const ResponseFileSearchToolCallStatusFailed ResponseFileSearchToolCallStatus = "failed"
-
-
Type FileSearchCallThe type of the file search tool call. Always
file_search_call.const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"
-
Results []ResponseFileSearchToolCallResultThe results of the file search tool call.
-
Attributes map[string, ResponseFileSearchToolCallResultAttributeUnion]Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.
-
string -
float64 -
bool
-
-
FileID stringThe unique ID of the file.
-
Filename stringThe name of the file.
-
Score float64The relevance score of the file - a value between 0 and 1.
-
Text stringThe text that was retrieved from the file.
-
-
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
ID stringThe unique ID of the computer call.
-
CallID stringAn identifier used when responding to the tool call with output.
-
PendingSafetyChecks []ResponseComputerToolCallPendingSafetyCheckThe pending safety checks for the computer call.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status ResponseComputerToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseComputerToolCallStatusInProgress ResponseComputerToolCallStatus = "in_progress" -
const ResponseComputerToolCallStatusCompleted ResponseComputerToolCallStatus = "completed" -
const ResponseComputerToolCallStatusIncomplete ResponseComputerToolCallStatus = "incomplete"
-
-
Type ResponseComputerToolCallTypeThe type of the computer call. Always
computer_call.const ResponseComputerToolCallTypeComputerCall ResponseComputerToolCallType = "computer_call"
-
Action ResponseComputerToolCallActionUnionA click action.
-
type ResponseComputerToolCallActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ResponseComputerToolCallActionClickButtonLeft ResponseComputerToolCallActionClickButton = "left" -
const ResponseComputerToolCallActionClickButtonRight ResponseComputerToolCallActionClickButton = "right" -
const ResponseComputerToolCallActionClickButtonWheel ResponseComputerToolCallActionClickButton = "wheel" -
const ResponseComputerToolCallActionClickButtonBack ResponseComputerToolCallActionClickButton = "back" -
const ResponseComputerToolCallActionClickButtonForward ResponseComputerToolCallActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ResponseComputerToolCallActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ResponseComputerToolCallActionDrag struct{…}A drag action.
-
Path []ResponseComputerToolCallActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ResponseComputerToolCallActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ResponseComputerToolCallActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ResponseComputerToolCallActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ResponseComputerToolCallActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ResponseComputerToolCallActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ResponseComputerToolCallActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
Actions ComputerActionListFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
type ComputerActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ComputerActionClickButtonLeft ComputerActionClickButton = "left" -
const ComputerActionClickButtonRight ComputerActionClickButton = "right" -
const ComputerActionClickButtonWheel ComputerActionClickButton = "wheel" -
const ComputerActionClickButtonBack ComputerActionClickButton = "back" -
const ComputerActionClickButtonForward ComputerActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ComputerActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ComputerActionDrag struct{…}A drag action.
-
Path []ComputerActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ComputerActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ComputerActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ComputerActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ComputerActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ComputerActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ComputerActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
-
type ResponseComputerToolCallOutputItem struct{…}-
ID stringThe unique ID of the computer call tool output.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Type ComputerScreenshotSpecifies the event type. For a computer screenshot, this property is always set to
computer_screenshot.const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"
-
FileID stringThe identifier of an uploaded file that contains the screenshot.
-
ImageURL stringThe URL of the screenshot image.
-
-
Status ResponseComputerToolCallOutputItemStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseComputerToolCallOutputItemStatusCompleted ResponseComputerToolCallOutputItemStatus = "completed" -
const ResponseComputerToolCallOutputItemStatusIncomplete ResponseComputerToolCallOutputItemStatus = "incomplete" -
const ResponseComputerToolCallOutputItemStatusFailed ResponseComputerToolCallOutputItemStatus = "failed" -
const ResponseComputerToolCallOutputItemStatusInProgress ResponseComputerToolCallOutputItemStatus = "in_progress"
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
AcknowledgedSafetyChecks []ResponseComputerToolCallOutputItemAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
ID stringThe unique ID of the web search tool call.
-
Action ResponseFunctionWebSearchActionUnionAn object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
type ResponseFunctionWebSearchActionSearch struct{…}Action type "search" - Performs a web search query.
-
Type SearchThe action type.
const SearchSearch Search = "search"
-
Queries []stringThe search queries.
-
Query stringThe search query.
-
Sources []ResponseFunctionWebSearchActionSearchSourceThe sources used in the search.
-
Type URLThe type of source. Always
url.const URLURL URL = "url"
-
URL stringThe URL of the source.
-
-
-
type ResponseFunctionWebSearchActionOpenPage struct{…}Action type "open_page" - Opens a specific URL from search results.
-
Type OpenPageThe action type.
const OpenPageOpenPage OpenPage = "open_page"
-
URL stringThe URL opened by the model.
-
-
type ResponseFunctionWebSearchActionFindInPage struct{…}Action type "find_in_page": Searches for a pattern within a loaded page.
-
Pattern stringThe pattern or text to search for within the page.
-
Type FindInPageThe action type.
const FindInPageFindInPage FindInPage = "find_in_page"
-
URL stringThe URL of the page searched for the pattern.
-
-
-
Status ResponseFunctionWebSearchStatusThe status of the web search tool call.
-
const ResponseFunctionWebSearchStatusInProgress ResponseFunctionWebSearchStatus = "in_progress" -
const ResponseFunctionWebSearchStatusSearching ResponseFunctionWebSearchStatus = "searching" -
const ResponseFunctionWebSearchStatusCompleted ResponseFunctionWebSearchStatus = "completed" -
const ResponseFunctionWebSearchStatusFailed ResponseFunctionWebSearchStatus = "failed"
-
-
Type WebSearchCallThe type of the web search tool call. Always
web_search_call.const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"
-
-
type ResponseFunctionToolCallItem struct{…}A tool call to run a function. See the function calling guide for more information.
-
ID stringThe unique ID of the function tool call.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallItemStatusInProgress ResponseFunctionToolCallItemStatus = "in_progress" -
const ResponseFunctionToolCallItemStatusCompleted ResponseFunctionToolCallItemStatus = "completed" -
const ResponseFunctionToolCallItemStatusIncomplete ResponseFunctionToolCallItemStatus = "incomplete"
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseFunctionToolCallOutputItem struct{…}-
ID stringThe unique ID of the function call tool output.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseFunctionToolCallOutputItemOutputUnionThe output from the function call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseFunctionToolCallOutputItemOutputOutputContentList []ResponseFunctionToolCallOutputItemOutputOutputContentListItemUnionText, image, or file output of the function call.
-
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
-
Status ResponseFunctionToolCallOutputItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallOutputItemStatusInProgress ResponseFunctionToolCallOutputItemStatus = "in_progress" -
const ResponseFunctionToolCallOutputItemStatusCompleted ResponseFunctionToolCallOutputItemStatus = "completed" -
const ResponseFunctionToolCallOutputItemStatusIncomplete ResponseFunctionToolCallOutputItemStatus = "incomplete"
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseToolSearchCall struct{…}-
ID stringThe unique ID of the tool search call item.
-
Arguments anyArguments used for the tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchCallExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchCallExecutionServer ResponseToolSearchCallExecution = "server" -
const ResponseToolSearchCallExecutionClient ResponseToolSearchCallExecution = "client"
-
-
Status ResponseToolSearchCallStatusThe status of the tool search call item that was recorded.
-
const ResponseToolSearchCallStatusInProgress ResponseToolSearchCallStatus = "in_progress" -
const ResponseToolSearchCallStatusCompleted ResponseToolSearchCallStatus = "completed" -
const ResponseToolSearchCallStatusIncomplete ResponseToolSearchCallStatus = "incomplete"
-
-
Type ToolSearchCallThe type of the item. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseToolSearchOutputItem struct{…}-
ID stringThe unique ID of the tool search output item.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemExecutionServer ResponseToolSearchOutputItemExecution = "server" -
const ResponseToolSearchOutputItemExecutionClient ResponseToolSearchOutputItemExecution = "client"
-
-
Status ResponseToolSearchOutputItemStatusThe status of the tool search output item that was recorded.
-
const ResponseToolSearchOutputItemStatusInProgress ResponseToolSearchOutputItemStatus = "in_progress" -
const ResponseToolSearchOutputItemStatusCompleted ResponseToolSearchOutputItemStatus = "completed" -
const ResponseToolSearchOutputItemStatusIncomplete ResponseToolSearchOutputItemStatus = "incomplete"
-
-
Tools []ToolUnionThe loaded tool definitions returned by tool search.
-
type FunctionTool struct{…}Defines a function in your own code the model can choose to call. Learn more about function calling.
-
Name stringThe name of the function to call.
-
Parameters map[string, any]A JSON schema object describing the parameters of the function.
-
Strict boolWhether to enforce strict parameter validation. Default
true. -
Type FunctionThe type of the function tool. Always
function.const FunctionFunction Function = "function"
-
DeferLoading boolWhether this function is deferred and loaded via tool search.
-
Description stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
type FileSearchTool struct{…}A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
Type FileSearchThe type of the file search tool. Always
file_search.const FileSearchFileSearch FileSearch = "file_search"
-
VectorStoreIDs []stringThe IDs of the vector stores to search.
-
Filters FileSearchToolFiltersUnionA filter to apply.
-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
Key stringThe key to compare against the value.
-
Type ComparisonFilterTypeSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
const ComparisonFilterTypeEq ComparisonFilterType = "eq" -
const ComparisonFilterTypeNe ComparisonFilterType = "ne" -
const ComparisonFilterTypeGt ComparisonFilterType = "gt" -
const ComparisonFilterTypeGte ComparisonFilterType = "gte" -
const ComparisonFilterTypeLt ComparisonFilterType = "lt" -
const ComparisonFilterTypeLte ComparisonFilterType = "lte" -
const ComparisonFilterTypeIn ComparisonFilterType = "in" -
const ComparisonFilterTypeNin ComparisonFilterType = "nin"
-
-
Value ComparisonFilterValueUnionThe value to compare against the attribute key; supports string, number, or boolean types.
-
string -
float64 -
bool -
type ComparisonFilterValueArray []ComparisonFilterValueArrayItemUnion-
string -
float64
-
-
-
-
type CompoundFilter struct{…}Combine multiple filters using
andoror.-
Filters []ComparisonFilterArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
-
Type CompoundFilterTypeType of operation:
andoror.-
const CompoundFilterTypeAnd CompoundFilterType = "and" -
const CompoundFilterTypeOr CompoundFilterType = "or"
-
-
-
-
MaxNumResults int64The maximum number of results to return. This number should be between 1 and 50 inclusive.
-
RankingOptions FileSearchToolRankingOptionsRanking options for search.
-
HybridSearch FileSearchToolRankingOptionsHybridSearchWeights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
EmbeddingWeight float64The weight of the embedding in the reciprocal ranking fusion.
-
TextWeight float64The weight of the text in the reciprocal ranking fusion.
-
-
Ranker stringThe ranker to use for the file search.
-
const FileSearchToolRankingOptionsRankerAuto FileSearchToolRankingOptionsRanker = "auto" -
const FileSearchToolRankingOptionsRankerDefault2024_11_15 FileSearchToolRankingOptionsRanker = "default-2024-11-15"
-
-
ScoreThreshold float64The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
Type ComputerThe type of the computer tool. Always
computer.const ComputerComputer Computer = "computer"
-
-
type ComputerUsePreviewTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
DisplayHeight int64The height of the computer display.
-
DisplayWidth int64The width of the computer display.
-
Environment ComputerUsePreviewToolEnvironmentThe type of computer environment to control.
-
const ComputerUsePreviewToolEnvironmentWindows ComputerUsePreviewToolEnvironment = "windows" -
const ComputerUsePreviewToolEnvironmentMac ComputerUsePreviewToolEnvironment = "mac" -
const ComputerUsePreviewToolEnvironmentLinux ComputerUsePreviewToolEnvironment = "linux" -
const ComputerUsePreviewToolEnvironmentUbuntu ComputerUsePreviewToolEnvironment = "ubuntu" -
const ComputerUsePreviewToolEnvironmentBrowser ComputerUsePreviewToolEnvironment = "browser"
-
-
Type ComputerUsePreviewThe type of the computer use tool. Always
computer_use_preview.const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"
-
-
type WebSearchTool struct{…}Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
Type WebSearchToolTypeThe type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
const WebSearchToolTypeWebSearch WebSearchToolType = "web_search" -
const WebSearchToolTypeWebSearch2025_08_26 WebSearchToolType = "web_search_2025_08_26"
-
-
Filters WebSearchToolFiltersFilters for the search.
-
AllowedDomains []stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
SearchContextSize WebSearchToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchToolSearchContextSizeLow WebSearchToolSearchContextSize = "low" -
const WebSearchToolSearchContextSizeMedium WebSearchToolSearchContextSize = "medium" -
const WebSearchToolSearchContextSizeHigh WebSearchToolSearchContextSize = "high"
-
-
UserLocation WebSearchToolUserLocationThe approximate location of the user.
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
Type stringThe type of location approximation. Always
approximate.const WebSearchToolUserLocationTypeApproximate WebSearchToolUserLocationType = "approximate"
-
-
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
ServerLabel stringA label for this MCP server, used to identify it in tool calls.
-
Type McpThe type of the MCP tool. Always
mcp.const McpMcp Mcp = "mcp"
-
AllowedTools ToolMcpAllowedToolsUnionList of allowed tool names or a filter object.
-
type ToolMcpAllowedToolsMcpAllowedTools []stringA string array of allowed tool names
-
type ToolMcpAllowedToolsMcpToolFilter struct{…}A filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
Authorization stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
ConnectorID stringIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
const ToolMcpConnectorIDConnectorDropbox ToolMcpConnectorID = "connector_dropbox" -
const ToolMcpConnectorIDConnectorGmail ToolMcpConnectorID = "connector_gmail" -
const ToolMcpConnectorIDConnectorGooglecalendar ToolMcpConnectorID = "connector_googlecalendar" -
const ToolMcpConnectorIDConnectorGoogledrive ToolMcpConnectorID = "connector_googledrive" -
const ToolMcpConnectorIDConnectorMicrosoftteams ToolMcpConnectorID = "connector_microsoftteams" -
const ToolMcpConnectorIDConnectorOutlookcalendar ToolMcpConnectorID = "connector_outlookcalendar" -
const ToolMcpConnectorIDConnectorOutlookemail ToolMcpConnectorID = "connector_outlookemail" -
const ToolMcpConnectorIDConnectorSharepoint ToolMcpConnectorID = "connector_sharepoint"
-
-
DeferLoading boolWhether this MCP tool is deferred and discovered via tool search.
-
Headers map[string, string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
RequireApproval ToolMcpRequireApprovalUnionSpecify which of the MCP server's tools require approval.
-
type ToolMcpRequireApprovalMcpToolApprovalFilter 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.-
Always ToolMcpRequireApprovalMcpToolApprovalFilterAlwaysA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
Never ToolMcpRequireApprovalMcpToolApprovalFilterNeverA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
type ToolMcpRequireApprovalMcpToolApprovalSetting stringSpecify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
const ToolMcpRequireApprovalMcpToolApprovalSettingAlways ToolMcpRequireApprovalMcpToolApprovalSetting = "always" -
const ToolMcpRequireApprovalMcpToolApprovalSettingNever ToolMcpRequireApprovalMcpToolApprovalSetting = "never"
-
-
-
ServerDescription stringOptional description of the MCP server, used to provide more context.
-
ServerURL stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
TunnelID stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
Container ToolCodeInterpreterContainerUnionThe code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
string -
type ToolCodeInterpreterContainerCodeInterpreterContainerAuto struct{…}Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
Type AutoAlways
auto.const AutoAuto Auto = "auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit stringThe memory limit for the code interpreter container.
-
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"
-
-
NetworkPolicy ToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…}-
Type DisabledDisable outbound network access. Always
disabled.const DisabledDisabled Disabled = "disabled"
-
-
type ContainerNetworkPolicyAllowlist struct{…}-
AllowedDomains []stringA list of allowed domains when type is
allowlist. -
Type AllowlistAllow outbound network access only to specified domains. Always
allowlist.const AllowlistAllowlist Allowlist = "allowlist"
-
DomainSecrets []ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
Domain stringThe domain associated with the secret.
-
Name stringThe name of the secret to inject for the domain.
-
Value stringThe secret value to inject for the domain.
-
-
-
-
-
-
Type CodeInterpreterThe type of the code interpreter tool. Always
code_interpreter.const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"
-
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
Type ImageGenerationThe type of the image generation tool. Always
image_generation.const ImageGenerationImageGeneration ImageGeneration = "image_generation"
-
Action stringWhether to generate a new image or edit an existing image. Default:
auto.-
const ToolImageGenerationActionGenerate ToolImageGenerationAction = "generate" -
const ToolImageGenerationActionEdit ToolImageGenerationAction = "edit" -
const ToolImageGenerationActionAuto ToolImageGenerationAction = "auto"
-
-
Background stringAllows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
const ToolImageGenerationBackgroundTransparent ToolImageGenerationBackground = "transparent" -
const ToolImageGenerationBackgroundOpaque ToolImageGenerationBackground = "opaque" -
const ToolImageGenerationBackgroundAuto ToolImageGenerationBackground = "auto"
-
-
InputFidelity stringControl how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
const ToolImageGenerationInputFidelityHigh ToolImageGenerationInputFidelity = "high" -
const ToolImageGenerationInputFidelityLow ToolImageGenerationInputFidelity = "low"
-
-
InputImageMask ToolImageGenerationInputImageMaskOptional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
FileID stringFile ID for the mask image.
-
ImageURL stringBase64-encoded mask image.
-
-
Model stringThe image generation model to use. Default:
gpt-image-1.-
string -
string-
const ToolImageGenerationModelGPTImage1 ToolImageGenerationModel = "gpt-image-1" -
const ToolImageGenerationModelGPTImage1Mini ToolImageGenerationModel = "gpt-image-1-mini" -
const ToolImageGenerationModelGPTImage2 ToolImageGenerationModel = "gpt-image-2" -
const ToolImageGenerationModelGPTImage2_2026_04_21 ToolImageGenerationModel = "gpt-image-2-2026-04-21" -
const ToolImageGenerationModelGPTImage1_5 ToolImageGenerationModel = "gpt-image-1.5" -
const ToolImageGenerationModelChatgptImageLatest ToolImageGenerationModel = "chatgpt-image-latest"
-
-
-
Moderation stringModeration level for the generated image. Default:
auto.-
const ToolImageGenerationModerationAuto ToolImageGenerationModeration = "auto" -
const ToolImageGenerationModerationLow ToolImageGenerationModeration = "low"
-
-
OutputCompression int64Compression level for the output image. Default: 100.
-
OutputFormat stringThe output format of the generated image. One of
png,webp, orjpeg. Default:png.-
const ToolImageGenerationOutputFormatPNG ToolImageGenerationOutputFormat = "png" -
const ToolImageGenerationOutputFormatWebP ToolImageGenerationOutputFormat = "webp" -
const ToolImageGenerationOutputFormatJPEG ToolImageGenerationOutputFormat = "jpeg"
-
-
PartialImages int64Number of partial images to generate in streaming mode, from 0 (default value) to 3.
-
Quality stringThe quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
const ToolImageGenerationQualityLow ToolImageGenerationQuality = "low" -
const ToolImageGenerationQualityMedium ToolImageGenerationQuality = "medium" -
const ToolImageGenerationQualityHigh ToolImageGenerationQuality = "high" -
const ToolImageGenerationQualityAuto ToolImageGenerationQuality = "auto"
-
-
Size stringThe size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
string -
string-
const ToolImageGenerationSize1024x1024 ToolImageGenerationSize = "1024x1024" -
const ToolImageGenerationSize1024x1536 ToolImageGenerationSize = "1024x1536" -
const ToolImageGenerationSize1536x1024 ToolImageGenerationSize = "1536x1024" -
const ToolImageGenerationSizeAuto ToolImageGenerationSize = "auto"
-
-
-
-
type ToolLocalShell struct{…}A tool that allows the model to execute shell commands in a local environment.
-
Type LocalShellThe type of the local shell tool. Always
local_shell.const LocalShellLocalShell LocalShell = "local_shell"
-
-
type FunctionShellTool struct{…}A tool that allows the model to execute shell commands.
-
Type ShellThe type of the shell tool. Always
shell.const ShellShell Shell = "shell"
-
Environment FunctionShellToolEnvironmentUnion-
type ContainerAuto struct{…}-
Type ContainerAutoAutomatically creates a container for this request
const ContainerAutoContainerAuto ContainerAuto = "container_auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit ContainerAutoMemoryLimitThe memory limit for the container.
-
const ContainerAutoMemoryLimit1g ContainerAutoMemoryLimit = "1g" -
const ContainerAutoMemoryLimit4g ContainerAutoMemoryLimit = "4g" -
const ContainerAutoMemoryLimit16g ContainerAutoMemoryLimit = "16g" -
const ContainerAutoMemoryLimit64g ContainerAutoMemoryLimit = "64g"
-
-
NetworkPolicy ContainerAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…} -
type ContainerNetworkPolicyAllowlist struct{…}
-
-
Skills []ContainerAutoSkillUnionAn optional list of skills referenced by id or inline data.
-
type SkillReference struct{…}-
SkillID stringThe ID of the referenced skill.
-
Type SkillReferenceReferences a skill created with the /v1/skills endpoint.
const SkillReferenceSkillReference SkillReference = "skill_reference"
-
Version stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
type InlineSkill struct{…}-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Source InlineSkillSourceInline skill payload
-
Data stringBase64-encoded skill zip bundle.
-
MediaType ApplicationZipThe media type of the inline skill payload. Must be
application/zip.const ApplicationZipApplicationZip ApplicationZip = "application/zip"
-
Type Base64The type of the inline skill source. Must be
base64.const Base64Base64 Base64 = "base64"
-
-
Type InlineDefines an inline skill for this request.
const InlineInline Inline = "inline"
-
-
-
-
type LocalEnvironment struct{…}-
Type LocalUse a local computer environment.
const LocalLocal Local = "local"
-
Skills []LocalSkillAn optional list of skills.
-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Path stringThe path to the directory containing the skill.
-
-
-
type ContainerReference struct{…}-
ContainerID stringThe ID of the referenced container.
-
Type ContainerReferenceReferences a container created with the /v1/containers endpoint
const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
Name stringThe name of the custom tool, used to identify it in tool calls.
-
Type CustomThe type of the custom tool. Always
custom.const CustomCustom Custom = "custom"
-
DeferLoading boolWhether this tool should be deferred and discovered via tool search.
-
Description stringOptional description of the custom tool, used to provide more context.
-
Format CustomToolInputFormatUnionThe input format for the custom tool. Default is unconstrained text.
-
type CustomToolInputFormatText struct{…}Unconstrained free-form text.
-
Type TextUnconstrained text format. Always
text.const TextText Text = "text"
-
-
type CustomToolInputFormatGrammar struct{…}A grammar defined by the user.
-
Definition stringThe grammar definition.
-
Syntax stringThe syntax of the grammar definition. One of
larkorregex.-
const CustomToolInputFormatGrammarSyntaxLark CustomToolInputFormatGrammarSyntax = "lark" -
const CustomToolInputFormatGrammarSyntaxRegex CustomToolInputFormatGrammarSyntax = "regex"
-
-
Type GrammarGrammar format. Always
grammar.const GrammarGrammar Grammar = "grammar"
-
-
-
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
Description stringA description of the namespace shown to the model.
-
Name stringThe namespace name used in tool calls (for example,
crm). -
Tools []NamespaceToolToolUnionThe function/custom tools available inside this namespace.
-
type NamespaceToolToolFunction struct{…}-
Name string -
Type Functionconst FunctionFunction Function = "function"
-
DeferLoading boolWhether this function should be deferred and discovered via tool search.
-
Description string -
Parameters any -
Strict bool
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
-
Type NamespaceThe type of the tool. Always
namespace.const NamespaceNamespace Namespace = "namespace"
-
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
Type ToolSearchThe type of the tool. Always
tool_search.const ToolSearchToolSearch ToolSearch = "tool_search"
-
Description stringDescription shown to the model for a client-executed tool search tool.
-
Execution ToolSearchToolExecutionWhether tool search is executed by the server or by the client.
-
const ToolSearchToolExecutionServer ToolSearchToolExecution = "server" -
const ToolSearchToolExecutionClient ToolSearchToolExecution = "client"
-
-
Parameters anyParameter schema for a client-executed tool search tool.
-
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
Type WebSearchPreviewToolTypeThe type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
const WebSearchPreviewToolTypeWebSearchPreview WebSearchPreviewToolType = "web_search_preview" -
const WebSearchPreviewToolTypeWebSearchPreview2025_03_11 WebSearchPreviewToolType = "web_search_preview_2025_03_11"
-
-
SearchContentTypes []string-
const WebSearchPreviewToolSearchContentTypeText WebSearchPreviewToolSearchContentType = "text" -
const WebSearchPreviewToolSearchContentTypeImage WebSearchPreviewToolSearchContentType = "image"
-
-
SearchContextSize WebSearchPreviewToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchPreviewToolSearchContextSizeLow WebSearchPreviewToolSearchContextSize = "low" -
const WebSearchPreviewToolSearchContextSizeMedium WebSearchPreviewToolSearchContextSize = "medium" -
const WebSearchPreviewToolSearchContextSizeHigh WebSearchPreviewToolSearchContextSize = "high"
-
-
UserLocation WebSearchPreviewToolUserLocationThe user's location.
-
Type ApproximateThe type of location approximation. Always
approximate.const ApproximateApproximate Approximate = "approximate"
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
Type ApplyPatchThe type of the tool. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
-
Type ToolSearchOutputThe type of the item. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseItemAdditionalTools struct{…}-
ID stringThe unique ID of the additional tools item.
-
Role stringThe role that provided the additional tools.
-
const ResponseItemAdditionalToolsRoleUnknown ResponseItemAdditionalToolsRole = "unknown" -
const ResponseItemAdditionalToolsRoleUser ResponseItemAdditionalToolsRole = "user" -
const ResponseItemAdditionalToolsRoleAssistant ResponseItemAdditionalToolsRole = "assistant" -
const ResponseItemAdditionalToolsRoleSystem ResponseItemAdditionalToolsRole = "system" -
const ResponseItemAdditionalToolsRoleCritic ResponseItemAdditionalToolsRole = "critic" -
const ResponseItemAdditionalToolsRoleDiscriminator ResponseItemAdditionalToolsRole = "discriminator" -
const ResponseItemAdditionalToolsRoleDeveloper ResponseItemAdditionalToolsRole = "developer" -
const ResponseItemAdditionalToolsRoleTool ResponseItemAdditionalToolsRole = "tool"
-
-
Tools []ToolUnionThe additional tool definitions made available at this item.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type AdditionalToolsThe type of the item. Always
additional_tools.const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"
-
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
ID stringThe unique identifier of the reasoning content.
-
Summary []ResponseReasoningItemSummaryReasoning summary content.
-
Text stringA summary of the reasoning output from the model so far.
-
Type SummaryTextThe type of the object. Always
summary_text.const SummaryTextSummaryText SummaryText = "summary_text"
-
-
Type ReasoningThe type of the object. Always
reasoning.const ReasoningReasoning Reasoning = "reasoning"
-
Content []ResponseReasoningItemContentReasoning text content.
-
Text stringThe reasoning text from the model.
-
Type ReasoningTextThe type of the reasoning text. Always
reasoning_text.const ReasoningTextReasoningText ReasoningText = "reasoning_text"
-
-
EncryptedContent stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
Status ResponseReasoningItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseReasoningItemStatusInProgress ResponseReasoningItemStatus = "in_progress" -
const ResponseReasoningItemStatusCompleted ResponseReasoningItemStatus = "completed" -
const ResponseReasoningItemStatusIncomplete ResponseReasoningItemStatus = "incomplete"
-
-
-
type ResponseCompactionItem struct{…}A compaction item generated by the
v1/responses/compactAPI.-
ID stringThe unique ID of the compaction item.
-
EncryptedContent stringThe encrypted content that was produced by compaction.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseItemImageGenerationCall struct{…}An image generation request made by the model.
-
ID stringThe unique ID of the image generation call.
-
Result stringThe generated image encoded in base64.
-
Status stringThe status of the image generation call.
-
const ResponseItemImageGenerationCallStatusInProgress ResponseItemImageGenerationCallStatus = "in_progress" -
const ResponseItemImageGenerationCallStatusCompleted ResponseItemImageGenerationCallStatus = "completed" -
const ResponseItemImageGenerationCallStatusGenerating ResponseItemImageGenerationCallStatus = "generating" -
const ResponseItemImageGenerationCallStatusFailed ResponseItemImageGenerationCallStatus = "failed"
-
-
Type ImageGenerationCallThe type of the image generation call. Always
image_generation_call.const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"
-
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
ID stringThe unique ID of the code interpreter tool call.
-
Code stringThe code to run, or null if not available.
-
ContainerID stringThe ID of the container used to run the code.
-
Outputs []ResponseCodeInterpreterToolCallOutputUnionThe outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
type ResponseCodeInterpreterToolCallOutputLogs struct{…}The logs output from the code interpreter.
-
Logs stringThe logs output from the code interpreter.
-
Type LogsThe type of the output. Always
logs.const LogsLogs Logs = "logs"
-
-
type ResponseCodeInterpreterToolCallOutputImage struct{…}The image output from the code interpreter.
-
Type ImageThe type of the output. Always
image.const ImageImage Image = "image"
-
URL stringThe URL of the image output from the code interpreter.
-
-
-
Status ResponseCodeInterpreterToolCallStatusThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
const ResponseCodeInterpreterToolCallStatusInProgress ResponseCodeInterpreterToolCallStatus = "in_progress" -
const ResponseCodeInterpreterToolCallStatusCompleted ResponseCodeInterpreterToolCallStatus = "completed" -
const ResponseCodeInterpreterToolCallStatusIncomplete ResponseCodeInterpreterToolCallStatus = "incomplete" -
const ResponseCodeInterpreterToolCallStatusInterpreting ResponseCodeInterpreterToolCallStatus = "interpreting" -
const ResponseCodeInterpreterToolCallStatusFailed ResponseCodeInterpreterToolCallStatus = "failed"
-
-
Type CodeInterpreterCallThe type of the code interpreter tool call. Always
code_interpreter_call.const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"
-
-
type ResponseItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
ID stringThe unique ID of the local shell call.
-
Action ResponseItemLocalShellCallActionExecute a shell command on the server.
-
Command []stringThe command to run.
-
Env map[string, string]Environment variables to set for the command.
-
Type ExecThe type of the local shell action. Always
exec.const ExecExec Exec = "exec"
-
TimeoutMs int64Optional timeout in milliseconds for the command.
-
User stringOptional user to run the command as.
-
WorkingDirectory stringOptional working directory to run the command in.
-
-
CallID stringThe unique ID of the local shell tool call generated by the model.
-
Status stringThe status of the local shell call.
-
const ResponseItemLocalShellCallStatusInProgress ResponseItemLocalShellCallStatus = "in_progress" -
const ResponseItemLocalShellCallStatusCompleted ResponseItemLocalShellCallStatus = "completed" -
const ResponseItemLocalShellCallStatusIncomplete ResponseItemLocalShellCallStatus = "incomplete"
-
-
Type LocalShellCallThe type of the local shell call. Always
local_shell_call.const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"
-
-
type ResponseItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
ID stringThe unique ID of the local shell tool call generated by the model.
-
Output stringA JSON string of the output of the local shell tool call.
-
Type LocalShellCallOutputThe type of the local shell tool call output. Always
local_shell_call_output.const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete.-
const ResponseItemLocalShellCallOutputStatusInProgress ResponseItemLocalShellCallOutputStatus = "in_progress" -
const ResponseItemLocalShellCallOutputStatusCompleted ResponseItemLocalShellCallOutputStatus = "completed" -
const ResponseItemLocalShellCallOutputStatusIncomplete ResponseItemLocalShellCallOutputStatus = "incomplete"
-
-
-
type ResponseFunctionShellToolCall struct{…}A tool call that executes one or more shell commands in a managed environment.
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Action ResponseFunctionShellToolCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []string -
MaxOutputLength int64Optional maximum number of characters to return from each command.
-
TimeoutMs int64Optional timeout in milliseconds for the commands.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Environment ResponseFunctionShellToolCallEnvironmentUnionRepresents the use of a local environment to perform shell actions.
-
type ResponseLocalEnvironment struct{…}Represents the use of a local environment to perform shell actions.
-
Type LocalThe environment type. Always
local.const LocalLocal Local = "local"
-
-
type ResponseContainerReference struct{…}Represents a container created with /v1/containers.
-
ContainerID string -
Type ContainerReferenceThe environment type. Always
container_reference.const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
Status ResponseFunctionShellToolCallStatusThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallStatusInProgress ResponseFunctionShellToolCallStatus = "in_progress" -
const ResponseFunctionShellToolCallStatusCompleted ResponseFunctionShellToolCallStatus = "completed" -
const ResponseFunctionShellToolCallStatusIncomplete ResponseFunctionShellToolCallStatus = "incomplete"
-
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseFunctionShellToolCallOutput struct{…}The output of a shell tool call that was emitted.
-
ID stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
MaxOutputLength int64The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
Output []ResponseFunctionShellToolCallOutputOutputAn array of shell call output contents
-
Outcome ResponseFunctionShellToolCallOutputOutputOutcomeUnionRepresents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
type ResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64Exit code from the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringThe standard error output that was captured.
-
Stdout stringThe standard output that was captured.
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
Status ResponseFunctionShellToolCallOutputStatusThe status of the shell call output. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallOutputStatusInProgress ResponseFunctionShellToolCallOutputStatus = "in_progress" -
const ResponseFunctionShellToolCallOutputStatusCompleted ResponseFunctionShellToolCallOutputStatus = "completed" -
const ResponseFunctionShellToolCallOutputStatusIncomplete ResponseFunctionShellToolCallOutputStatus = "incomplete"
-
-
Type ShellCallOutputThe type of the shell call output. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseApplyPatchToolCall struct{…}A tool call that applies file diffs by creating, deleting, or updating files.
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseApplyPatchToolCallOperationUnionOne of the create_file, delete_file, or update_file operations applied via apply_patch.
-
type ResponseApplyPatchToolCallOperationCreateFile struct{…}Instruction describing how to create a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to create.
-
Type CreateFileCreate a new file with the provided diff.
const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseApplyPatchToolCallOperationDeleteFile struct{…}Instruction describing how to delete a file via the apply_patch tool.
-
Path stringPath of the file to delete.
-
Type DeleteFileDelete the specified file.
const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseApplyPatchToolCallOperationUpdateFile struct{…}Instruction describing how to update a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to update.
-
Type UpdateFileUpdate an existing file with the provided diff.
const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status ResponseApplyPatchToolCallStatusThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseApplyPatchToolCallStatusInProgress ResponseApplyPatchToolCallStatus = "in_progress" -
const ResponseApplyPatchToolCallStatusCompleted ResponseApplyPatchToolCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseApplyPatchToolCallOutput struct{…}The output emitted by an apply patch tool call.
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status ResponseApplyPatchToolCallOutputStatusThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseApplyPatchToolCallOutputStatusCompleted ResponseApplyPatchToolCallOutputStatus = "completed" -
const ResponseApplyPatchToolCallOutputStatusFailed ResponseApplyPatchToolCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
CreatedBy stringThe ID of the entity that created this tool call output.
-
Output stringOptional textual output returned by the apply patch tool.
-
-
type ResponseItemMcpListTools struct{…}A list of tools available on an MCP server.
-
ID stringThe unique ID of the list.
-
ServerLabel stringThe label of the MCP server.
-
Tools []ResponseItemMcpListToolsToolThe tools available on the server.
-
InputSchema anyThe JSON schema describing the tool's input.
-
Name stringThe name of the tool.
-
Annotations anyAdditional annotations about the tool.
-
Description stringThe description of the tool.
-
-
Type McpListToolsThe type of the item. Always
mcp_list_tools.const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
-
Error stringError message if the server could not list tools.
-
-
type ResponseItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
ID stringThe unique ID of the approval request.
-
Arguments stringA JSON string of arguments for the tool.
-
Name stringThe name of the tool to run.
-
ServerLabel stringThe label of the MCP server making the request.
-
Type McpApprovalRequestThe type of the item. Always
mcp_approval_request.const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"
-
-
type ResponseItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
ID stringThe unique ID of the approval response
-
ApprovalRequestID stringThe ID of the approval request being answered.
-
Approve boolWhether the request was approved.
-
Type McpApprovalResponseThe type of the item. Always
mcp_approval_response.const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
-
Reason stringOptional reason for the decision.
-
-
type ResponseItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
ID stringThe unique ID of the tool call.
-
Arguments stringA JSON string of the arguments passed to the tool.
-
Name stringThe name of the tool that was run.
-
ServerLabel stringThe label of the MCP server running the tool.
-
Type McpCallThe type of the item. Always
mcp_call.const McpCallMcpCall McpCall = "mcp_call"
-
ApprovalRequestID stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
Error stringThe error from the tool call, if any.
-
Output stringThe output from the tool call.
-
Status stringThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
const ResponseItemMcpCallStatusInProgress ResponseItemMcpCallStatus = "in_progress" -
const ResponseItemMcpCallStatusCompleted ResponseItemMcpCallStatus = "completed" -
const ResponseItemMcpCallStatusIncomplete ResponseItemMcpCallStatus = "incomplete" -
const ResponseItemMcpCallStatusCalling ResponseItemMcpCallStatus = "calling" -
const ResponseItemMcpCallStatusFailed ResponseItemMcpCallStatus = "failed"
-
-
-
type ResponseCustomToolCallItem struct{…}A call to a custom tool created by the model.
-
ID stringThe unique ID of the custom tool call item.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseCustomToolCallItemStatusInProgress ResponseCustomToolCallItemStatus = "in_progress" -
const ResponseCustomToolCallItemStatusCompleted ResponseCustomToolCallItemStatus = "completed" -
const ResponseCustomToolCallItemStatusIncomplete ResponseCustomToolCallItemStatus = "incomplete"
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseCustomToolCallOutputItem struct{…}The output of a custom tool call from your code, being sent back to the model.
-
ID stringThe unique ID of the custom tool call output item.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseCustomToolCallOutputItemStatusInProgress ResponseCustomToolCallOutputItemStatus = "in_progress" -
const ResponseCustomToolCallOutputItemStatusCompleted ResponseCustomToolCallOutputItemStatus = "completed" -
const ResponseCustomToolCallOutputItemStatusIncomplete ResponseCustomToolCallOutputItemStatus = "incomplete"
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
Response Local Environment
-
type ResponseLocalEnvironment struct{…}Represents the use of a local environment to perform shell actions.
-
Type LocalThe environment type. Always
local.const LocalLocal Local = "local"
-
Response Mcp Call Arguments Delta Event
-
type ResponseMcpCallArgumentsDeltaEvent struct{…}Emitted when there is a delta (partial update) to the arguments of an MCP tool call.
-
Delta stringA JSON string containing the partial update to the arguments for the MCP tool call.
-
ItemID stringThe unique identifier of the MCP tool call item being processed.
-
OutputIndex int64The index of the output item in the response's output array.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseMcpCallArgumentsDeltaThe type of the event. Always 'response.mcp_call_arguments.delta'.
const ResponseMcpCallArgumentsDeltaResponseMcpCallArgumentsDelta ResponseMcpCallArgumentsDelta = "response.mcp_call_arguments.delta"
-
Response Mcp Call Arguments Done Event
-
type ResponseMcpCallArgumentsDoneEvent struct{…}Emitted when the arguments for an MCP tool call are finalized.
-
Arguments stringA JSON string containing the finalized arguments for the MCP tool call.
-
ItemID stringThe unique identifier of the MCP tool call item being processed.
-
OutputIndex int64The index of the output item in the response's output array.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseMcpCallArgumentsDoneThe type of the event. Always 'response.mcp_call_arguments.done'.
const ResponseMcpCallArgumentsDoneResponseMcpCallArgumentsDone ResponseMcpCallArgumentsDone = "response.mcp_call_arguments.done"
-
Response Mcp Call Completed Event
-
type ResponseMcpCallCompletedEvent struct{…}Emitted when an MCP tool call has completed successfully.
-
ItemID stringThe ID of the MCP tool call item that completed.
-
OutputIndex int64The index of the output item that completed.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseMcpCallCompletedThe type of the event. Always 'response.mcp_call.completed'.
const ResponseMcpCallCompletedResponseMcpCallCompleted ResponseMcpCallCompleted = "response.mcp_call.completed"
-
Response Mcp Call Failed Event
-
type ResponseMcpCallFailedEvent struct{…}Emitted when an MCP tool call has failed.
-
ItemID stringThe ID of the MCP tool call item that failed.
-
OutputIndex int64The index of the output item that failed.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseMcpCallFailedThe type of the event. Always 'response.mcp_call.failed'.
const ResponseMcpCallFailedResponseMcpCallFailed ResponseMcpCallFailed = "response.mcp_call.failed"
-
Response Mcp Call In Progress Event
-
type ResponseMcpCallInProgressEvent struct{…}Emitted when an MCP tool call is in progress.
-
ItemID stringThe unique identifier of the MCP tool call item being processed.
-
OutputIndex int64The index of the output item in the response's output array.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseMcpCallInProgressThe type of the event. Always 'response.mcp_call.in_progress'.
const ResponseMcpCallInProgressResponseMcpCallInProgress ResponseMcpCallInProgress = "response.mcp_call.in_progress"
-
Response Mcp List Tools Completed Event
-
type ResponseMcpListToolsCompletedEvent struct{…}Emitted when the list of available MCP tools has been successfully retrieved.
-
ItemID stringThe ID of the MCP tool call item that produced this output.
-
OutputIndex int64The index of the output item that was processed.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseMcpListToolsCompletedThe type of the event. Always 'response.mcp_list_tools.completed'.
const ResponseMcpListToolsCompletedResponseMcpListToolsCompleted ResponseMcpListToolsCompleted = "response.mcp_list_tools.completed"
-
Response Mcp List Tools Failed Event
-
type ResponseMcpListToolsFailedEvent struct{…}Emitted when the attempt to list available MCP tools has failed.
-
ItemID stringThe ID of the MCP tool call item that failed.
-
OutputIndex int64The index of the output item that failed.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseMcpListToolsFailedThe type of the event. Always 'response.mcp_list_tools.failed'.
const ResponseMcpListToolsFailedResponseMcpListToolsFailed ResponseMcpListToolsFailed = "response.mcp_list_tools.failed"
-
Response Mcp List Tools In Progress Event
-
type ResponseMcpListToolsInProgressEvent struct{…}Emitted when the system is in the process of retrieving the list of available MCP tools.
-
ItemID stringThe ID of the MCP tool call item that is being processed.
-
OutputIndex int64The index of the output item that is being processed.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseMcpListToolsInProgressThe type of the event. Always 'response.mcp_list_tools.in_progress'.
const ResponseMcpListToolsInProgressResponseMcpListToolsInProgress ResponseMcpListToolsInProgress = "response.mcp_list_tools.in_progress"
-
Response Output Audio
-
type ResponseOutputAudio struct{…}An audio output from the model.
-
Data stringBase64-encoded audio data from the model.
-
Transcript stringThe transcript of the audio data from the model.
-
Type OutputAudioThe type of the output audio. Always
output_audio.const OutputAudioOutputAudio OutputAudio = "output_audio"
-
Response Output Item
-
type ResponseOutputItemUnion interface{…}An output message from the model.
-
type ResponseOutputMessage struct{…}An output message from the model.
-
ID stringThe unique ID of the output message.
-
Content []ResponseOutputMessageContentUnionThe content of the output message.
-
type ResponseOutputText struct{…}A text output from the model.
-
Annotations []ResponseOutputTextAnnotationUnionThe annotations of the text output.
-
type ResponseOutputTextAnnotationFileCitation struct{…}A citation to a file.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the file cited.
-
Index int64The index of the file in the list of files.
-
Type FileCitationThe type of the file citation. Always
file_citation.const FileCitationFileCitation FileCitation = "file_citation"
-
-
type ResponseOutputTextAnnotationURLCitation struct{…}A citation for a web resource used to generate a model response.
-
EndIndex int64The index of the last character of the URL citation in the message.
-
StartIndex int64The index of the first character of the URL citation in the message.
-
Title stringThe title of the web resource.
-
Type URLCitationThe type of the URL citation. Always
url_citation.const URLCitationURLCitation URLCitation = "url_citation"
-
URL stringThe URL of the web resource.
-
-
type ResponseOutputTextAnnotationContainerFileCitation struct{…}A citation for a container file used to generate a model response.
-
ContainerID stringThe ID of the container file.
-
EndIndex int64The index of the last character of the container file citation in the message.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the container file cited.
-
StartIndex int64The index of the first character of the container file citation in the message.
-
Type ContainerFileCitationThe type of the container file citation. Always
container_file_citation.const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"
-
-
type ResponseOutputTextAnnotationFilePath struct{…}A path to a file.
-
FileID stringThe ID of the file.
-
Index int64The index of the file in the list of files.
-
Type FilePathThe type of the file path. Always
file_path.const FilePathFilePath FilePath = "file_path"
-
-
-
Text stringThe text output from the model.
-
Type OutputTextThe type of the output text. Always
output_text.const OutputTextOutputText OutputText = "output_text"
-
Logprobs []ResponseOutputTextLogprob-
Token string -
Bytes []int64 -
Logprob float64 -
TopLogprobs []ResponseOutputTextLogprobTopLogprob-
Token string -
Bytes []int64 -
Logprob float64
-
-
-
-
type ResponseOutputRefusal struct{…}A refusal from the model.
-
Refusal stringThe refusal explanation from the model.
-
Type RefusalThe type of the refusal. Always
refusal.const RefusalRefusal Refusal = "refusal"
-
-
-
Role AssistantThe role of the output message. Always
assistant.const AssistantAssistant Assistant = "assistant"
-
Status ResponseOutputMessageStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseOutputMessageStatusInProgress ResponseOutputMessageStatus = "in_progress" -
const ResponseOutputMessageStatusCompleted ResponseOutputMessageStatus = "completed" -
const ResponseOutputMessageStatusIncomplete ResponseOutputMessageStatus = "incomplete"
-
-
Type MessageThe type of the output message. Always
message.const MessageMessage Message = "message"
-
Phase ResponseOutputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const ResponseOutputMessagePhaseCommentary ResponseOutputMessagePhase = "commentary" -
const ResponseOutputMessagePhaseFinalAnswer ResponseOutputMessagePhase = "final_answer"
-
-
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
ID stringThe unique ID of the file search tool call.
-
Queries []stringThe queries used to search for files.
-
Status ResponseFileSearchToolCallStatusThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
const ResponseFileSearchToolCallStatusInProgress ResponseFileSearchToolCallStatus = "in_progress" -
const ResponseFileSearchToolCallStatusSearching ResponseFileSearchToolCallStatus = "searching" -
const ResponseFileSearchToolCallStatusCompleted ResponseFileSearchToolCallStatus = "completed" -
const ResponseFileSearchToolCallStatusIncomplete ResponseFileSearchToolCallStatus = "incomplete" -
const ResponseFileSearchToolCallStatusFailed ResponseFileSearchToolCallStatus = "failed"
-
-
Type FileSearchCallThe type of the file search tool call. Always
file_search_call.const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"
-
Results []ResponseFileSearchToolCallResultThe results of the file search tool call.
-
Attributes map[string, ResponseFileSearchToolCallResultAttributeUnion]Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.
-
string -
float64 -
bool
-
-
FileID stringThe unique ID of the file.
-
Filename stringThe name of the file.
-
Score float64The relevance score of the file - a value between 0 and 1.
-
Text stringThe text that was retrieved from the file.
-
-
-
type ResponseFunctionToolCall struct{…}A tool call to run a function. See the function calling guide for more information.
-
Arguments stringA JSON string of the arguments to pass to the function.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Name stringThe name of the function to run.
-
Type FunctionCallThe type of the function tool call. Always
function_call.const FunctionCallFunctionCall FunctionCall = "function_call"
-
ID stringThe unique ID of the function tool call.
-
Namespace stringThe namespace of the function to run.
-
Status ResponseFunctionToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallStatusInProgress ResponseFunctionToolCallStatus = "in_progress" -
const ResponseFunctionToolCallStatusCompleted ResponseFunctionToolCallStatus = "completed" -
const ResponseFunctionToolCallStatusIncomplete ResponseFunctionToolCallStatus = "incomplete"
-
-
-
type ResponseFunctionToolCallOutputItem struct{…}-
ID stringThe unique ID of the function call tool output.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseFunctionToolCallOutputItemOutputUnionThe output from the function call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseFunctionToolCallOutputItemOutputOutputContentList []ResponseFunctionToolCallOutputItemOutputOutputContentListItemUnionText, image, or file output of the function call.
-
type ResponseInputText struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
Detail ResponseInputImageDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageDetailLow ResponseInputImageDetail = "low" -
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high" -
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto" -
const ResponseInputImageDetailOriginal ResponseInputImageDetail = "original"
-
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFile struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileDetailLow ResponseInputFileDetail = "low" -
const ResponseInputFileDetailHigh ResponseInputFileDetail = "high"
-
-
FileData stringThe content of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Status ResponseFunctionToolCallOutputItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallOutputItemStatusInProgress ResponseFunctionToolCallOutputItemStatus = "in_progress" -
const ResponseFunctionToolCallOutputItemStatusCompleted ResponseFunctionToolCallOutputItemStatus = "completed" -
const ResponseFunctionToolCallOutputItemStatusIncomplete ResponseFunctionToolCallOutputItemStatus = "incomplete"
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
ID stringThe unique ID of the web search tool call.
-
Action ResponseFunctionWebSearchActionUnionAn object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
type ResponseFunctionWebSearchActionSearch struct{…}Action type "search" - Performs a web search query.
-
Type SearchThe action type.
const SearchSearch Search = "search"
-
Queries []stringThe search queries.
-
Query stringThe search query.
-
Sources []ResponseFunctionWebSearchActionSearchSourceThe sources used in the search.
-
Type URLThe type of source. Always
url.const URLURL URL = "url"
-
URL stringThe URL of the source.
-
-
-
type ResponseFunctionWebSearchActionOpenPage struct{…}Action type "open_page" - Opens a specific URL from search results.
-
Type OpenPageThe action type.
const OpenPageOpenPage OpenPage = "open_page"
-
URL stringThe URL opened by the model.
-
-
type ResponseFunctionWebSearchActionFindInPage struct{…}Action type "find_in_page": Searches for a pattern within a loaded page.
-
Pattern stringThe pattern or text to search for within the page.
-
Type FindInPageThe action type.
const FindInPageFindInPage FindInPage = "find_in_page"
-
URL stringThe URL of the page searched for the pattern.
-
-
-
Status ResponseFunctionWebSearchStatusThe status of the web search tool call.
-
const ResponseFunctionWebSearchStatusInProgress ResponseFunctionWebSearchStatus = "in_progress" -
const ResponseFunctionWebSearchStatusSearching ResponseFunctionWebSearchStatus = "searching" -
const ResponseFunctionWebSearchStatusCompleted ResponseFunctionWebSearchStatus = "completed" -
const ResponseFunctionWebSearchStatusFailed ResponseFunctionWebSearchStatus = "failed"
-
-
Type WebSearchCallThe type of the web search tool call. Always
web_search_call.const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"
-
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
ID stringThe unique ID of the computer call.
-
CallID stringAn identifier used when responding to the tool call with output.
-
PendingSafetyChecks []ResponseComputerToolCallPendingSafetyCheckThe pending safety checks for the computer call.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status ResponseComputerToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseComputerToolCallStatusInProgress ResponseComputerToolCallStatus = "in_progress" -
const ResponseComputerToolCallStatusCompleted ResponseComputerToolCallStatus = "completed" -
const ResponseComputerToolCallStatusIncomplete ResponseComputerToolCallStatus = "incomplete"
-
-
Type ResponseComputerToolCallTypeThe type of the computer call. Always
computer_call.const ResponseComputerToolCallTypeComputerCall ResponseComputerToolCallType = "computer_call"
-
Action ResponseComputerToolCallActionUnionA click action.
-
type ResponseComputerToolCallActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ResponseComputerToolCallActionClickButtonLeft ResponseComputerToolCallActionClickButton = "left" -
const ResponseComputerToolCallActionClickButtonRight ResponseComputerToolCallActionClickButton = "right" -
const ResponseComputerToolCallActionClickButtonWheel ResponseComputerToolCallActionClickButton = "wheel" -
const ResponseComputerToolCallActionClickButtonBack ResponseComputerToolCallActionClickButton = "back" -
const ResponseComputerToolCallActionClickButtonForward ResponseComputerToolCallActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ResponseComputerToolCallActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ResponseComputerToolCallActionDrag struct{…}A drag action.
-
Path []ResponseComputerToolCallActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ResponseComputerToolCallActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ResponseComputerToolCallActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ResponseComputerToolCallActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ResponseComputerToolCallActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ResponseComputerToolCallActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ResponseComputerToolCallActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
Actions ComputerActionListFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
type ComputerActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ComputerActionClickButtonLeft ComputerActionClickButton = "left" -
const ComputerActionClickButtonRight ComputerActionClickButton = "right" -
const ComputerActionClickButtonWheel ComputerActionClickButton = "wheel" -
const ComputerActionClickButtonBack ComputerActionClickButton = "back" -
const ComputerActionClickButtonForward ComputerActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ComputerActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ComputerActionDrag struct{…}A drag action.
-
Path []ComputerActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ComputerActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ComputerActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ComputerActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ComputerActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ComputerActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ComputerActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
-
type ResponseComputerToolCallOutputItem struct{…}-
ID stringThe unique ID of the computer call tool output.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Type ComputerScreenshotSpecifies the event type. For a computer screenshot, this property is always set to
computer_screenshot.const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"
-
FileID stringThe identifier of an uploaded file that contains the screenshot.
-
ImageURL stringThe URL of the screenshot image.
-
-
Status ResponseComputerToolCallOutputItemStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseComputerToolCallOutputItemStatusCompleted ResponseComputerToolCallOutputItemStatus = "completed" -
const ResponseComputerToolCallOutputItemStatusIncomplete ResponseComputerToolCallOutputItemStatus = "incomplete" -
const ResponseComputerToolCallOutputItemStatusFailed ResponseComputerToolCallOutputItemStatus = "failed" -
const ResponseComputerToolCallOutputItemStatusInProgress ResponseComputerToolCallOutputItemStatus = "in_progress"
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
AcknowledgedSafetyChecks []ResponseComputerToolCallOutputItemAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
ID stringThe unique identifier of the reasoning content.
-
Summary []ResponseReasoningItemSummaryReasoning summary content.
-
Text stringA summary of the reasoning output from the model so far.
-
Type SummaryTextThe type of the object. Always
summary_text.const SummaryTextSummaryText SummaryText = "summary_text"
-
-
Type ReasoningThe type of the object. Always
reasoning.const ReasoningReasoning Reasoning = "reasoning"
-
Content []ResponseReasoningItemContentReasoning text content.
-
Text stringThe reasoning text from the model.
-
Type ReasoningTextThe type of the reasoning text. Always
reasoning_text.const ReasoningTextReasoningText ReasoningText = "reasoning_text"
-
-
EncryptedContent stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
Status ResponseReasoningItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseReasoningItemStatusInProgress ResponseReasoningItemStatus = "in_progress" -
const ResponseReasoningItemStatusCompleted ResponseReasoningItemStatus = "completed" -
const ResponseReasoningItemStatusIncomplete ResponseReasoningItemStatus = "incomplete"
-
-
-
type ResponseToolSearchCall struct{…}-
ID stringThe unique ID of the tool search call item.
-
Arguments anyArguments used for the tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchCallExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchCallExecutionServer ResponseToolSearchCallExecution = "server" -
const ResponseToolSearchCallExecutionClient ResponseToolSearchCallExecution = "client"
-
-
Status ResponseToolSearchCallStatusThe status of the tool search call item that was recorded.
-
const ResponseToolSearchCallStatusInProgress ResponseToolSearchCallStatus = "in_progress" -
const ResponseToolSearchCallStatusCompleted ResponseToolSearchCallStatus = "completed" -
const ResponseToolSearchCallStatusIncomplete ResponseToolSearchCallStatus = "incomplete"
-
-
Type ToolSearchCallThe type of the item. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseToolSearchOutputItem struct{…}-
ID stringThe unique ID of the tool search output item.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemExecutionServer ResponseToolSearchOutputItemExecution = "server" -
const ResponseToolSearchOutputItemExecutionClient ResponseToolSearchOutputItemExecution = "client"
-
-
Status ResponseToolSearchOutputItemStatusThe status of the tool search output item that was recorded.
-
const ResponseToolSearchOutputItemStatusInProgress ResponseToolSearchOutputItemStatus = "in_progress" -
const ResponseToolSearchOutputItemStatusCompleted ResponseToolSearchOutputItemStatus = "completed" -
const ResponseToolSearchOutputItemStatusIncomplete ResponseToolSearchOutputItemStatus = "incomplete"
-
-
Tools []ToolUnionThe loaded tool definitions returned by tool search.
-
type FunctionTool struct{…}Defines a function in your own code the model can choose to call. Learn more about function calling.
-
Name stringThe name of the function to call.
-
Parameters map[string, any]A JSON schema object describing the parameters of the function.
-
Strict boolWhether to enforce strict parameter validation. Default
true. -
Type FunctionThe type of the function tool. Always
function.const FunctionFunction Function = "function"
-
DeferLoading boolWhether this function is deferred and loaded via tool search.
-
Description stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
type FileSearchTool struct{…}A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
Type FileSearchThe type of the file search tool. Always
file_search.const FileSearchFileSearch FileSearch = "file_search"
-
VectorStoreIDs []stringThe IDs of the vector stores to search.
-
Filters FileSearchToolFiltersUnionA filter to apply.
-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
Key stringThe key to compare against the value.
-
Type ComparisonFilterTypeSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
const ComparisonFilterTypeEq ComparisonFilterType = "eq" -
const ComparisonFilterTypeNe ComparisonFilterType = "ne" -
const ComparisonFilterTypeGt ComparisonFilterType = "gt" -
const ComparisonFilterTypeGte ComparisonFilterType = "gte" -
const ComparisonFilterTypeLt ComparisonFilterType = "lt" -
const ComparisonFilterTypeLte ComparisonFilterType = "lte" -
const ComparisonFilterTypeIn ComparisonFilterType = "in" -
const ComparisonFilterTypeNin ComparisonFilterType = "nin"
-
-
Value ComparisonFilterValueUnionThe value to compare against the attribute key; supports string, number, or boolean types.
-
string -
float64 -
bool -
type ComparisonFilterValueArray []ComparisonFilterValueArrayItemUnion-
string -
float64
-
-
-
-
type CompoundFilter struct{…}Combine multiple filters using
andoror.-
Filters []ComparisonFilterArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
-
Type CompoundFilterTypeType of operation:
andoror.-
const CompoundFilterTypeAnd CompoundFilterType = "and" -
const CompoundFilterTypeOr CompoundFilterType = "or"
-
-
-
-
MaxNumResults int64The maximum number of results to return. This number should be between 1 and 50 inclusive.
-
RankingOptions FileSearchToolRankingOptionsRanking options for search.
-
HybridSearch FileSearchToolRankingOptionsHybridSearchWeights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
EmbeddingWeight float64The weight of the embedding in the reciprocal ranking fusion.
-
TextWeight float64The weight of the text in the reciprocal ranking fusion.
-
-
Ranker stringThe ranker to use for the file search.
-
const FileSearchToolRankingOptionsRankerAuto FileSearchToolRankingOptionsRanker = "auto" -
const FileSearchToolRankingOptionsRankerDefault2024_11_15 FileSearchToolRankingOptionsRanker = "default-2024-11-15"
-
-
ScoreThreshold float64The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
Type ComputerThe type of the computer tool. Always
computer.const ComputerComputer Computer = "computer"
-
-
type ComputerUsePreviewTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
DisplayHeight int64The height of the computer display.
-
DisplayWidth int64The width of the computer display.
-
Environment ComputerUsePreviewToolEnvironmentThe type of computer environment to control.
-
const ComputerUsePreviewToolEnvironmentWindows ComputerUsePreviewToolEnvironment = "windows" -
const ComputerUsePreviewToolEnvironmentMac ComputerUsePreviewToolEnvironment = "mac" -
const ComputerUsePreviewToolEnvironmentLinux ComputerUsePreviewToolEnvironment = "linux" -
const ComputerUsePreviewToolEnvironmentUbuntu ComputerUsePreviewToolEnvironment = "ubuntu" -
const ComputerUsePreviewToolEnvironmentBrowser ComputerUsePreviewToolEnvironment = "browser"
-
-
Type ComputerUsePreviewThe type of the computer use tool. Always
computer_use_preview.const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"
-
-
type WebSearchTool struct{…}Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
Type WebSearchToolTypeThe type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
const WebSearchToolTypeWebSearch WebSearchToolType = "web_search" -
const WebSearchToolTypeWebSearch2025_08_26 WebSearchToolType = "web_search_2025_08_26"
-
-
Filters WebSearchToolFiltersFilters for the search.
-
AllowedDomains []stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
SearchContextSize WebSearchToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchToolSearchContextSizeLow WebSearchToolSearchContextSize = "low" -
const WebSearchToolSearchContextSizeMedium WebSearchToolSearchContextSize = "medium" -
const WebSearchToolSearchContextSizeHigh WebSearchToolSearchContextSize = "high"
-
-
UserLocation WebSearchToolUserLocationThe approximate location of the user.
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
Type stringThe type of location approximation. Always
approximate.const WebSearchToolUserLocationTypeApproximate WebSearchToolUserLocationType = "approximate"
-
-
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
ServerLabel stringA label for this MCP server, used to identify it in tool calls.
-
Type McpThe type of the MCP tool. Always
mcp.const McpMcp Mcp = "mcp"
-
AllowedTools ToolMcpAllowedToolsUnionList of allowed tool names or a filter object.
-
type ToolMcpAllowedToolsMcpAllowedTools []stringA string array of allowed tool names
-
type ToolMcpAllowedToolsMcpToolFilter struct{…}A filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
Authorization stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
ConnectorID stringIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
const ToolMcpConnectorIDConnectorDropbox ToolMcpConnectorID = "connector_dropbox" -
const ToolMcpConnectorIDConnectorGmail ToolMcpConnectorID = "connector_gmail" -
const ToolMcpConnectorIDConnectorGooglecalendar ToolMcpConnectorID = "connector_googlecalendar" -
const ToolMcpConnectorIDConnectorGoogledrive ToolMcpConnectorID = "connector_googledrive" -
const ToolMcpConnectorIDConnectorMicrosoftteams ToolMcpConnectorID = "connector_microsoftteams" -
const ToolMcpConnectorIDConnectorOutlookcalendar ToolMcpConnectorID = "connector_outlookcalendar" -
const ToolMcpConnectorIDConnectorOutlookemail ToolMcpConnectorID = "connector_outlookemail" -
const ToolMcpConnectorIDConnectorSharepoint ToolMcpConnectorID = "connector_sharepoint"
-
-
DeferLoading boolWhether this MCP tool is deferred and discovered via tool search.
-
Headers map[string, string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
RequireApproval ToolMcpRequireApprovalUnionSpecify which of the MCP server's tools require approval.
-
type ToolMcpRequireApprovalMcpToolApprovalFilter 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.-
Always ToolMcpRequireApprovalMcpToolApprovalFilterAlwaysA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
Never ToolMcpRequireApprovalMcpToolApprovalFilterNeverA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
type ToolMcpRequireApprovalMcpToolApprovalSetting stringSpecify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
const ToolMcpRequireApprovalMcpToolApprovalSettingAlways ToolMcpRequireApprovalMcpToolApprovalSetting = "always" -
const ToolMcpRequireApprovalMcpToolApprovalSettingNever ToolMcpRequireApprovalMcpToolApprovalSetting = "never"
-
-
-
ServerDescription stringOptional description of the MCP server, used to provide more context.
-
ServerURL stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
TunnelID stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
Container ToolCodeInterpreterContainerUnionThe code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
string -
type ToolCodeInterpreterContainerCodeInterpreterContainerAuto struct{…}Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
Type AutoAlways
auto.const AutoAuto Auto = "auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit stringThe memory limit for the code interpreter container.
-
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"
-
-
NetworkPolicy ToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…}-
Type DisabledDisable outbound network access. Always
disabled.const DisabledDisabled Disabled = "disabled"
-
-
type ContainerNetworkPolicyAllowlist struct{…}-
AllowedDomains []stringA list of allowed domains when type is
allowlist. -
Type AllowlistAllow outbound network access only to specified domains. Always
allowlist.const AllowlistAllowlist Allowlist = "allowlist"
-
DomainSecrets []ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
Domain stringThe domain associated with the secret.
-
Name stringThe name of the secret to inject for the domain.
-
Value stringThe secret value to inject for the domain.
-
-
-
-
-
-
Type CodeInterpreterThe type of the code interpreter tool. Always
code_interpreter.const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"
-
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
Type ImageGenerationThe type of the image generation tool. Always
image_generation.const ImageGenerationImageGeneration ImageGeneration = "image_generation"
-
Action stringWhether to generate a new image or edit an existing image. Default:
auto.-
const ToolImageGenerationActionGenerate ToolImageGenerationAction = "generate" -
const ToolImageGenerationActionEdit ToolImageGenerationAction = "edit" -
const ToolImageGenerationActionAuto ToolImageGenerationAction = "auto"
-
-
Background stringAllows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
const ToolImageGenerationBackgroundTransparent ToolImageGenerationBackground = "transparent" -
const ToolImageGenerationBackgroundOpaque ToolImageGenerationBackground = "opaque" -
const ToolImageGenerationBackgroundAuto ToolImageGenerationBackground = "auto"
-
-
InputFidelity stringControl how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
const ToolImageGenerationInputFidelityHigh ToolImageGenerationInputFidelity = "high" -
const ToolImageGenerationInputFidelityLow ToolImageGenerationInputFidelity = "low"
-
-
InputImageMask ToolImageGenerationInputImageMaskOptional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
FileID stringFile ID for the mask image.
-
ImageURL stringBase64-encoded mask image.
-
-
Model stringThe image generation model to use. Default:
gpt-image-1.-
string -
string-
const ToolImageGenerationModelGPTImage1 ToolImageGenerationModel = "gpt-image-1" -
const ToolImageGenerationModelGPTImage1Mini ToolImageGenerationModel = "gpt-image-1-mini" -
const ToolImageGenerationModelGPTImage2 ToolImageGenerationModel = "gpt-image-2" -
const ToolImageGenerationModelGPTImage2_2026_04_21 ToolImageGenerationModel = "gpt-image-2-2026-04-21" -
const ToolImageGenerationModelGPTImage1_5 ToolImageGenerationModel = "gpt-image-1.5" -
const ToolImageGenerationModelChatgptImageLatest ToolImageGenerationModel = "chatgpt-image-latest"
-
-
-
Moderation stringModeration level for the generated image. Default:
auto.-
const ToolImageGenerationModerationAuto ToolImageGenerationModeration = "auto" -
const ToolImageGenerationModerationLow ToolImageGenerationModeration = "low"
-
-
OutputCompression int64Compression level for the output image. Default: 100.
-
OutputFormat stringThe output format of the generated image. One of
png,webp, orjpeg. Default:png.-
const ToolImageGenerationOutputFormatPNG ToolImageGenerationOutputFormat = "png" -
const ToolImageGenerationOutputFormatWebP ToolImageGenerationOutputFormat = "webp" -
const ToolImageGenerationOutputFormatJPEG ToolImageGenerationOutputFormat = "jpeg"
-
-
PartialImages int64Number of partial images to generate in streaming mode, from 0 (default value) to 3.
-
Quality stringThe quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
const ToolImageGenerationQualityLow ToolImageGenerationQuality = "low" -
const ToolImageGenerationQualityMedium ToolImageGenerationQuality = "medium" -
const ToolImageGenerationQualityHigh ToolImageGenerationQuality = "high" -
const ToolImageGenerationQualityAuto ToolImageGenerationQuality = "auto"
-
-
Size stringThe size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
string -
string-
const ToolImageGenerationSize1024x1024 ToolImageGenerationSize = "1024x1024" -
const ToolImageGenerationSize1024x1536 ToolImageGenerationSize = "1024x1536" -
const ToolImageGenerationSize1536x1024 ToolImageGenerationSize = "1536x1024" -
const ToolImageGenerationSizeAuto ToolImageGenerationSize = "auto"
-
-
-
-
type ToolLocalShell struct{…}A tool that allows the model to execute shell commands in a local environment.
-
Type LocalShellThe type of the local shell tool. Always
local_shell.const LocalShellLocalShell LocalShell = "local_shell"
-
-
type FunctionShellTool struct{…}A tool that allows the model to execute shell commands.
-
Type ShellThe type of the shell tool. Always
shell.const ShellShell Shell = "shell"
-
Environment FunctionShellToolEnvironmentUnion-
type ContainerAuto struct{…}-
Type ContainerAutoAutomatically creates a container for this request
const ContainerAutoContainerAuto ContainerAuto = "container_auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit ContainerAutoMemoryLimitThe memory limit for the container.
-
const ContainerAutoMemoryLimit1g ContainerAutoMemoryLimit = "1g" -
const ContainerAutoMemoryLimit4g ContainerAutoMemoryLimit = "4g" -
const ContainerAutoMemoryLimit16g ContainerAutoMemoryLimit = "16g" -
const ContainerAutoMemoryLimit64g ContainerAutoMemoryLimit = "64g"
-
-
NetworkPolicy ContainerAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…} -
type ContainerNetworkPolicyAllowlist struct{…}
-
-
Skills []ContainerAutoSkillUnionAn optional list of skills referenced by id or inline data.
-
type SkillReference struct{…}-
SkillID stringThe ID of the referenced skill.
-
Type SkillReferenceReferences a skill created with the /v1/skills endpoint.
const SkillReferenceSkillReference SkillReference = "skill_reference"
-
Version stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
type InlineSkill struct{…}-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Source InlineSkillSourceInline skill payload
-
Data stringBase64-encoded skill zip bundle.
-
MediaType ApplicationZipThe media type of the inline skill payload. Must be
application/zip.const ApplicationZipApplicationZip ApplicationZip = "application/zip"
-
Type Base64The type of the inline skill source. Must be
base64.const Base64Base64 Base64 = "base64"
-
-
Type InlineDefines an inline skill for this request.
const InlineInline Inline = "inline"
-
-
-
-
type LocalEnvironment struct{…}-
Type LocalUse a local computer environment.
const LocalLocal Local = "local"
-
Skills []LocalSkillAn optional list of skills.
-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Path stringThe path to the directory containing the skill.
-
-
-
type ContainerReference struct{…}-
ContainerID stringThe ID of the referenced container.
-
Type ContainerReferenceReferences a container created with the /v1/containers endpoint
const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
Name stringThe name of the custom tool, used to identify it in tool calls.
-
Type CustomThe type of the custom tool. Always
custom.const CustomCustom Custom = "custom"
-
DeferLoading boolWhether this tool should be deferred and discovered via tool search.
-
Description stringOptional description of the custom tool, used to provide more context.
-
Format CustomToolInputFormatUnionThe input format for the custom tool. Default is unconstrained text.
-
type CustomToolInputFormatText struct{…}Unconstrained free-form text.
-
Type TextUnconstrained text format. Always
text.const TextText Text = "text"
-
-
type CustomToolInputFormatGrammar struct{…}A grammar defined by the user.
-
Definition stringThe grammar definition.
-
Syntax stringThe syntax of the grammar definition. One of
larkorregex.-
const CustomToolInputFormatGrammarSyntaxLark CustomToolInputFormatGrammarSyntax = "lark" -
const CustomToolInputFormatGrammarSyntaxRegex CustomToolInputFormatGrammarSyntax = "regex"
-
-
Type GrammarGrammar format. Always
grammar.const GrammarGrammar Grammar = "grammar"
-
-
-
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
Description stringA description of the namespace shown to the model.
-
Name stringThe namespace name used in tool calls (for example,
crm). -
Tools []NamespaceToolToolUnionThe function/custom tools available inside this namespace.
-
type NamespaceToolToolFunction struct{…}-
Name string -
Type Functionconst FunctionFunction Function = "function"
-
DeferLoading boolWhether this function should be deferred and discovered via tool search.
-
Description string -
Parameters any -
Strict bool
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
-
Type NamespaceThe type of the tool. Always
namespace.const NamespaceNamespace Namespace = "namespace"
-
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
Type ToolSearchThe type of the tool. Always
tool_search.const ToolSearchToolSearch ToolSearch = "tool_search"
-
Description stringDescription shown to the model for a client-executed tool search tool.
-
Execution ToolSearchToolExecutionWhether tool search is executed by the server or by the client.
-
const ToolSearchToolExecutionServer ToolSearchToolExecution = "server" -
const ToolSearchToolExecutionClient ToolSearchToolExecution = "client"
-
-
Parameters anyParameter schema for a client-executed tool search tool.
-
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
Type WebSearchPreviewToolTypeThe type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
const WebSearchPreviewToolTypeWebSearchPreview WebSearchPreviewToolType = "web_search_preview" -
const WebSearchPreviewToolTypeWebSearchPreview2025_03_11 WebSearchPreviewToolType = "web_search_preview_2025_03_11"
-
-
SearchContentTypes []string-
const WebSearchPreviewToolSearchContentTypeText WebSearchPreviewToolSearchContentType = "text" -
const WebSearchPreviewToolSearchContentTypeImage WebSearchPreviewToolSearchContentType = "image"
-
-
SearchContextSize WebSearchPreviewToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchPreviewToolSearchContextSizeLow WebSearchPreviewToolSearchContextSize = "low" -
const WebSearchPreviewToolSearchContextSizeMedium WebSearchPreviewToolSearchContextSize = "medium" -
const WebSearchPreviewToolSearchContextSizeHigh WebSearchPreviewToolSearchContextSize = "high"
-
-
UserLocation WebSearchPreviewToolUserLocationThe user's location.
-
Type ApproximateThe type of location approximation. Always
approximate.const ApproximateApproximate Approximate = "approximate"
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
Type ApplyPatchThe type of the tool. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
-
Type ToolSearchOutputThe type of the item. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseOutputItemAdditionalTools struct{…}-
ID stringThe unique ID of the additional tools item.
-
Role stringThe role that provided the additional tools.
-
const ResponseOutputItemAdditionalToolsRoleUnknown ResponseOutputItemAdditionalToolsRole = "unknown" -
const ResponseOutputItemAdditionalToolsRoleUser ResponseOutputItemAdditionalToolsRole = "user" -
const ResponseOutputItemAdditionalToolsRoleAssistant ResponseOutputItemAdditionalToolsRole = "assistant" -
const ResponseOutputItemAdditionalToolsRoleSystem ResponseOutputItemAdditionalToolsRole = "system" -
const ResponseOutputItemAdditionalToolsRoleCritic ResponseOutputItemAdditionalToolsRole = "critic" -
const ResponseOutputItemAdditionalToolsRoleDiscriminator ResponseOutputItemAdditionalToolsRole = "discriminator" -
const ResponseOutputItemAdditionalToolsRoleDeveloper ResponseOutputItemAdditionalToolsRole = "developer" -
const ResponseOutputItemAdditionalToolsRoleTool ResponseOutputItemAdditionalToolsRole = "tool"
-
-
Tools []ToolUnionThe additional tool definitions made available at this item.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type AdditionalToolsThe type of the item. Always
additional_tools.const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"
-
-
type ResponseCompactionItem struct{…}A compaction item generated by the
v1/responses/compactAPI.-
ID stringThe unique ID of the compaction item.
-
EncryptedContent stringThe encrypted content that was produced by compaction.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseOutputItemImageGenerationCall struct{…}An image generation request made by the model.
-
ID stringThe unique ID of the image generation call.
-
Result stringThe generated image encoded in base64.
-
Status stringThe status of the image generation call.
-
const ResponseOutputItemImageGenerationCallStatusInProgress ResponseOutputItemImageGenerationCallStatus = "in_progress" -
const ResponseOutputItemImageGenerationCallStatusCompleted ResponseOutputItemImageGenerationCallStatus = "completed" -
const ResponseOutputItemImageGenerationCallStatusGenerating ResponseOutputItemImageGenerationCallStatus = "generating" -
const ResponseOutputItemImageGenerationCallStatusFailed ResponseOutputItemImageGenerationCallStatus = "failed"
-
-
Type ImageGenerationCallThe type of the image generation call. Always
image_generation_call.const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"
-
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
ID stringThe unique ID of the code interpreter tool call.
-
Code stringThe code to run, or null if not available.
-
ContainerID stringThe ID of the container used to run the code.
-
Outputs []ResponseCodeInterpreterToolCallOutputUnionThe outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
type ResponseCodeInterpreterToolCallOutputLogs struct{…}The logs output from the code interpreter.
-
Logs stringThe logs output from the code interpreter.
-
Type LogsThe type of the output. Always
logs.const LogsLogs Logs = "logs"
-
-
type ResponseCodeInterpreterToolCallOutputImage struct{…}The image output from the code interpreter.
-
Type ImageThe type of the output. Always
image.const ImageImage Image = "image"
-
URL stringThe URL of the image output from the code interpreter.
-
-
-
Status ResponseCodeInterpreterToolCallStatusThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
const ResponseCodeInterpreterToolCallStatusInProgress ResponseCodeInterpreterToolCallStatus = "in_progress" -
const ResponseCodeInterpreterToolCallStatusCompleted ResponseCodeInterpreterToolCallStatus = "completed" -
const ResponseCodeInterpreterToolCallStatusIncomplete ResponseCodeInterpreterToolCallStatus = "incomplete" -
const ResponseCodeInterpreterToolCallStatusInterpreting ResponseCodeInterpreterToolCallStatus = "interpreting" -
const ResponseCodeInterpreterToolCallStatusFailed ResponseCodeInterpreterToolCallStatus = "failed"
-
-
Type CodeInterpreterCallThe type of the code interpreter tool call. Always
code_interpreter_call.const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"
-
-
type ResponseOutputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
ID stringThe unique ID of the local shell call.
-
Action ResponseOutputItemLocalShellCallActionExecute a shell command on the server.
-
Command []stringThe command to run.
-
Env map[string, string]Environment variables to set for the command.
-
Type ExecThe type of the local shell action. Always
exec.const ExecExec Exec = "exec"
-
TimeoutMs int64Optional timeout in milliseconds for the command.
-
User stringOptional user to run the command as.
-
WorkingDirectory stringOptional working directory to run the command in.
-
-
CallID stringThe unique ID of the local shell tool call generated by the model.
-
Status stringThe status of the local shell call.
-
const ResponseOutputItemLocalShellCallStatusInProgress ResponseOutputItemLocalShellCallStatus = "in_progress" -
const ResponseOutputItemLocalShellCallStatusCompleted ResponseOutputItemLocalShellCallStatus = "completed" -
const ResponseOutputItemLocalShellCallStatusIncomplete ResponseOutputItemLocalShellCallStatus = "incomplete"
-
-
Type LocalShellCallThe type of the local shell call. Always
local_shell_call.const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"
-
-
type ResponseOutputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
ID stringThe unique ID of the local shell tool call generated by the model.
-
Output stringA JSON string of the output of the local shell tool call.
-
Type LocalShellCallOutputThe type of the local shell tool call output. Always
local_shell_call_output.const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete.-
const ResponseOutputItemLocalShellCallOutputStatusInProgress ResponseOutputItemLocalShellCallOutputStatus = "in_progress" -
const ResponseOutputItemLocalShellCallOutputStatusCompleted ResponseOutputItemLocalShellCallOutputStatus = "completed" -
const ResponseOutputItemLocalShellCallOutputStatusIncomplete ResponseOutputItemLocalShellCallOutputStatus = "incomplete"
-
-
-
type ResponseFunctionShellToolCall struct{…}A tool call that executes one or more shell commands in a managed environment.
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Action ResponseFunctionShellToolCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []string -
MaxOutputLength int64Optional maximum number of characters to return from each command.
-
TimeoutMs int64Optional timeout in milliseconds for the commands.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Environment ResponseFunctionShellToolCallEnvironmentUnionRepresents the use of a local environment to perform shell actions.
-
type ResponseLocalEnvironment struct{…}Represents the use of a local environment to perform shell actions.
-
Type LocalThe environment type. Always
local.const LocalLocal Local = "local"
-
-
type ResponseContainerReference struct{…}Represents a container created with /v1/containers.
-
ContainerID string -
Type ContainerReferenceThe environment type. Always
container_reference.const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
Status ResponseFunctionShellToolCallStatusThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallStatusInProgress ResponseFunctionShellToolCallStatus = "in_progress" -
const ResponseFunctionShellToolCallStatusCompleted ResponseFunctionShellToolCallStatus = "completed" -
const ResponseFunctionShellToolCallStatusIncomplete ResponseFunctionShellToolCallStatus = "incomplete"
-
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseFunctionShellToolCallOutput struct{…}The output of a shell tool call that was emitted.
-
ID stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
MaxOutputLength int64The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
Output []ResponseFunctionShellToolCallOutputOutputAn array of shell call output contents
-
Outcome ResponseFunctionShellToolCallOutputOutputOutcomeUnionRepresents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
type ResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64Exit code from the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringThe standard error output that was captured.
-
Stdout stringThe standard output that was captured.
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
Status ResponseFunctionShellToolCallOutputStatusThe status of the shell call output. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallOutputStatusInProgress ResponseFunctionShellToolCallOutputStatus = "in_progress" -
const ResponseFunctionShellToolCallOutputStatusCompleted ResponseFunctionShellToolCallOutputStatus = "completed" -
const ResponseFunctionShellToolCallOutputStatusIncomplete ResponseFunctionShellToolCallOutputStatus = "incomplete"
-
-
Type ShellCallOutputThe type of the shell call output. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseApplyPatchToolCall struct{…}A tool call that applies file diffs by creating, deleting, or updating files.
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseApplyPatchToolCallOperationUnionOne of the create_file, delete_file, or update_file operations applied via apply_patch.
-
type ResponseApplyPatchToolCallOperationCreateFile struct{…}Instruction describing how to create a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to create.
-
Type CreateFileCreate a new file with the provided diff.
const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseApplyPatchToolCallOperationDeleteFile struct{…}Instruction describing how to delete a file via the apply_patch tool.
-
Path stringPath of the file to delete.
-
Type DeleteFileDelete the specified file.
const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseApplyPatchToolCallOperationUpdateFile struct{…}Instruction describing how to update a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to update.
-
Type UpdateFileUpdate an existing file with the provided diff.
const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status ResponseApplyPatchToolCallStatusThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseApplyPatchToolCallStatusInProgress ResponseApplyPatchToolCallStatus = "in_progress" -
const ResponseApplyPatchToolCallStatusCompleted ResponseApplyPatchToolCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseApplyPatchToolCallOutput struct{…}The output emitted by an apply patch tool call.
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status ResponseApplyPatchToolCallOutputStatusThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseApplyPatchToolCallOutputStatusCompleted ResponseApplyPatchToolCallOutputStatus = "completed" -
const ResponseApplyPatchToolCallOutputStatusFailed ResponseApplyPatchToolCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
CreatedBy stringThe ID of the entity that created this tool call output.
-
Output stringOptional textual output returned by the apply patch tool.
-
-
type ResponseOutputItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
ID stringThe unique ID of the tool call.
-
Arguments stringA JSON string of the arguments passed to the tool.
-
Name stringThe name of the tool that was run.
-
ServerLabel stringThe label of the MCP server running the tool.
-
Type McpCallThe type of the item. Always
mcp_call.const McpCallMcpCall McpCall = "mcp_call"
-
ApprovalRequestID stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
Error stringThe error from the tool call, if any.
-
Output stringThe output from the tool call.
-
Status stringThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
const ResponseOutputItemMcpCallStatusInProgress ResponseOutputItemMcpCallStatus = "in_progress" -
const ResponseOutputItemMcpCallStatusCompleted ResponseOutputItemMcpCallStatus = "completed" -
const ResponseOutputItemMcpCallStatusIncomplete ResponseOutputItemMcpCallStatus = "incomplete" -
const ResponseOutputItemMcpCallStatusCalling ResponseOutputItemMcpCallStatus = "calling" -
const ResponseOutputItemMcpCallStatusFailed ResponseOutputItemMcpCallStatus = "failed"
-
-
-
type ResponseOutputItemMcpListTools struct{…}A list of tools available on an MCP server.
-
ID stringThe unique ID of the list.
-
ServerLabel stringThe label of the MCP server.
-
Tools []ResponseOutputItemMcpListToolsToolThe tools available on the server.
-
InputSchema anyThe JSON schema describing the tool's input.
-
Name stringThe name of the tool.
-
Annotations anyAdditional annotations about the tool.
-
Description stringThe description of the tool.
-
-
Type McpListToolsThe type of the item. Always
mcp_list_tools.const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
-
Error stringError message if the server could not list tools.
-
-
type ResponseOutputItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
ID stringThe unique ID of the approval request.
-
Arguments stringA JSON string of arguments for the tool.
-
Name stringThe name of the tool to run.
-
ServerLabel stringThe label of the MCP server making the request.
-
Type McpApprovalRequestThe type of the item. Always
mcp_approval_request.const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"
-
-
type ResponseOutputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
ID stringThe unique ID of the approval response
-
ApprovalRequestID stringThe ID of the approval request being answered.
-
Approve boolWhether the request was approved.
-
Type McpApprovalResponseThe type of the item. Always
mcp_approval_response.const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
-
Reason stringOptional reason for the decision.
-
-
type ResponseCustomToolCall struct{…}A call to a custom tool created by the model.
-
CallID stringAn identifier used to map this custom tool call to a tool call output.
-
Input stringThe input for the custom tool call generated by the model.
-
Name stringThe name of the custom tool being called.
-
Type CustomToolCallThe type of the custom tool call. Always
custom_tool_call.const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"
-
ID stringThe unique ID of the custom tool call in the OpenAI platform.
-
Namespace stringThe namespace of the custom tool being called.
-
-
type ResponseCustomToolCallOutputItem struct{…}The output of a custom tool call from your code, being sent back to the model.
-
ID stringThe unique ID of the custom tool call output item.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseCustomToolCallOutputItemStatusInProgress ResponseCustomToolCallOutputItemStatus = "in_progress" -
const ResponseCustomToolCallOutputItemStatusCompleted ResponseCustomToolCallOutputItemStatus = "completed" -
const ResponseCustomToolCallOutputItemStatusIncomplete ResponseCustomToolCallOutputItemStatus = "incomplete"
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
Response Output Item Added Event
-
type ResponseOutputItemAddedEvent struct{…}Emitted when a new output item is added.
-
Item ResponseOutputItemUnionThe output item that was added.
-
type ResponseOutputMessage struct{…}An output message from the model.
-
ID stringThe unique ID of the output message.
-
Content []ResponseOutputMessageContentUnionThe content of the output message.
-
type ResponseOutputText struct{…}A text output from the model.
-
Annotations []ResponseOutputTextAnnotationUnionThe annotations of the text output.
-
type ResponseOutputTextAnnotationFileCitation struct{…}A citation to a file.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the file cited.
-
Index int64The index of the file in the list of files.
-
Type FileCitationThe type of the file citation. Always
file_citation.const FileCitationFileCitation FileCitation = "file_citation"
-
-
type ResponseOutputTextAnnotationURLCitation struct{…}A citation for a web resource used to generate a model response.
-
EndIndex int64The index of the last character of the URL citation in the message.
-
StartIndex int64The index of the first character of the URL citation in the message.
-
Title stringThe title of the web resource.
-
Type URLCitationThe type of the URL citation. Always
url_citation.const URLCitationURLCitation URLCitation = "url_citation"
-
URL stringThe URL of the web resource.
-
-
type ResponseOutputTextAnnotationContainerFileCitation struct{…}A citation for a container file used to generate a model response.
-
ContainerID stringThe ID of the container file.
-
EndIndex int64The index of the last character of the container file citation in the message.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the container file cited.
-
StartIndex int64The index of the first character of the container file citation in the message.
-
Type ContainerFileCitationThe type of the container file citation. Always
container_file_citation.const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"
-
-
type ResponseOutputTextAnnotationFilePath struct{…}A path to a file.
-
FileID stringThe ID of the file.
-
Index int64The index of the file in the list of files.
-
Type FilePathThe type of the file path. Always
file_path.const FilePathFilePath FilePath = "file_path"
-
-
-
Text stringThe text output from the model.
-
Type OutputTextThe type of the output text. Always
output_text.const OutputTextOutputText OutputText = "output_text"
-
Logprobs []ResponseOutputTextLogprob-
Token string -
Bytes []int64 -
Logprob float64 -
TopLogprobs []ResponseOutputTextLogprobTopLogprob-
Token string -
Bytes []int64 -
Logprob float64
-
-
-
-
type ResponseOutputRefusal struct{…}A refusal from the model.
-
Refusal stringThe refusal explanation from the model.
-
Type RefusalThe type of the refusal. Always
refusal.const RefusalRefusal Refusal = "refusal"
-
-
-
Role AssistantThe role of the output message. Always
assistant.const AssistantAssistant Assistant = "assistant"
-
Status ResponseOutputMessageStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseOutputMessageStatusInProgress ResponseOutputMessageStatus = "in_progress" -
const ResponseOutputMessageStatusCompleted ResponseOutputMessageStatus = "completed" -
const ResponseOutputMessageStatusIncomplete ResponseOutputMessageStatus = "incomplete"
-
-
Type MessageThe type of the output message. Always
message.const MessageMessage Message = "message"
-
Phase ResponseOutputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const ResponseOutputMessagePhaseCommentary ResponseOutputMessagePhase = "commentary" -
const ResponseOutputMessagePhaseFinalAnswer ResponseOutputMessagePhase = "final_answer"
-
-
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
ID stringThe unique ID of the file search tool call.
-
Queries []stringThe queries used to search for files.
-
Status ResponseFileSearchToolCallStatusThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
const ResponseFileSearchToolCallStatusInProgress ResponseFileSearchToolCallStatus = "in_progress" -
const ResponseFileSearchToolCallStatusSearching ResponseFileSearchToolCallStatus = "searching" -
const ResponseFileSearchToolCallStatusCompleted ResponseFileSearchToolCallStatus = "completed" -
const ResponseFileSearchToolCallStatusIncomplete ResponseFileSearchToolCallStatus = "incomplete" -
const ResponseFileSearchToolCallStatusFailed ResponseFileSearchToolCallStatus = "failed"
-
-
Type FileSearchCallThe type of the file search tool call. Always
file_search_call.const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"
-
Results []ResponseFileSearchToolCallResultThe results of the file search tool call.
-
Attributes map[string, ResponseFileSearchToolCallResultAttributeUnion]Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.
-
string -
float64 -
bool
-
-
FileID stringThe unique ID of the file.
-
Filename stringThe name of the file.
-
Score float64The relevance score of the file - a value between 0 and 1.
-
Text stringThe text that was retrieved from the file.
-
-
-
type ResponseFunctionToolCall struct{…}A tool call to run a function. See the function calling guide for more information.
-
Arguments stringA JSON string of the arguments to pass to the function.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Name stringThe name of the function to run.
-
Type FunctionCallThe type of the function tool call. Always
function_call.const FunctionCallFunctionCall FunctionCall = "function_call"
-
ID stringThe unique ID of the function tool call.
-
Namespace stringThe namespace of the function to run.
-
Status ResponseFunctionToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallStatusInProgress ResponseFunctionToolCallStatus = "in_progress" -
const ResponseFunctionToolCallStatusCompleted ResponseFunctionToolCallStatus = "completed" -
const ResponseFunctionToolCallStatusIncomplete ResponseFunctionToolCallStatus = "incomplete"
-
-
-
type ResponseFunctionToolCallOutputItem struct{…}-
ID stringThe unique ID of the function call tool output.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseFunctionToolCallOutputItemOutputUnionThe output from the function call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseFunctionToolCallOutputItemOutputOutputContentList []ResponseFunctionToolCallOutputItemOutputOutputContentListItemUnionText, image, or file output of the function call.
-
type ResponseInputText struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
Detail ResponseInputImageDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageDetailLow ResponseInputImageDetail = "low" -
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high" -
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto" -
const ResponseInputImageDetailOriginal ResponseInputImageDetail = "original"
-
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFile struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileDetailLow ResponseInputFileDetail = "low" -
const ResponseInputFileDetailHigh ResponseInputFileDetail = "high"
-
-
FileData stringThe content of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Status ResponseFunctionToolCallOutputItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallOutputItemStatusInProgress ResponseFunctionToolCallOutputItemStatus = "in_progress" -
const ResponseFunctionToolCallOutputItemStatusCompleted ResponseFunctionToolCallOutputItemStatus = "completed" -
const ResponseFunctionToolCallOutputItemStatusIncomplete ResponseFunctionToolCallOutputItemStatus = "incomplete"
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
ID stringThe unique ID of the web search tool call.
-
Action ResponseFunctionWebSearchActionUnionAn object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
type ResponseFunctionWebSearchActionSearch struct{…}Action type "search" - Performs a web search query.
-
Type SearchThe action type.
const SearchSearch Search = "search"
-
Queries []stringThe search queries.
-
Query stringThe search query.
-
Sources []ResponseFunctionWebSearchActionSearchSourceThe sources used in the search.
-
Type URLThe type of source. Always
url.const URLURL URL = "url"
-
URL stringThe URL of the source.
-
-
-
type ResponseFunctionWebSearchActionOpenPage struct{…}Action type "open_page" - Opens a specific URL from search results.
-
Type OpenPageThe action type.
const OpenPageOpenPage OpenPage = "open_page"
-
URL stringThe URL opened by the model.
-
-
type ResponseFunctionWebSearchActionFindInPage struct{…}Action type "find_in_page": Searches for a pattern within a loaded page.
-
Pattern stringThe pattern or text to search for within the page.
-
Type FindInPageThe action type.
const FindInPageFindInPage FindInPage = "find_in_page"
-
URL stringThe URL of the page searched for the pattern.
-
-
-
Status ResponseFunctionWebSearchStatusThe status of the web search tool call.
-
const ResponseFunctionWebSearchStatusInProgress ResponseFunctionWebSearchStatus = "in_progress" -
const ResponseFunctionWebSearchStatusSearching ResponseFunctionWebSearchStatus = "searching" -
const ResponseFunctionWebSearchStatusCompleted ResponseFunctionWebSearchStatus = "completed" -
const ResponseFunctionWebSearchStatusFailed ResponseFunctionWebSearchStatus = "failed"
-
-
Type WebSearchCallThe type of the web search tool call. Always
web_search_call.const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"
-
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
ID stringThe unique ID of the computer call.
-
CallID stringAn identifier used when responding to the tool call with output.
-
PendingSafetyChecks []ResponseComputerToolCallPendingSafetyCheckThe pending safety checks for the computer call.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status ResponseComputerToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseComputerToolCallStatusInProgress ResponseComputerToolCallStatus = "in_progress" -
const ResponseComputerToolCallStatusCompleted ResponseComputerToolCallStatus = "completed" -
const ResponseComputerToolCallStatusIncomplete ResponseComputerToolCallStatus = "incomplete"
-
-
Type ResponseComputerToolCallTypeThe type of the computer call. Always
computer_call.const ResponseComputerToolCallTypeComputerCall ResponseComputerToolCallType = "computer_call"
-
Action ResponseComputerToolCallActionUnionA click action.
-
type ResponseComputerToolCallActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ResponseComputerToolCallActionClickButtonLeft ResponseComputerToolCallActionClickButton = "left" -
const ResponseComputerToolCallActionClickButtonRight ResponseComputerToolCallActionClickButton = "right" -
const ResponseComputerToolCallActionClickButtonWheel ResponseComputerToolCallActionClickButton = "wheel" -
const ResponseComputerToolCallActionClickButtonBack ResponseComputerToolCallActionClickButton = "back" -
const ResponseComputerToolCallActionClickButtonForward ResponseComputerToolCallActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ResponseComputerToolCallActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ResponseComputerToolCallActionDrag struct{…}A drag action.
-
Path []ResponseComputerToolCallActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ResponseComputerToolCallActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ResponseComputerToolCallActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ResponseComputerToolCallActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ResponseComputerToolCallActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ResponseComputerToolCallActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ResponseComputerToolCallActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
Actions ComputerActionListFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
type ComputerActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ComputerActionClickButtonLeft ComputerActionClickButton = "left" -
const ComputerActionClickButtonRight ComputerActionClickButton = "right" -
const ComputerActionClickButtonWheel ComputerActionClickButton = "wheel" -
const ComputerActionClickButtonBack ComputerActionClickButton = "back" -
const ComputerActionClickButtonForward ComputerActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ComputerActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ComputerActionDrag struct{…}A drag action.
-
Path []ComputerActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ComputerActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ComputerActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ComputerActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ComputerActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ComputerActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ComputerActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
-
type ResponseComputerToolCallOutputItem struct{…}-
ID stringThe unique ID of the computer call tool output.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Type ComputerScreenshotSpecifies the event type. For a computer screenshot, this property is always set to
computer_screenshot.const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"
-
FileID stringThe identifier of an uploaded file that contains the screenshot.
-
ImageURL stringThe URL of the screenshot image.
-
-
Status ResponseComputerToolCallOutputItemStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseComputerToolCallOutputItemStatusCompleted ResponseComputerToolCallOutputItemStatus = "completed" -
const ResponseComputerToolCallOutputItemStatusIncomplete ResponseComputerToolCallOutputItemStatus = "incomplete" -
const ResponseComputerToolCallOutputItemStatusFailed ResponseComputerToolCallOutputItemStatus = "failed" -
const ResponseComputerToolCallOutputItemStatusInProgress ResponseComputerToolCallOutputItemStatus = "in_progress"
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
AcknowledgedSafetyChecks []ResponseComputerToolCallOutputItemAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
ID stringThe unique identifier of the reasoning content.
-
Summary []ResponseReasoningItemSummaryReasoning summary content.
-
Text stringA summary of the reasoning output from the model so far.
-
Type SummaryTextThe type of the object. Always
summary_text.const SummaryTextSummaryText SummaryText = "summary_text"
-
-
Type ReasoningThe type of the object. Always
reasoning.const ReasoningReasoning Reasoning = "reasoning"
-
Content []ResponseReasoningItemContentReasoning text content.
-
Text stringThe reasoning text from the model.
-
Type ReasoningTextThe type of the reasoning text. Always
reasoning_text.const ReasoningTextReasoningText ReasoningText = "reasoning_text"
-
-
EncryptedContent stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
Status ResponseReasoningItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseReasoningItemStatusInProgress ResponseReasoningItemStatus = "in_progress" -
const ResponseReasoningItemStatusCompleted ResponseReasoningItemStatus = "completed" -
const ResponseReasoningItemStatusIncomplete ResponseReasoningItemStatus = "incomplete"
-
-
-
type ResponseToolSearchCall struct{…}-
ID stringThe unique ID of the tool search call item.
-
Arguments anyArguments used for the tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchCallExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchCallExecutionServer ResponseToolSearchCallExecution = "server" -
const ResponseToolSearchCallExecutionClient ResponseToolSearchCallExecution = "client"
-
-
Status ResponseToolSearchCallStatusThe status of the tool search call item that was recorded.
-
const ResponseToolSearchCallStatusInProgress ResponseToolSearchCallStatus = "in_progress" -
const ResponseToolSearchCallStatusCompleted ResponseToolSearchCallStatus = "completed" -
const ResponseToolSearchCallStatusIncomplete ResponseToolSearchCallStatus = "incomplete"
-
-
Type ToolSearchCallThe type of the item. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseToolSearchOutputItem struct{…}-
ID stringThe unique ID of the tool search output item.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemExecutionServer ResponseToolSearchOutputItemExecution = "server" -
const ResponseToolSearchOutputItemExecutionClient ResponseToolSearchOutputItemExecution = "client"
-
-
Status ResponseToolSearchOutputItemStatusThe status of the tool search output item that was recorded.
-
const ResponseToolSearchOutputItemStatusInProgress ResponseToolSearchOutputItemStatus = "in_progress" -
const ResponseToolSearchOutputItemStatusCompleted ResponseToolSearchOutputItemStatus = "completed" -
const ResponseToolSearchOutputItemStatusIncomplete ResponseToolSearchOutputItemStatus = "incomplete"
-
-
Tools []ToolUnionThe loaded tool definitions returned by tool search.
-
type FunctionTool struct{…}Defines a function in your own code the model can choose to call. Learn more about function calling.
-
Name stringThe name of the function to call.
-
Parameters map[string, any]A JSON schema object describing the parameters of the function.
-
Strict boolWhether to enforce strict parameter validation. Default
true. -
Type FunctionThe type of the function tool. Always
function.const FunctionFunction Function = "function"
-
DeferLoading boolWhether this function is deferred and loaded via tool search.
-
Description stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
type FileSearchTool struct{…}A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
Type FileSearchThe type of the file search tool. Always
file_search.const FileSearchFileSearch FileSearch = "file_search"
-
VectorStoreIDs []stringThe IDs of the vector stores to search.
-
Filters FileSearchToolFiltersUnionA filter to apply.
-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
Key stringThe key to compare against the value.
-
Type ComparisonFilterTypeSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
const ComparisonFilterTypeEq ComparisonFilterType = "eq" -
const ComparisonFilterTypeNe ComparisonFilterType = "ne" -
const ComparisonFilterTypeGt ComparisonFilterType = "gt" -
const ComparisonFilterTypeGte ComparisonFilterType = "gte" -
const ComparisonFilterTypeLt ComparisonFilterType = "lt" -
const ComparisonFilterTypeLte ComparisonFilterType = "lte" -
const ComparisonFilterTypeIn ComparisonFilterType = "in" -
const ComparisonFilterTypeNin ComparisonFilterType = "nin"
-
-
Value ComparisonFilterValueUnionThe value to compare against the attribute key; supports string, number, or boolean types.
-
string -
float64 -
bool -
type ComparisonFilterValueArray []ComparisonFilterValueArrayItemUnion-
string -
float64
-
-
-
-
type CompoundFilter struct{…}Combine multiple filters using
andoror.-
Filters []ComparisonFilterArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
-
Type CompoundFilterTypeType of operation:
andoror.-
const CompoundFilterTypeAnd CompoundFilterType = "and" -
const CompoundFilterTypeOr CompoundFilterType = "or"
-
-
-
-
MaxNumResults int64The maximum number of results to return. This number should be between 1 and 50 inclusive.
-
RankingOptions FileSearchToolRankingOptionsRanking options for search.
-
HybridSearch FileSearchToolRankingOptionsHybridSearchWeights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
EmbeddingWeight float64The weight of the embedding in the reciprocal ranking fusion.
-
TextWeight float64The weight of the text in the reciprocal ranking fusion.
-
-
Ranker stringThe ranker to use for the file search.
-
const FileSearchToolRankingOptionsRankerAuto FileSearchToolRankingOptionsRanker = "auto" -
const FileSearchToolRankingOptionsRankerDefault2024_11_15 FileSearchToolRankingOptionsRanker = "default-2024-11-15"
-
-
ScoreThreshold float64The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
Type ComputerThe type of the computer tool. Always
computer.const ComputerComputer Computer = "computer"
-
-
type ComputerUsePreviewTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
DisplayHeight int64The height of the computer display.
-
DisplayWidth int64The width of the computer display.
-
Environment ComputerUsePreviewToolEnvironmentThe type of computer environment to control.
-
const ComputerUsePreviewToolEnvironmentWindows ComputerUsePreviewToolEnvironment = "windows" -
const ComputerUsePreviewToolEnvironmentMac ComputerUsePreviewToolEnvironment = "mac" -
const ComputerUsePreviewToolEnvironmentLinux ComputerUsePreviewToolEnvironment = "linux" -
const ComputerUsePreviewToolEnvironmentUbuntu ComputerUsePreviewToolEnvironment = "ubuntu" -
const ComputerUsePreviewToolEnvironmentBrowser ComputerUsePreviewToolEnvironment = "browser"
-
-
Type ComputerUsePreviewThe type of the computer use tool. Always
computer_use_preview.const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"
-
-
type WebSearchTool struct{…}Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
Type WebSearchToolTypeThe type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
const WebSearchToolTypeWebSearch WebSearchToolType = "web_search" -
const WebSearchToolTypeWebSearch2025_08_26 WebSearchToolType = "web_search_2025_08_26"
-
-
Filters WebSearchToolFiltersFilters for the search.
-
AllowedDomains []stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
SearchContextSize WebSearchToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchToolSearchContextSizeLow WebSearchToolSearchContextSize = "low" -
const WebSearchToolSearchContextSizeMedium WebSearchToolSearchContextSize = "medium" -
const WebSearchToolSearchContextSizeHigh WebSearchToolSearchContextSize = "high"
-
-
UserLocation WebSearchToolUserLocationThe approximate location of the user.
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
Type stringThe type of location approximation. Always
approximate.const WebSearchToolUserLocationTypeApproximate WebSearchToolUserLocationType = "approximate"
-
-
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
ServerLabel stringA label for this MCP server, used to identify it in tool calls.
-
Type McpThe type of the MCP tool. Always
mcp.const McpMcp Mcp = "mcp"
-
AllowedTools ToolMcpAllowedToolsUnionList of allowed tool names or a filter object.
-
type ToolMcpAllowedToolsMcpAllowedTools []stringA string array of allowed tool names
-
type ToolMcpAllowedToolsMcpToolFilter struct{…}A filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
Authorization stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
ConnectorID stringIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
const ToolMcpConnectorIDConnectorDropbox ToolMcpConnectorID = "connector_dropbox" -
const ToolMcpConnectorIDConnectorGmail ToolMcpConnectorID = "connector_gmail" -
const ToolMcpConnectorIDConnectorGooglecalendar ToolMcpConnectorID = "connector_googlecalendar" -
const ToolMcpConnectorIDConnectorGoogledrive ToolMcpConnectorID = "connector_googledrive" -
const ToolMcpConnectorIDConnectorMicrosoftteams ToolMcpConnectorID = "connector_microsoftteams" -
const ToolMcpConnectorIDConnectorOutlookcalendar ToolMcpConnectorID = "connector_outlookcalendar" -
const ToolMcpConnectorIDConnectorOutlookemail ToolMcpConnectorID = "connector_outlookemail" -
const ToolMcpConnectorIDConnectorSharepoint ToolMcpConnectorID = "connector_sharepoint"
-
-
DeferLoading boolWhether this MCP tool is deferred and discovered via tool search.
-
Headers map[string, string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
RequireApproval ToolMcpRequireApprovalUnionSpecify which of the MCP server's tools require approval.
-
type ToolMcpRequireApprovalMcpToolApprovalFilter 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.-
Always ToolMcpRequireApprovalMcpToolApprovalFilterAlwaysA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
Never ToolMcpRequireApprovalMcpToolApprovalFilterNeverA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
type ToolMcpRequireApprovalMcpToolApprovalSetting stringSpecify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
const ToolMcpRequireApprovalMcpToolApprovalSettingAlways ToolMcpRequireApprovalMcpToolApprovalSetting = "always" -
const ToolMcpRequireApprovalMcpToolApprovalSettingNever ToolMcpRequireApprovalMcpToolApprovalSetting = "never"
-
-
-
ServerDescription stringOptional description of the MCP server, used to provide more context.
-
ServerURL stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
TunnelID stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
Container ToolCodeInterpreterContainerUnionThe code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
string -
type ToolCodeInterpreterContainerCodeInterpreterContainerAuto struct{…}Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
Type AutoAlways
auto.const AutoAuto Auto = "auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit stringThe memory limit for the code interpreter container.
-
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"
-
-
NetworkPolicy ToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…}-
Type DisabledDisable outbound network access. Always
disabled.const DisabledDisabled Disabled = "disabled"
-
-
type ContainerNetworkPolicyAllowlist struct{…}-
AllowedDomains []stringA list of allowed domains when type is
allowlist. -
Type AllowlistAllow outbound network access only to specified domains. Always
allowlist.const AllowlistAllowlist Allowlist = "allowlist"
-
DomainSecrets []ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
Domain stringThe domain associated with the secret.
-
Name stringThe name of the secret to inject for the domain.
-
Value stringThe secret value to inject for the domain.
-
-
-
-
-
-
Type CodeInterpreterThe type of the code interpreter tool. Always
code_interpreter.const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"
-
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
Type ImageGenerationThe type of the image generation tool. Always
image_generation.const ImageGenerationImageGeneration ImageGeneration = "image_generation"
-
Action stringWhether to generate a new image or edit an existing image. Default:
auto.-
const ToolImageGenerationActionGenerate ToolImageGenerationAction = "generate" -
const ToolImageGenerationActionEdit ToolImageGenerationAction = "edit" -
const ToolImageGenerationActionAuto ToolImageGenerationAction = "auto"
-
-
Background stringAllows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
const ToolImageGenerationBackgroundTransparent ToolImageGenerationBackground = "transparent" -
const ToolImageGenerationBackgroundOpaque ToolImageGenerationBackground = "opaque" -
const ToolImageGenerationBackgroundAuto ToolImageGenerationBackground = "auto"
-
-
InputFidelity stringControl how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
const ToolImageGenerationInputFidelityHigh ToolImageGenerationInputFidelity = "high" -
const ToolImageGenerationInputFidelityLow ToolImageGenerationInputFidelity = "low"
-
-
InputImageMask ToolImageGenerationInputImageMaskOptional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
FileID stringFile ID for the mask image.
-
ImageURL stringBase64-encoded mask image.
-
-
Model stringThe image generation model to use. Default:
gpt-image-1.-
string -
string-
const ToolImageGenerationModelGPTImage1 ToolImageGenerationModel = "gpt-image-1" -
const ToolImageGenerationModelGPTImage1Mini ToolImageGenerationModel = "gpt-image-1-mini" -
const ToolImageGenerationModelGPTImage2 ToolImageGenerationModel = "gpt-image-2" -
const ToolImageGenerationModelGPTImage2_2026_04_21 ToolImageGenerationModel = "gpt-image-2-2026-04-21" -
const ToolImageGenerationModelGPTImage1_5 ToolImageGenerationModel = "gpt-image-1.5" -
const ToolImageGenerationModelChatgptImageLatest ToolImageGenerationModel = "chatgpt-image-latest"
-
-
-
Moderation stringModeration level for the generated image. Default:
auto.-
const ToolImageGenerationModerationAuto ToolImageGenerationModeration = "auto" -
const ToolImageGenerationModerationLow ToolImageGenerationModeration = "low"
-
-
OutputCompression int64Compression level for the output image. Default: 100.
-
OutputFormat stringThe output format of the generated image. One of
png,webp, orjpeg. Default:png.-
const ToolImageGenerationOutputFormatPNG ToolImageGenerationOutputFormat = "png" -
const ToolImageGenerationOutputFormatWebP ToolImageGenerationOutputFormat = "webp" -
const ToolImageGenerationOutputFormatJPEG ToolImageGenerationOutputFormat = "jpeg"
-
-
PartialImages int64Number of partial images to generate in streaming mode, from 0 (default value) to 3.
-
Quality stringThe quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
const ToolImageGenerationQualityLow ToolImageGenerationQuality = "low" -
const ToolImageGenerationQualityMedium ToolImageGenerationQuality = "medium" -
const ToolImageGenerationQualityHigh ToolImageGenerationQuality = "high" -
const ToolImageGenerationQualityAuto ToolImageGenerationQuality = "auto"
-
-
Size stringThe size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
string -
string-
const ToolImageGenerationSize1024x1024 ToolImageGenerationSize = "1024x1024" -
const ToolImageGenerationSize1024x1536 ToolImageGenerationSize = "1024x1536" -
const ToolImageGenerationSize1536x1024 ToolImageGenerationSize = "1536x1024" -
const ToolImageGenerationSizeAuto ToolImageGenerationSize = "auto"
-
-
-
-
type ToolLocalShell struct{…}A tool that allows the model to execute shell commands in a local environment.
-
Type LocalShellThe type of the local shell tool. Always
local_shell.const LocalShellLocalShell LocalShell = "local_shell"
-
-
type FunctionShellTool struct{…}A tool that allows the model to execute shell commands.
-
Type ShellThe type of the shell tool. Always
shell.const ShellShell Shell = "shell"
-
Environment FunctionShellToolEnvironmentUnion-
type ContainerAuto struct{…}-
Type ContainerAutoAutomatically creates a container for this request
const ContainerAutoContainerAuto ContainerAuto = "container_auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit ContainerAutoMemoryLimitThe memory limit for the container.
-
const ContainerAutoMemoryLimit1g ContainerAutoMemoryLimit = "1g" -
const ContainerAutoMemoryLimit4g ContainerAutoMemoryLimit = "4g" -
const ContainerAutoMemoryLimit16g ContainerAutoMemoryLimit = "16g" -
const ContainerAutoMemoryLimit64g ContainerAutoMemoryLimit = "64g"
-
-
NetworkPolicy ContainerAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…} -
type ContainerNetworkPolicyAllowlist struct{…}
-
-
Skills []ContainerAutoSkillUnionAn optional list of skills referenced by id or inline data.
-
type SkillReference struct{…}-
SkillID stringThe ID of the referenced skill.
-
Type SkillReferenceReferences a skill created with the /v1/skills endpoint.
const SkillReferenceSkillReference SkillReference = "skill_reference"
-
Version stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
type InlineSkill struct{…}-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Source InlineSkillSourceInline skill payload
-
Data stringBase64-encoded skill zip bundle.
-
MediaType ApplicationZipThe media type of the inline skill payload. Must be
application/zip.const ApplicationZipApplicationZip ApplicationZip = "application/zip"
-
Type Base64The type of the inline skill source. Must be
base64.const Base64Base64 Base64 = "base64"
-
-
Type InlineDefines an inline skill for this request.
const InlineInline Inline = "inline"
-
-
-
-
type LocalEnvironment struct{…}-
Type LocalUse a local computer environment.
const LocalLocal Local = "local"
-
Skills []LocalSkillAn optional list of skills.
-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Path stringThe path to the directory containing the skill.
-
-
-
type ContainerReference struct{…}-
ContainerID stringThe ID of the referenced container.
-
Type ContainerReferenceReferences a container created with the /v1/containers endpoint
const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
Name stringThe name of the custom tool, used to identify it in tool calls.
-
Type CustomThe type of the custom tool. Always
custom.const CustomCustom Custom = "custom"
-
DeferLoading boolWhether this tool should be deferred and discovered via tool search.
-
Description stringOptional description of the custom tool, used to provide more context.
-
Format CustomToolInputFormatUnionThe input format for the custom tool. Default is unconstrained text.
-
type CustomToolInputFormatText struct{…}Unconstrained free-form text.
-
Type TextUnconstrained text format. Always
text.const TextText Text = "text"
-
-
type CustomToolInputFormatGrammar struct{…}A grammar defined by the user.
-
Definition stringThe grammar definition.
-
Syntax stringThe syntax of the grammar definition. One of
larkorregex.-
const CustomToolInputFormatGrammarSyntaxLark CustomToolInputFormatGrammarSyntax = "lark" -
const CustomToolInputFormatGrammarSyntaxRegex CustomToolInputFormatGrammarSyntax = "regex"
-
-
Type GrammarGrammar format. Always
grammar.const GrammarGrammar Grammar = "grammar"
-
-
-
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
Description stringA description of the namespace shown to the model.
-
Name stringThe namespace name used in tool calls (for example,
crm). -
Tools []NamespaceToolToolUnionThe function/custom tools available inside this namespace.
-
type NamespaceToolToolFunction struct{…}-
Name string -
Type Functionconst FunctionFunction Function = "function"
-
DeferLoading boolWhether this function should be deferred and discovered via tool search.
-
Description string -
Parameters any -
Strict bool
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
-
Type NamespaceThe type of the tool. Always
namespace.const NamespaceNamespace Namespace = "namespace"
-
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
Type ToolSearchThe type of the tool. Always
tool_search.const ToolSearchToolSearch ToolSearch = "tool_search"
-
Description stringDescription shown to the model for a client-executed tool search tool.
-
Execution ToolSearchToolExecutionWhether tool search is executed by the server or by the client.
-
const ToolSearchToolExecutionServer ToolSearchToolExecution = "server" -
const ToolSearchToolExecutionClient ToolSearchToolExecution = "client"
-
-
Parameters anyParameter schema for a client-executed tool search tool.
-
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
Type WebSearchPreviewToolTypeThe type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
const WebSearchPreviewToolTypeWebSearchPreview WebSearchPreviewToolType = "web_search_preview" -
const WebSearchPreviewToolTypeWebSearchPreview2025_03_11 WebSearchPreviewToolType = "web_search_preview_2025_03_11"
-
-
SearchContentTypes []string-
const WebSearchPreviewToolSearchContentTypeText WebSearchPreviewToolSearchContentType = "text" -
const WebSearchPreviewToolSearchContentTypeImage WebSearchPreviewToolSearchContentType = "image"
-
-
SearchContextSize WebSearchPreviewToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchPreviewToolSearchContextSizeLow WebSearchPreviewToolSearchContextSize = "low" -
const WebSearchPreviewToolSearchContextSizeMedium WebSearchPreviewToolSearchContextSize = "medium" -
const WebSearchPreviewToolSearchContextSizeHigh WebSearchPreviewToolSearchContextSize = "high"
-
-
UserLocation WebSearchPreviewToolUserLocationThe user's location.
-
Type ApproximateThe type of location approximation. Always
approximate.const ApproximateApproximate Approximate = "approximate"
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
Type ApplyPatchThe type of the tool. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
-
Type ToolSearchOutputThe type of the item. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseOutputItemAdditionalTools struct{…}-
ID stringThe unique ID of the additional tools item.
-
Role stringThe role that provided the additional tools.
-
const ResponseOutputItemAdditionalToolsRoleUnknown ResponseOutputItemAdditionalToolsRole = "unknown" -
const ResponseOutputItemAdditionalToolsRoleUser ResponseOutputItemAdditionalToolsRole = "user" -
const ResponseOutputItemAdditionalToolsRoleAssistant ResponseOutputItemAdditionalToolsRole = "assistant" -
const ResponseOutputItemAdditionalToolsRoleSystem ResponseOutputItemAdditionalToolsRole = "system" -
const ResponseOutputItemAdditionalToolsRoleCritic ResponseOutputItemAdditionalToolsRole = "critic" -
const ResponseOutputItemAdditionalToolsRoleDiscriminator ResponseOutputItemAdditionalToolsRole = "discriminator" -
const ResponseOutputItemAdditionalToolsRoleDeveloper ResponseOutputItemAdditionalToolsRole = "developer" -
const ResponseOutputItemAdditionalToolsRoleTool ResponseOutputItemAdditionalToolsRole = "tool"
-
-
Tools []ToolUnionThe additional tool definitions made available at this item.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type AdditionalToolsThe type of the item. Always
additional_tools.const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"
-
-
type ResponseCompactionItem struct{…}A compaction item generated by the
v1/responses/compactAPI.-
ID stringThe unique ID of the compaction item.
-
EncryptedContent stringThe encrypted content that was produced by compaction.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseOutputItemImageGenerationCall struct{…}An image generation request made by the model.
-
ID stringThe unique ID of the image generation call.
-
Result stringThe generated image encoded in base64.
-
Status stringThe status of the image generation call.
-
const ResponseOutputItemImageGenerationCallStatusInProgress ResponseOutputItemImageGenerationCallStatus = "in_progress" -
const ResponseOutputItemImageGenerationCallStatusCompleted ResponseOutputItemImageGenerationCallStatus = "completed" -
const ResponseOutputItemImageGenerationCallStatusGenerating ResponseOutputItemImageGenerationCallStatus = "generating" -
const ResponseOutputItemImageGenerationCallStatusFailed ResponseOutputItemImageGenerationCallStatus = "failed"
-
-
Type ImageGenerationCallThe type of the image generation call. Always
image_generation_call.const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"
-
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
ID stringThe unique ID of the code interpreter tool call.
-
Code stringThe code to run, or null if not available.
-
ContainerID stringThe ID of the container used to run the code.
-
Outputs []ResponseCodeInterpreterToolCallOutputUnionThe outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
type ResponseCodeInterpreterToolCallOutputLogs struct{…}The logs output from the code interpreter.
-
Logs stringThe logs output from the code interpreter.
-
Type LogsThe type of the output. Always
logs.const LogsLogs Logs = "logs"
-
-
type ResponseCodeInterpreterToolCallOutputImage struct{…}The image output from the code interpreter.
-
Type ImageThe type of the output. Always
image.const ImageImage Image = "image"
-
URL stringThe URL of the image output from the code interpreter.
-
-
-
Status ResponseCodeInterpreterToolCallStatusThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
const ResponseCodeInterpreterToolCallStatusInProgress ResponseCodeInterpreterToolCallStatus = "in_progress" -
const ResponseCodeInterpreterToolCallStatusCompleted ResponseCodeInterpreterToolCallStatus = "completed" -
const ResponseCodeInterpreterToolCallStatusIncomplete ResponseCodeInterpreterToolCallStatus = "incomplete" -
const ResponseCodeInterpreterToolCallStatusInterpreting ResponseCodeInterpreterToolCallStatus = "interpreting" -
const ResponseCodeInterpreterToolCallStatusFailed ResponseCodeInterpreterToolCallStatus = "failed"
-
-
Type CodeInterpreterCallThe type of the code interpreter tool call. Always
code_interpreter_call.const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"
-
-
type ResponseOutputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
ID stringThe unique ID of the local shell call.
-
Action ResponseOutputItemLocalShellCallActionExecute a shell command on the server.
-
Command []stringThe command to run.
-
Env map[string, string]Environment variables to set for the command.
-
Type ExecThe type of the local shell action. Always
exec.const ExecExec Exec = "exec"
-
TimeoutMs int64Optional timeout in milliseconds for the command.
-
User stringOptional user to run the command as.
-
WorkingDirectory stringOptional working directory to run the command in.
-
-
CallID stringThe unique ID of the local shell tool call generated by the model.
-
Status stringThe status of the local shell call.
-
const ResponseOutputItemLocalShellCallStatusInProgress ResponseOutputItemLocalShellCallStatus = "in_progress" -
const ResponseOutputItemLocalShellCallStatusCompleted ResponseOutputItemLocalShellCallStatus = "completed" -
const ResponseOutputItemLocalShellCallStatusIncomplete ResponseOutputItemLocalShellCallStatus = "incomplete"
-
-
Type LocalShellCallThe type of the local shell call. Always
local_shell_call.const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"
-
-
type ResponseOutputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
ID stringThe unique ID of the local shell tool call generated by the model.
-
Output stringA JSON string of the output of the local shell tool call.
-
Type LocalShellCallOutputThe type of the local shell tool call output. Always
local_shell_call_output.const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete.-
const ResponseOutputItemLocalShellCallOutputStatusInProgress ResponseOutputItemLocalShellCallOutputStatus = "in_progress" -
const ResponseOutputItemLocalShellCallOutputStatusCompleted ResponseOutputItemLocalShellCallOutputStatus = "completed" -
const ResponseOutputItemLocalShellCallOutputStatusIncomplete ResponseOutputItemLocalShellCallOutputStatus = "incomplete"
-
-
-
type ResponseFunctionShellToolCall struct{…}A tool call that executes one or more shell commands in a managed environment.
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Action ResponseFunctionShellToolCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []string -
MaxOutputLength int64Optional maximum number of characters to return from each command.
-
TimeoutMs int64Optional timeout in milliseconds for the commands.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Environment ResponseFunctionShellToolCallEnvironmentUnionRepresents the use of a local environment to perform shell actions.
-
type ResponseLocalEnvironment struct{…}Represents the use of a local environment to perform shell actions.
-
Type LocalThe environment type. Always
local.const LocalLocal Local = "local"
-
-
type ResponseContainerReference struct{…}Represents a container created with /v1/containers.
-
ContainerID string -
Type ContainerReferenceThe environment type. Always
container_reference.const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
Status ResponseFunctionShellToolCallStatusThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallStatusInProgress ResponseFunctionShellToolCallStatus = "in_progress" -
const ResponseFunctionShellToolCallStatusCompleted ResponseFunctionShellToolCallStatus = "completed" -
const ResponseFunctionShellToolCallStatusIncomplete ResponseFunctionShellToolCallStatus = "incomplete"
-
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseFunctionShellToolCallOutput struct{…}The output of a shell tool call that was emitted.
-
ID stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
MaxOutputLength int64The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
Output []ResponseFunctionShellToolCallOutputOutputAn array of shell call output contents
-
Outcome ResponseFunctionShellToolCallOutputOutputOutcomeUnionRepresents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
type ResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64Exit code from the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringThe standard error output that was captured.
-
Stdout stringThe standard output that was captured.
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
Status ResponseFunctionShellToolCallOutputStatusThe status of the shell call output. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallOutputStatusInProgress ResponseFunctionShellToolCallOutputStatus = "in_progress" -
const ResponseFunctionShellToolCallOutputStatusCompleted ResponseFunctionShellToolCallOutputStatus = "completed" -
const ResponseFunctionShellToolCallOutputStatusIncomplete ResponseFunctionShellToolCallOutputStatus = "incomplete"
-
-
Type ShellCallOutputThe type of the shell call output. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseApplyPatchToolCall struct{…}A tool call that applies file diffs by creating, deleting, or updating files.
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseApplyPatchToolCallOperationUnionOne of the create_file, delete_file, or update_file operations applied via apply_patch.
-
type ResponseApplyPatchToolCallOperationCreateFile struct{…}Instruction describing how to create a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to create.
-
Type CreateFileCreate a new file with the provided diff.
const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseApplyPatchToolCallOperationDeleteFile struct{…}Instruction describing how to delete a file via the apply_patch tool.
-
Path stringPath of the file to delete.
-
Type DeleteFileDelete the specified file.
const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseApplyPatchToolCallOperationUpdateFile struct{…}Instruction describing how to update a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to update.
-
Type UpdateFileUpdate an existing file with the provided diff.
const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status ResponseApplyPatchToolCallStatusThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseApplyPatchToolCallStatusInProgress ResponseApplyPatchToolCallStatus = "in_progress" -
const ResponseApplyPatchToolCallStatusCompleted ResponseApplyPatchToolCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseApplyPatchToolCallOutput struct{…}The output emitted by an apply patch tool call.
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status ResponseApplyPatchToolCallOutputStatusThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseApplyPatchToolCallOutputStatusCompleted ResponseApplyPatchToolCallOutputStatus = "completed" -
const ResponseApplyPatchToolCallOutputStatusFailed ResponseApplyPatchToolCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
CreatedBy stringThe ID of the entity that created this tool call output.
-
Output stringOptional textual output returned by the apply patch tool.
-
-
type ResponseOutputItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
ID stringThe unique ID of the tool call.
-
Arguments stringA JSON string of the arguments passed to the tool.
-
Name stringThe name of the tool that was run.
-
ServerLabel stringThe label of the MCP server running the tool.
-
Type McpCallThe type of the item. Always
mcp_call.const McpCallMcpCall McpCall = "mcp_call"
-
ApprovalRequestID stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
Error stringThe error from the tool call, if any.
-
Output stringThe output from the tool call.
-
Status stringThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
const ResponseOutputItemMcpCallStatusInProgress ResponseOutputItemMcpCallStatus = "in_progress" -
const ResponseOutputItemMcpCallStatusCompleted ResponseOutputItemMcpCallStatus = "completed" -
const ResponseOutputItemMcpCallStatusIncomplete ResponseOutputItemMcpCallStatus = "incomplete" -
const ResponseOutputItemMcpCallStatusCalling ResponseOutputItemMcpCallStatus = "calling" -
const ResponseOutputItemMcpCallStatusFailed ResponseOutputItemMcpCallStatus = "failed"
-
-
-
type ResponseOutputItemMcpListTools struct{…}A list of tools available on an MCP server.
-
ID stringThe unique ID of the list.
-
ServerLabel stringThe label of the MCP server.
-
Tools []ResponseOutputItemMcpListToolsToolThe tools available on the server.
-
InputSchema anyThe JSON schema describing the tool's input.
-
Name stringThe name of the tool.
-
Annotations anyAdditional annotations about the tool.
-
Description stringThe description of the tool.
-
-
Type McpListToolsThe type of the item. Always
mcp_list_tools.const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
-
Error stringError message if the server could not list tools.
-
-
type ResponseOutputItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
ID stringThe unique ID of the approval request.
-
Arguments stringA JSON string of arguments for the tool.
-
Name stringThe name of the tool to run.
-
ServerLabel stringThe label of the MCP server making the request.
-
Type McpApprovalRequestThe type of the item. Always
mcp_approval_request.const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"
-
-
type ResponseOutputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
ID stringThe unique ID of the approval response
-
ApprovalRequestID stringThe ID of the approval request being answered.
-
Approve boolWhether the request was approved.
-
Type McpApprovalResponseThe type of the item. Always
mcp_approval_response.const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
-
Reason stringOptional reason for the decision.
-
-
type ResponseCustomToolCall struct{…}A call to a custom tool created by the model.
-
CallID stringAn identifier used to map this custom tool call to a tool call output.
-
Input stringThe input for the custom tool call generated by the model.
-
Name stringThe name of the custom tool being called.
-
Type CustomToolCallThe type of the custom tool call. Always
custom_tool_call.const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"
-
ID stringThe unique ID of the custom tool call in the OpenAI platform.
-
Namespace stringThe namespace of the custom tool being called.
-
-
type ResponseCustomToolCallOutputItem struct{…}The output of a custom tool call from your code, being sent back to the model.
-
ID stringThe unique ID of the custom tool call output item.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseCustomToolCallOutputItemStatusInProgress ResponseCustomToolCallOutputItemStatus = "in_progress" -
const ResponseCustomToolCallOutputItemStatusCompleted ResponseCustomToolCallOutputItemStatus = "completed" -
const ResponseCustomToolCallOutputItemStatusIncomplete ResponseCustomToolCallOutputItemStatus = "incomplete"
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
-
OutputIndex int64The index of the output item that was added.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseOutputItemAddedThe type of the event. Always
response.output_item.added.const ResponseOutputItemAddedResponseOutputItemAdded ResponseOutputItemAdded = "response.output_item.added"
-
Response Output Item Done Event
-
type ResponseOutputItemDoneEvent struct{…}Emitted when an output item is marked done.
-
Item ResponseOutputItemUnionThe output item that was marked done.
-
type ResponseOutputMessage struct{…}An output message from the model.
-
ID stringThe unique ID of the output message.
-
Content []ResponseOutputMessageContentUnionThe content of the output message.
-
type ResponseOutputText struct{…}A text output from the model.
-
Annotations []ResponseOutputTextAnnotationUnionThe annotations of the text output.
-
type ResponseOutputTextAnnotationFileCitation struct{…}A citation to a file.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the file cited.
-
Index int64The index of the file in the list of files.
-
Type FileCitationThe type of the file citation. Always
file_citation.const FileCitationFileCitation FileCitation = "file_citation"
-
-
type ResponseOutputTextAnnotationURLCitation struct{…}A citation for a web resource used to generate a model response.
-
EndIndex int64The index of the last character of the URL citation in the message.
-
StartIndex int64The index of the first character of the URL citation in the message.
-
Title stringThe title of the web resource.
-
Type URLCitationThe type of the URL citation. Always
url_citation.const URLCitationURLCitation URLCitation = "url_citation"
-
URL stringThe URL of the web resource.
-
-
type ResponseOutputTextAnnotationContainerFileCitation struct{…}A citation for a container file used to generate a model response.
-
ContainerID stringThe ID of the container file.
-
EndIndex int64The index of the last character of the container file citation in the message.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the container file cited.
-
StartIndex int64The index of the first character of the container file citation in the message.
-
Type ContainerFileCitationThe type of the container file citation. Always
container_file_citation.const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"
-
-
type ResponseOutputTextAnnotationFilePath struct{…}A path to a file.
-
FileID stringThe ID of the file.
-
Index int64The index of the file in the list of files.
-
Type FilePathThe type of the file path. Always
file_path.const FilePathFilePath FilePath = "file_path"
-
-
-
Text stringThe text output from the model.
-
Type OutputTextThe type of the output text. Always
output_text.const OutputTextOutputText OutputText = "output_text"
-
Logprobs []ResponseOutputTextLogprob-
Token string -
Bytes []int64 -
Logprob float64 -
TopLogprobs []ResponseOutputTextLogprobTopLogprob-
Token string -
Bytes []int64 -
Logprob float64
-
-
-
-
type ResponseOutputRefusal struct{…}A refusal from the model.
-
Refusal stringThe refusal explanation from the model.
-
Type RefusalThe type of the refusal. Always
refusal.const RefusalRefusal Refusal = "refusal"
-
-
-
Role AssistantThe role of the output message. Always
assistant.const AssistantAssistant Assistant = "assistant"
-
Status ResponseOutputMessageStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseOutputMessageStatusInProgress ResponseOutputMessageStatus = "in_progress" -
const ResponseOutputMessageStatusCompleted ResponseOutputMessageStatus = "completed" -
const ResponseOutputMessageStatusIncomplete ResponseOutputMessageStatus = "incomplete"
-
-
Type MessageThe type of the output message. Always
message.const MessageMessage Message = "message"
-
Phase ResponseOutputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const ResponseOutputMessagePhaseCommentary ResponseOutputMessagePhase = "commentary" -
const ResponseOutputMessagePhaseFinalAnswer ResponseOutputMessagePhase = "final_answer"
-
-
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
ID stringThe unique ID of the file search tool call.
-
Queries []stringThe queries used to search for files.
-
Status ResponseFileSearchToolCallStatusThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
const ResponseFileSearchToolCallStatusInProgress ResponseFileSearchToolCallStatus = "in_progress" -
const ResponseFileSearchToolCallStatusSearching ResponseFileSearchToolCallStatus = "searching" -
const ResponseFileSearchToolCallStatusCompleted ResponseFileSearchToolCallStatus = "completed" -
const ResponseFileSearchToolCallStatusIncomplete ResponseFileSearchToolCallStatus = "incomplete" -
const ResponseFileSearchToolCallStatusFailed ResponseFileSearchToolCallStatus = "failed"
-
-
Type FileSearchCallThe type of the file search tool call. Always
file_search_call.const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"
-
Results []ResponseFileSearchToolCallResultThe results of the file search tool call.
-
Attributes map[string, ResponseFileSearchToolCallResultAttributeUnion]Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.
-
string -
float64 -
bool
-
-
FileID stringThe unique ID of the file.
-
Filename stringThe name of the file.
-
Score float64The relevance score of the file - a value between 0 and 1.
-
Text stringThe text that was retrieved from the file.
-
-
-
type ResponseFunctionToolCall struct{…}A tool call to run a function. See the function calling guide for more information.
-
Arguments stringA JSON string of the arguments to pass to the function.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Name stringThe name of the function to run.
-
Type FunctionCallThe type of the function tool call. Always
function_call.const FunctionCallFunctionCall FunctionCall = "function_call"
-
ID stringThe unique ID of the function tool call.
-
Namespace stringThe namespace of the function to run.
-
Status ResponseFunctionToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallStatusInProgress ResponseFunctionToolCallStatus = "in_progress" -
const ResponseFunctionToolCallStatusCompleted ResponseFunctionToolCallStatus = "completed" -
const ResponseFunctionToolCallStatusIncomplete ResponseFunctionToolCallStatus = "incomplete"
-
-
-
type ResponseFunctionToolCallOutputItem struct{…}-
ID stringThe unique ID of the function call tool output.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseFunctionToolCallOutputItemOutputUnionThe output from the function call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseFunctionToolCallOutputItemOutputOutputContentList []ResponseFunctionToolCallOutputItemOutputOutputContentListItemUnionText, image, or file output of the function call.
-
type ResponseInputText struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
Detail ResponseInputImageDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageDetailLow ResponseInputImageDetail = "low" -
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high" -
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto" -
const ResponseInputImageDetailOriginal ResponseInputImageDetail = "original"
-
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFile struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileDetailLow ResponseInputFileDetail = "low" -
const ResponseInputFileDetailHigh ResponseInputFileDetail = "high"
-
-
FileData stringThe content of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Status ResponseFunctionToolCallOutputItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallOutputItemStatusInProgress ResponseFunctionToolCallOutputItemStatus = "in_progress" -
const ResponseFunctionToolCallOutputItemStatusCompleted ResponseFunctionToolCallOutputItemStatus = "completed" -
const ResponseFunctionToolCallOutputItemStatusIncomplete ResponseFunctionToolCallOutputItemStatus = "incomplete"
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
ID stringThe unique ID of the web search tool call.
-
Action ResponseFunctionWebSearchActionUnionAn object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
type ResponseFunctionWebSearchActionSearch struct{…}Action type "search" - Performs a web search query.
-
Type SearchThe action type.
const SearchSearch Search = "search"
-
Queries []stringThe search queries.
-
Query stringThe search query.
-
Sources []ResponseFunctionWebSearchActionSearchSourceThe sources used in the search.
-
Type URLThe type of source. Always
url.const URLURL URL = "url"
-
URL stringThe URL of the source.
-
-
-
type ResponseFunctionWebSearchActionOpenPage struct{…}Action type "open_page" - Opens a specific URL from search results.
-
Type OpenPageThe action type.
const OpenPageOpenPage OpenPage = "open_page"
-
URL stringThe URL opened by the model.
-
-
type ResponseFunctionWebSearchActionFindInPage struct{…}Action type "find_in_page": Searches for a pattern within a loaded page.
-
Pattern stringThe pattern or text to search for within the page.
-
Type FindInPageThe action type.
const FindInPageFindInPage FindInPage = "find_in_page"
-
URL stringThe URL of the page searched for the pattern.
-
-
-
Status ResponseFunctionWebSearchStatusThe status of the web search tool call.
-
const ResponseFunctionWebSearchStatusInProgress ResponseFunctionWebSearchStatus = "in_progress" -
const ResponseFunctionWebSearchStatusSearching ResponseFunctionWebSearchStatus = "searching" -
const ResponseFunctionWebSearchStatusCompleted ResponseFunctionWebSearchStatus = "completed" -
const ResponseFunctionWebSearchStatusFailed ResponseFunctionWebSearchStatus = "failed"
-
-
Type WebSearchCallThe type of the web search tool call. Always
web_search_call.const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"
-
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
ID stringThe unique ID of the computer call.
-
CallID stringAn identifier used when responding to the tool call with output.
-
PendingSafetyChecks []ResponseComputerToolCallPendingSafetyCheckThe pending safety checks for the computer call.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status ResponseComputerToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseComputerToolCallStatusInProgress ResponseComputerToolCallStatus = "in_progress" -
const ResponseComputerToolCallStatusCompleted ResponseComputerToolCallStatus = "completed" -
const ResponseComputerToolCallStatusIncomplete ResponseComputerToolCallStatus = "incomplete"
-
-
Type ResponseComputerToolCallTypeThe type of the computer call. Always
computer_call.const ResponseComputerToolCallTypeComputerCall ResponseComputerToolCallType = "computer_call"
-
Action ResponseComputerToolCallActionUnionA click action.
-
type ResponseComputerToolCallActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ResponseComputerToolCallActionClickButtonLeft ResponseComputerToolCallActionClickButton = "left" -
const ResponseComputerToolCallActionClickButtonRight ResponseComputerToolCallActionClickButton = "right" -
const ResponseComputerToolCallActionClickButtonWheel ResponseComputerToolCallActionClickButton = "wheel" -
const ResponseComputerToolCallActionClickButtonBack ResponseComputerToolCallActionClickButton = "back" -
const ResponseComputerToolCallActionClickButtonForward ResponseComputerToolCallActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ResponseComputerToolCallActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ResponseComputerToolCallActionDrag struct{…}A drag action.
-
Path []ResponseComputerToolCallActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ResponseComputerToolCallActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ResponseComputerToolCallActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ResponseComputerToolCallActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ResponseComputerToolCallActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ResponseComputerToolCallActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ResponseComputerToolCallActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
Actions ComputerActionListFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
type ComputerActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ComputerActionClickButtonLeft ComputerActionClickButton = "left" -
const ComputerActionClickButtonRight ComputerActionClickButton = "right" -
const ComputerActionClickButtonWheel ComputerActionClickButton = "wheel" -
const ComputerActionClickButtonBack ComputerActionClickButton = "back" -
const ComputerActionClickButtonForward ComputerActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ComputerActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ComputerActionDrag struct{…}A drag action.
-
Path []ComputerActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ComputerActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ComputerActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ComputerActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ComputerActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ComputerActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ComputerActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
-
type ResponseComputerToolCallOutputItem struct{…}-
ID stringThe unique ID of the computer call tool output.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Type ComputerScreenshotSpecifies the event type. For a computer screenshot, this property is always set to
computer_screenshot.const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"
-
FileID stringThe identifier of an uploaded file that contains the screenshot.
-
ImageURL stringThe URL of the screenshot image.
-
-
Status ResponseComputerToolCallOutputItemStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseComputerToolCallOutputItemStatusCompleted ResponseComputerToolCallOutputItemStatus = "completed" -
const ResponseComputerToolCallOutputItemStatusIncomplete ResponseComputerToolCallOutputItemStatus = "incomplete" -
const ResponseComputerToolCallOutputItemStatusFailed ResponseComputerToolCallOutputItemStatus = "failed" -
const ResponseComputerToolCallOutputItemStatusInProgress ResponseComputerToolCallOutputItemStatus = "in_progress"
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
AcknowledgedSafetyChecks []ResponseComputerToolCallOutputItemAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
ID stringThe unique identifier of the reasoning content.
-
Summary []ResponseReasoningItemSummaryReasoning summary content.
-
Text stringA summary of the reasoning output from the model so far.
-
Type SummaryTextThe type of the object. Always
summary_text.const SummaryTextSummaryText SummaryText = "summary_text"
-
-
Type ReasoningThe type of the object. Always
reasoning.const ReasoningReasoning Reasoning = "reasoning"
-
Content []ResponseReasoningItemContentReasoning text content.
-
Text stringThe reasoning text from the model.
-
Type ReasoningTextThe type of the reasoning text. Always
reasoning_text.const ReasoningTextReasoningText ReasoningText = "reasoning_text"
-
-
EncryptedContent stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
Status ResponseReasoningItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseReasoningItemStatusInProgress ResponseReasoningItemStatus = "in_progress" -
const ResponseReasoningItemStatusCompleted ResponseReasoningItemStatus = "completed" -
const ResponseReasoningItemStatusIncomplete ResponseReasoningItemStatus = "incomplete"
-
-
-
type ResponseToolSearchCall struct{…}-
ID stringThe unique ID of the tool search call item.
-
Arguments anyArguments used for the tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchCallExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchCallExecutionServer ResponseToolSearchCallExecution = "server" -
const ResponseToolSearchCallExecutionClient ResponseToolSearchCallExecution = "client"
-
-
Status ResponseToolSearchCallStatusThe status of the tool search call item that was recorded.
-
const ResponseToolSearchCallStatusInProgress ResponseToolSearchCallStatus = "in_progress" -
const ResponseToolSearchCallStatusCompleted ResponseToolSearchCallStatus = "completed" -
const ResponseToolSearchCallStatusIncomplete ResponseToolSearchCallStatus = "incomplete"
-
-
Type ToolSearchCallThe type of the item. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseToolSearchOutputItem struct{…}-
ID stringThe unique ID of the tool search output item.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemExecutionServer ResponseToolSearchOutputItemExecution = "server" -
const ResponseToolSearchOutputItemExecutionClient ResponseToolSearchOutputItemExecution = "client"
-
-
Status ResponseToolSearchOutputItemStatusThe status of the tool search output item that was recorded.
-
const ResponseToolSearchOutputItemStatusInProgress ResponseToolSearchOutputItemStatus = "in_progress" -
const ResponseToolSearchOutputItemStatusCompleted ResponseToolSearchOutputItemStatus = "completed" -
const ResponseToolSearchOutputItemStatusIncomplete ResponseToolSearchOutputItemStatus = "incomplete"
-
-
Tools []ToolUnionThe loaded tool definitions returned by tool search.
-
type FunctionTool struct{…}Defines a function in your own code the model can choose to call. Learn more about function calling.
-
Name stringThe name of the function to call.
-
Parameters map[string, any]A JSON schema object describing the parameters of the function.
-
Strict boolWhether to enforce strict parameter validation. Default
true. -
Type FunctionThe type of the function tool. Always
function.const FunctionFunction Function = "function"
-
DeferLoading boolWhether this function is deferred and loaded via tool search.
-
Description stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
type FileSearchTool struct{…}A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
Type FileSearchThe type of the file search tool. Always
file_search.const FileSearchFileSearch FileSearch = "file_search"
-
VectorStoreIDs []stringThe IDs of the vector stores to search.
-
Filters FileSearchToolFiltersUnionA filter to apply.
-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
Key stringThe key to compare against the value.
-
Type ComparisonFilterTypeSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
const ComparisonFilterTypeEq ComparisonFilterType = "eq" -
const ComparisonFilterTypeNe ComparisonFilterType = "ne" -
const ComparisonFilterTypeGt ComparisonFilterType = "gt" -
const ComparisonFilterTypeGte ComparisonFilterType = "gte" -
const ComparisonFilterTypeLt ComparisonFilterType = "lt" -
const ComparisonFilterTypeLte ComparisonFilterType = "lte" -
const ComparisonFilterTypeIn ComparisonFilterType = "in" -
const ComparisonFilterTypeNin ComparisonFilterType = "nin"
-
-
Value ComparisonFilterValueUnionThe value to compare against the attribute key; supports string, number, or boolean types.
-
string -
float64 -
bool -
type ComparisonFilterValueArray []ComparisonFilterValueArrayItemUnion-
string -
float64
-
-
-
-
type CompoundFilter struct{…}Combine multiple filters using
andoror.-
Filters []ComparisonFilterArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
-
Type CompoundFilterTypeType of operation:
andoror.-
const CompoundFilterTypeAnd CompoundFilterType = "and" -
const CompoundFilterTypeOr CompoundFilterType = "or"
-
-
-
-
MaxNumResults int64The maximum number of results to return. This number should be between 1 and 50 inclusive.
-
RankingOptions FileSearchToolRankingOptionsRanking options for search.
-
HybridSearch FileSearchToolRankingOptionsHybridSearchWeights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
EmbeddingWeight float64The weight of the embedding in the reciprocal ranking fusion.
-
TextWeight float64The weight of the text in the reciprocal ranking fusion.
-
-
Ranker stringThe ranker to use for the file search.
-
const FileSearchToolRankingOptionsRankerAuto FileSearchToolRankingOptionsRanker = "auto" -
const FileSearchToolRankingOptionsRankerDefault2024_11_15 FileSearchToolRankingOptionsRanker = "default-2024-11-15"
-
-
ScoreThreshold float64The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
Type ComputerThe type of the computer tool. Always
computer.const ComputerComputer Computer = "computer"
-
-
type ComputerUsePreviewTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
DisplayHeight int64The height of the computer display.
-
DisplayWidth int64The width of the computer display.
-
Environment ComputerUsePreviewToolEnvironmentThe type of computer environment to control.
-
const ComputerUsePreviewToolEnvironmentWindows ComputerUsePreviewToolEnvironment = "windows" -
const ComputerUsePreviewToolEnvironmentMac ComputerUsePreviewToolEnvironment = "mac" -
const ComputerUsePreviewToolEnvironmentLinux ComputerUsePreviewToolEnvironment = "linux" -
const ComputerUsePreviewToolEnvironmentUbuntu ComputerUsePreviewToolEnvironment = "ubuntu" -
const ComputerUsePreviewToolEnvironmentBrowser ComputerUsePreviewToolEnvironment = "browser"
-
-
Type ComputerUsePreviewThe type of the computer use tool. Always
computer_use_preview.const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"
-
-
type WebSearchTool struct{…}Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
Type WebSearchToolTypeThe type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
const WebSearchToolTypeWebSearch WebSearchToolType = "web_search" -
const WebSearchToolTypeWebSearch2025_08_26 WebSearchToolType = "web_search_2025_08_26"
-
-
Filters WebSearchToolFiltersFilters for the search.
-
AllowedDomains []stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
SearchContextSize WebSearchToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchToolSearchContextSizeLow WebSearchToolSearchContextSize = "low" -
const WebSearchToolSearchContextSizeMedium WebSearchToolSearchContextSize = "medium" -
const WebSearchToolSearchContextSizeHigh WebSearchToolSearchContextSize = "high"
-
-
UserLocation WebSearchToolUserLocationThe approximate location of the user.
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
Type stringThe type of location approximation. Always
approximate.const WebSearchToolUserLocationTypeApproximate WebSearchToolUserLocationType = "approximate"
-
-
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
ServerLabel stringA label for this MCP server, used to identify it in tool calls.
-
Type McpThe type of the MCP tool. Always
mcp.const McpMcp Mcp = "mcp"
-
AllowedTools ToolMcpAllowedToolsUnionList of allowed tool names or a filter object.
-
type ToolMcpAllowedToolsMcpAllowedTools []stringA string array of allowed tool names
-
type ToolMcpAllowedToolsMcpToolFilter struct{…}A filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
Authorization stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
ConnectorID stringIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
const ToolMcpConnectorIDConnectorDropbox ToolMcpConnectorID = "connector_dropbox" -
const ToolMcpConnectorIDConnectorGmail ToolMcpConnectorID = "connector_gmail" -
const ToolMcpConnectorIDConnectorGooglecalendar ToolMcpConnectorID = "connector_googlecalendar" -
const ToolMcpConnectorIDConnectorGoogledrive ToolMcpConnectorID = "connector_googledrive" -
const ToolMcpConnectorIDConnectorMicrosoftteams ToolMcpConnectorID = "connector_microsoftteams" -
const ToolMcpConnectorIDConnectorOutlookcalendar ToolMcpConnectorID = "connector_outlookcalendar" -
const ToolMcpConnectorIDConnectorOutlookemail ToolMcpConnectorID = "connector_outlookemail" -
const ToolMcpConnectorIDConnectorSharepoint ToolMcpConnectorID = "connector_sharepoint"
-
-
DeferLoading boolWhether this MCP tool is deferred and discovered via tool search.
-
Headers map[string, string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
RequireApproval ToolMcpRequireApprovalUnionSpecify which of the MCP server's tools require approval.
-
type ToolMcpRequireApprovalMcpToolApprovalFilter 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.-
Always ToolMcpRequireApprovalMcpToolApprovalFilterAlwaysA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
Never ToolMcpRequireApprovalMcpToolApprovalFilterNeverA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
type ToolMcpRequireApprovalMcpToolApprovalSetting stringSpecify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
const ToolMcpRequireApprovalMcpToolApprovalSettingAlways ToolMcpRequireApprovalMcpToolApprovalSetting = "always" -
const ToolMcpRequireApprovalMcpToolApprovalSettingNever ToolMcpRequireApprovalMcpToolApprovalSetting = "never"
-
-
-
ServerDescription stringOptional description of the MCP server, used to provide more context.
-
ServerURL stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
TunnelID stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
Container ToolCodeInterpreterContainerUnionThe code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
string -
type ToolCodeInterpreterContainerCodeInterpreterContainerAuto struct{…}Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
Type AutoAlways
auto.const AutoAuto Auto = "auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit stringThe memory limit for the code interpreter container.
-
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"
-
-
NetworkPolicy ToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…}-
Type DisabledDisable outbound network access. Always
disabled.const DisabledDisabled Disabled = "disabled"
-
-
type ContainerNetworkPolicyAllowlist struct{…}-
AllowedDomains []stringA list of allowed domains when type is
allowlist. -
Type AllowlistAllow outbound network access only to specified domains. Always
allowlist.const AllowlistAllowlist Allowlist = "allowlist"
-
DomainSecrets []ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
Domain stringThe domain associated with the secret.
-
Name stringThe name of the secret to inject for the domain.
-
Value stringThe secret value to inject for the domain.
-
-
-
-
-
-
Type CodeInterpreterThe type of the code interpreter tool. Always
code_interpreter.const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"
-
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
Type ImageGenerationThe type of the image generation tool. Always
image_generation.const ImageGenerationImageGeneration ImageGeneration = "image_generation"
-
Action stringWhether to generate a new image or edit an existing image. Default:
auto.-
const ToolImageGenerationActionGenerate ToolImageGenerationAction = "generate" -
const ToolImageGenerationActionEdit ToolImageGenerationAction = "edit" -
const ToolImageGenerationActionAuto ToolImageGenerationAction = "auto"
-
-
Background stringAllows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
const ToolImageGenerationBackgroundTransparent ToolImageGenerationBackground = "transparent" -
const ToolImageGenerationBackgroundOpaque ToolImageGenerationBackground = "opaque" -
const ToolImageGenerationBackgroundAuto ToolImageGenerationBackground = "auto"
-
-
InputFidelity stringControl how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
const ToolImageGenerationInputFidelityHigh ToolImageGenerationInputFidelity = "high" -
const ToolImageGenerationInputFidelityLow ToolImageGenerationInputFidelity = "low"
-
-
InputImageMask ToolImageGenerationInputImageMaskOptional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
FileID stringFile ID for the mask image.
-
ImageURL stringBase64-encoded mask image.
-
-
Model stringThe image generation model to use. Default:
gpt-image-1.-
string -
string-
const ToolImageGenerationModelGPTImage1 ToolImageGenerationModel = "gpt-image-1" -
const ToolImageGenerationModelGPTImage1Mini ToolImageGenerationModel = "gpt-image-1-mini" -
const ToolImageGenerationModelGPTImage2 ToolImageGenerationModel = "gpt-image-2" -
const ToolImageGenerationModelGPTImage2_2026_04_21 ToolImageGenerationModel = "gpt-image-2-2026-04-21" -
const ToolImageGenerationModelGPTImage1_5 ToolImageGenerationModel = "gpt-image-1.5" -
const ToolImageGenerationModelChatgptImageLatest ToolImageGenerationModel = "chatgpt-image-latest"
-
-
-
Moderation stringModeration level for the generated image. Default:
auto.-
const ToolImageGenerationModerationAuto ToolImageGenerationModeration = "auto" -
const ToolImageGenerationModerationLow ToolImageGenerationModeration = "low"
-
-
OutputCompression int64Compression level for the output image. Default: 100.
-
OutputFormat stringThe output format of the generated image. One of
png,webp, orjpeg. Default:png.-
const ToolImageGenerationOutputFormatPNG ToolImageGenerationOutputFormat = "png" -
const ToolImageGenerationOutputFormatWebP ToolImageGenerationOutputFormat = "webp" -
const ToolImageGenerationOutputFormatJPEG ToolImageGenerationOutputFormat = "jpeg"
-
-
PartialImages int64Number of partial images to generate in streaming mode, from 0 (default value) to 3.
-
Quality stringThe quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
const ToolImageGenerationQualityLow ToolImageGenerationQuality = "low" -
const ToolImageGenerationQualityMedium ToolImageGenerationQuality = "medium" -
const ToolImageGenerationQualityHigh ToolImageGenerationQuality = "high" -
const ToolImageGenerationQualityAuto ToolImageGenerationQuality = "auto"
-
-
Size stringThe size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
string -
string-
const ToolImageGenerationSize1024x1024 ToolImageGenerationSize = "1024x1024" -
const ToolImageGenerationSize1024x1536 ToolImageGenerationSize = "1024x1536" -
const ToolImageGenerationSize1536x1024 ToolImageGenerationSize = "1536x1024" -
const ToolImageGenerationSizeAuto ToolImageGenerationSize = "auto"
-
-
-
-
type ToolLocalShell struct{…}A tool that allows the model to execute shell commands in a local environment.
-
Type LocalShellThe type of the local shell tool. Always
local_shell.const LocalShellLocalShell LocalShell = "local_shell"
-
-
type FunctionShellTool struct{…}A tool that allows the model to execute shell commands.
-
Type ShellThe type of the shell tool. Always
shell.const ShellShell Shell = "shell"
-
Environment FunctionShellToolEnvironmentUnion-
type ContainerAuto struct{…}-
Type ContainerAutoAutomatically creates a container for this request
const ContainerAutoContainerAuto ContainerAuto = "container_auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit ContainerAutoMemoryLimitThe memory limit for the container.
-
const ContainerAutoMemoryLimit1g ContainerAutoMemoryLimit = "1g" -
const ContainerAutoMemoryLimit4g ContainerAutoMemoryLimit = "4g" -
const ContainerAutoMemoryLimit16g ContainerAutoMemoryLimit = "16g" -
const ContainerAutoMemoryLimit64g ContainerAutoMemoryLimit = "64g"
-
-
NetworkPolicy ContainerAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…} -
type ContainerNetworkPolicyAllowlist struct{…}
-
-
Skills []ContainerAutoSkillUnionAn optional list of skills referenced by id or inline data.
-
type SkillReference struct{…}-
SkillID stringThe ID of the referenced skill.
-
Type SkillReferenceReferences a skill created with the /v1/skills endpoint.
const SkillReferenceSkillReference SkillReference = "skill_reference"
-
Version stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
type InlineSkill struct{…}-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Source InlineSkillSourceInline skill payload
-
Data stringBase64-encoded skill zip bundle.
-
MediaType ApplicationZipThe media type of the inline skill payload. Must be
application/zip.const ApplicationZipApplicationZip ApplicationZip = "application/zip"
-
Type Base64The type of the inline skill source. Must be
base64.const Base64Base64 Base64 = "base64"
-
-
Type InlineDefines an inline skill for this request.
const InlineInline Inline = "inline"
-
-
-
-
type LocalEnvironment struct{…}-
Type LocalUse a local computer environment.
const LocalLocal Local = "local"
-
Skills []LocalSkillAn optional list of skills.
-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Path stringThe path to the directory containing the skill.
-
-
-
type ContainerReference struct{…}-
ContainerID stringThe ID of the referenced container.
-
Type ContainerReferenceReferences a container created with the /v1/containers endpoint
const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
Name stringThe name of the custom tool, used to identify it in tool calls.
-
Type CustomThe type of the custom tool. Always
custom.const CustomCustom Custom = "custom"
-
DeferLoading boolWhether this tool should be deferred and discovered via tool search.
-
Description stringOptional description of the custom tool, used to provide more context.
-
Format CustomToolInputFormatUnionThe input format for the custom tool. Default is unconstrained text.
-
type CustomToolInputFormatText struct{…}Unconstrained free-form text.
-
Type TextUnconstrained text format. Always
text.const TextText Text = "text"
-
-
type CustomToolInputFormatGrammar struct{…}A grammar defined by the user.
-
Definition stringThe grammar definition.
-
Syntax stringThe syntax of the grammar definition. One of
larkorregex.-
const CustomToolInputFormatGrammarSyntaxLark CustomToolInputFormatGrammarSyntax = "lark" -
const CustomToolInputFormatGrammarSyntaxRegex CustomToolInputFormatGrammarSyntax = "regex"
-
-
Type GrammarGrammar format. Always
grammar.const GrammarGrammar Grammar = "grammar"
-
-
-
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
Description stringA description of the namespace shown to the model.
-
Name stringThe namespace name used in tool calls (for example,
crm). -
Tools []NamespaceToolToolUnionThe function/custom tools available inside this namespace.
-
type NamespaceToolToolFunction struct{…}-
Name string -
Type Functionconst FunctionFunction Function = "function"
-
DeferLoading boolWhether this function should be deferred and discovered via tool search.
-
Description string -
Parameters any -
Strict bool
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
-
Type NamespaceThe type of the tool. Always
namespace.const NamespaceNamespace Namespace = "namespace"
-
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
Type ToolSearchThe type of the tool. Always
tool_search.const ToolSearchToolSearch ToolSearch = "tool_search"
-
Description stringDescription shown to the model for a client-executed tool search tool.
-
Execution ToolSearchToolExecutionWhether tool search is executed by the server or by the client.
-
const ToolSearchToolExecutionServer ToolSearchToolExecution = "server" -
const ToolSearchToolExecutionClient ToolSearchToolExecution = "client"
-
-
Parameters anyParameter schema for a client-executed tool search tool.
-
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
Type WebSearchPreviewToolTypeThe type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
const WebSearchPreviewToolTypeWebSearchPreview WebSearchPreviewToolType = "web_search_preview" -
const WebSearchPreviewToolTypeWebSearchPreview2025_03_11 WebSearchPreviewToolType = "web_search_preview_2025_03_11"
-
-
SearchContentTypes []string-
const WebSearchPreviewToolSearchContentTypeText WebSearchPreviewToolSearchContentType = "text" -
const WebSearchPreviewToolSearchContentTypeImage WebSearchPreviewToolSearchContentType = "image"
-
-
SearchContextSize WebSearchPreviewToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchPreviewToolSearchContextSizeLow WebSearchPreviewToolSearchContextSize = "low" -
const WebSearchPreviewToolSearchContextSizeMedium WebSearchPreviewToolSearchContextSize = "medium" -
const WebSearchPreviewToolSearchContextSizeHigh WebSearchPreviewToolSearchContextSize = "high"
-
-
UserLocation WebSearchPreviewToolUserLocationThe user's location.
-
Type ApproximateThe type of location approximation. Always
approximate.const ApproximateApproximate Approximate = "approximate"
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
Type ApplyPatchThe type of the tool. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
-
Type ToolSearchOutputThe type of the item. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseOutputItemAdditionalTools struct{…}-
ID stringThe unique ID of the additional tools item.
-
Role stringThe role that provided the additional tools.
-
const ResponseOutputItemAdditionalToolsRoleUnknown ResponseOutputItemAdditionalToolsRole = "unknown" -
const ResponseOutputItemAdditionalToolsRoleUser ResponseOutputItemAdditionalToolsRole = "user" -
const ResponseOutputItemAdditionalToolsRoleAssistant ResponseOutputItemAdditionalToolsRole = "assistant" -
const ResponseOutputItemAdditionalToolsRoleSystem ResponseOutputItemAdditionalToolsRole = "system" -
const ResponseOutputItemAdditionalToolsRoleCritic ResponseOutputItemAdditionalToolsRole = "critic" -
const ResponseOutputItemAdditionalToolsRoleDiscriminator ResponseOutputItemAdditionalToolsRole = "discriminator" -
const ResponseOutputItemAdditionalToolsRoleDeveloper ResponseOutputItemAdditionalToolsRole = "developer" -
const ResponseOutputItemAdditionalToolsRoleTool ResponseOutputItemAdditionalToolsRole = "tool"
-
-
Tools []ToolUnionThe additional tool definitions made available at this item.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type AdditionalToolsThe type of the item. Always
additional_tools.const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"
-
-
type ResponseCompactionItem struct{…}A compaction item generated by the
v1/responses/compactAPI.-
ID stringThe unique ID of the compaction item.
-
EncryptedContent stringThe encrypted content that was produced by compaction.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseOutputItemImageGenerationCall struct{…}An image generation request made by the model.
-
ID stringThe unique ID of the image generation call.
-
Result stringThe generated image encoded in base64.
-
Status stringThe status of the image generation call.
-
const ResponseOutputItemImageGenerationCallStatusInProgress ResponseOutputItemImageGenerationCallStatus = "in_progress" -
const ResponseOutputItemImageGenerationCallStatusCompleted ResponseOutputItemImageGenerationCallStatus = "completed" -
const ResponseOutputItemImageGenerationCallStatusGenerating ResponseOutputItemImageGenerationCallStatus = "generating" -
const ResponseOutputItemImageGenerationCallStatusFailed ResponseOutputItemImageGenerationCallStatus = "failed"
-
-
Type ImageGenerationCallThe type of the image generation call. Always
image_generation_call.const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"
-
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
ID stringThe unique ID of the code interpreter tool call.
-
Code stringThe code to run, or null if not available.
-
ContainerID stringThe ID of the container used to run the code.
-
Outputs []ResponseCodeInterpreterToolCallOutputUnionThe outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
type ResponseCodeInterpreterToolCallOutputLogs struct{…}The logs output from the code interpreter.
-
Logs stringThe logs output from the code interpreter.
-
Type LogsThe type of the output. Always
logs.const LogsLogs Logs = "logs"
-
-
type ResponseCodeInterpreterToolCallOutputImage struct{…}The image output from the code interpreter.
-
Type ImageThe type of the output. Always
image.const ImageImage Image = "image"
-
URL stringThe URL of the image output from the code interpreter.
-
-
-
Status ResponseCodeInterpreterToolCallStatusThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
const ResponseCodeInterpreterToolCallStatusInProgress ResponseCodeInterpreterToolCallStatus = "in_progress" -
const ResponseCodeInterpreterToolCallStatusCompleted ResponseCodeInterpreterToolCallStatus = "completed" -
const ResponseCodeInterpreterToolCallStatusIncomplete ResponseCodeInterpreterToolCallStatus = "incomplete" -
const ResponseCodeInterpreterToolCallStatusInterpreting ResponseCodeInterpreterToolCallStatus = "interpreting" -
const ResponseCodeInterpreterToolCallStatusFailed ResponseCodeInterpreterToolCallStatus = "failed"
-
-
Type CodeInterpreterCallThe type of the code interpreter tool call. Always
code_interpreter_call.const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"
-
-
type ResponseOutputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
ID stringThe unique ID of the local shell call.
-
Action ResponseOutputItemLocalShellCallActionExecute a shell command on the server.
-
Command []stringThe command to run.
-
Env map[string, string]Environment variables to set for the command.
-
Type ExecThe type of the local shell action. Always
exec.const ExecExec Exec = "exec"
-
TimeoutMs int64Optional timeout in milliseconds for the command.
-
User stringOptional user to run the command as.
-
WorkingDirectory stringOptional working directory to run the command in.
-
-
CallID stringThe unique ID of the local shell tool call generated by the model.
-
Status stringThe status of the local shell call.
-
const ResponseOutputItemLocalShellCallStatusInProgress ResponseOutputItemLocalShellCallStatus = "in_progress" -
const ResponseOutputItemLocalShellCallStatusCompleted ResponseOutputItemLocalShellCallStatus = "completed" -
const ResponseOutputItemLocalShellCallStatusIncomplete ResponseOutputItemLocalShellCallStatus = "incomplete"
-
-
Type LocalShellCallThe type of the local shell call. Always
local_shell_call.const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"
-
-
type ResponseOutputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
ID stringThe unique ID of the local shell tool call generated by the model.
-
Output stringA JSON string of the output of the local shell tool call.
-
Type LocalShellCallOutputThe type of the local shell tool call output. Always
local_shell_call_output.const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete.-
const ResponseOutputItemLocalShellCallOutputStatusInProgress ResponseOutputItemLocalShellCallOutputStatus = "in_progress" -
const ResponseOutputItemLocalShellCallOutputStatusCompleted ResponseOutputItemLocalShellCallOutputStatus = "completed" -
const ResponseOutputItemLocalShellCallOutputStatusIncomplete ResponseOutputItemLocalShellCallOutputStatus = "incomplete"
-
-
-
type ResponseFunctionShellToolCall struct{…}A tool call that executes one or more shell commands in a managed environment.
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Action ResponseFunctionShellToolCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []string -
MaxOutputLength int64Optional maximum number of characters to return from each command.
-
TimeoutMs int64Optional timeout in milliseconds for the commands.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Environment ResponseFunctionShellToolCallEnvironmentUnionRepresents the use of a local environment to perform shell actions.
-
type ResponseLocalEnvironment struct{…}Represents the use of a local environment to perform shell actions.
-
Type LocalThe environment type. Always
local.const LocalLocal Local = "local"
-
-
type ResponseContainerReference struct{…}Represents a container created with /v1/containers.
-
ContainerID string -
Type ContainerReferenceThe environment type. Always
container_reference.const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
Status ResponseFunctionShellToolCallStatusThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallStatusInProgress ResponseFunctionShellToolCallStatus = "in_progress" -
const ResponseFunctionShellToolCallStatusCompleted ResponseFunctionShellToolCallStatus = "completed" -
const ResponseFunctionShellToolCallStatusIncomplete ResponseFunctionShellToolCallStatus = "incomplete"
-
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseFunctionShellToolCallOutput struct{…}The output of a shell tool call that was emitted.
-
ID stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
MaxOutputLength int64The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
Output []ResponseFunctionShellToolCallOutputOutputAn array of shell call output contents
-
Outcome ResponseFunctionShellToolCallOutputOutputOutcomeUnionRepresents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
type ResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64Exit code from the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringThe standard error output that was captured.
-
Stdout stringThe standard output that was captured.
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
Status ResponseFunctionShellToolCallOutputStatusThe status of the shell call output. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallOutputStatusInProgress ResponseFunctionShellToolCallOutputStatus = "in_progress" -
const ResponseFunctionShellToolCallOutputStatusCompleted ResponseFunctionShellToolCallOutputStatus = "completed" -
const ResponseFunctionShellToolCallOutputStatusIncomplete ResponseFunctionShellToolCallOutputStatus = "incomplete"
-
-
Type ShellCallOutputThe type of the shell call output. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseApplyPatchToolCall struct{…}A tool call that applies file diffs by creating, deleting, or updating files.
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseApplyPatchToolCallOperationUnionOne of the create_file, delete_file, or update_file operations applied via apply_patch.
-
type ResponseApplyPatchToolCallOperationCreateFile struct{…}Instruction describing how to create a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to create.
-
Type CreateFileCreate a new file with the provided diff.
const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseApplyPatchToolCallOperationDeleteFile struct{…}Instruction describing how to delete a file via the apply_patch tool.
-
Path stringPath of the file to delete.
-
Type DeleteFileDelete the specified file.
const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseApplyPatchToolCallOperationUpdateFile struct{…}Instruction describing how to update a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to update.
-
Type UpdateFileUpdate an existing file with the provided diff.
const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status ResponseApplyPatchToolCallStatusThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseApplyPatchToolCallStatusInProgress ResponseApplyPatchToolCallStatus = "in_progress" -
const ResponseApplyPatchToolCallStatusCompleted ResponseApplyPatchToolCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseApplyPatchToolCallOutput struct{…}The output emitted by an apply patch tool call.
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status ResponseApplyPatchToolCallOutputStatusThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseApplyPatchToolCallOutputStatusCompleted ResponseApplyPatchToolCallOutputStatus = "completed" -
const ResponseApplyPatchToolCallOutputStatusFailed ResponseApplyPatchToolCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
CreatedBy stringThe ID of the entity that created this tool call output.
-
Output stringOptional textual output returned by the apply patch tool.
-
-
type ResponseOutputItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
ID stringThe unique ID of the tool call.
-
Arguments stringA JSON string of the arguments passed to the tool.
-
Name stringThe name of the tool that was run.
-
ServerLabel stringThe label of the MCP server running the tool.
-
Type McpCallThe type of the item. Always
mcp_call.const McpCallMcpCall McpCall = "mcp_call"
-
ApprovalRequestID stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
Error stringThe error from the tool call, if any.
-
Output stringThe output from the tool call.
-
Status stringThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
const ResponseOutputItemMcpCallStatusInProgress ResponseOutputItemMcpCallStatus = "in_progress" -
const ResponseOutputItemMcpCallStatusCompleted ResponseOutputItemMcpCallStatus = "completed" -
const ResponseOutputItemMcpCallStatusIncomplete ResponseOutputItemMcpCallStatus = "incomplete" -
const ResponseOutputItemMcpCallStatusCalling ResponseOutputItemMcpCallStatus = "calling" -
const ResponseOutputItemMcpCallStatusFailed ResponseOutputItemMcpCallStatus = "failed"
-
-
-
type ResponseOutputItemMcpListTools struct{…}A list of tools available on an MCP server.
-
ID stringThe unique ID of the list.
-
ServerLabel stringThe label of the MCP server.
-
Tools []ResponseOutputItemMcpListToolsToolThe tools available on the server.
-
InputSchema anyThe JSON schema describing the tool's input.
-
Name stringThe name of the tool.
-
Annotations anyAdditional annotations about the tool.
-
Description stringThe description of the tool.
-
-
Type McpListToolsThe type of the item. Always
mcp_list_tools.const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
-
Error stringError message if the server could not list tools.
-
-
type ResponseOutputItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
ID stringThe unique ID of the approval request.
-
Arguments stringA JSON string of arguments for the tool.
-
Name stringThe name of the tool to run.
-
ServerLabel stringThe label of the MCP server making the request.
-
Type McpApprovalRequestThe type of the item. Always
mcp_approval_request.const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"
-
-
type ResponseOutputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
ID stringThe unique ID of the approval response
-
ApprovalRequestID stringThe ID of the approval request being answered.
-
Approve boolWhether the request was approved.
-
Type McpApprovalResponseThe type of the item. Always
mcp_approval_response.const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
-
Reason stringOptional reason for the decision.
-
-
type ResponseCustomToolCall struct{…}A call to a custom tool created by the model.
-
CallID stringAn identifier used to map this custom tool call to a tool call output.
-
Input stringThe input for the custom tool call generated by the model.
-
Name stringThe name of the custom tool being called.
-
Type CustomToolCallThe type of the custom tool call. Always
custom_tool_call.const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"
-
ID stringThe unique ID of the custom tool call in the OpenAI platform.
-
Namespace stringThe namespace of the custom tool being called.
-
-
type ResponseCustomToolCallOutputItem struct{…}The output of a custom tool call from your code, being sent back to the model.
-
ID stringThe unique ID of the custom tool call output item.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseCustomToolCallOutputItemStatusInProgress ResponseCustomToolCallOutputItemStatus = "in_progress" -
const ResponseCustomToolCallOutputItemStatusCompleted ResponseCustomToolCallOutputItemStatus = "completed" -
const ResponseCustomToolCallOutputItemStatusIncomplete ResponseCustomToolCallOutputItemStatus = "incomplete"
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
-
OutputIndex int64The index of the output item that was marked done.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseOutputItemDoneThe type of the event. Always
response.output_item.done.const ResponseOutputItemDoneResponseOutputItemDone ResponseOutputItemDone = "response.output_item.done"
-
Response Output Message
-
type ResponseOutputMessage struct{…}An output message from the model.
-
ID stringThe unique ID of the output message.
-
Content []ResponseOutputMessageContentUnionThe content of the output message.
-
type ResponseOutputText struct{…}A text output from the model.
-
Annotations []ResponseOutputTextAnnotationUnionThe annotations of the text output.
-
type ResponseOutputTextAnnotationFileCitation struct{…}A citation to a file.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the file cited.
-
Index int64The index of the file in the list of files.
-
Type FileCitationThe type of the file citation. Always
file_citation.const FileCitationFileCitation FileCitation = "file_citation"
-
-
type ResponseOutputTextAnnotationURLCitation struct{…}A citation for a web resource used to generate a model response.
-
EndIndex int64The index of the last character of the URL citation in the message.
-
StartIndex int64The index of the first character of the URL citation in the message.
-
Title stringThe title of the web resource.
-
Type URLCitationThe type of the URL citation. Always
url_citation.const URLCitationURLCitation URLCitation = "url_citation"
-
URL stringThe URL of the web resource.
-
-
type ResponseOutputTextAnnotationContainerFileCitation struct{…}A citation for a container file used to generate a model response.
-
ContainerID stringThe ID of the container file.
-
EndIndex int64The index of the last character of the container file citation in the message.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the container file cited.
-
StartIndex int64The index of the first character of the container file citation in the message.
-
Type ContainerFileCitationThe type of the container file citation. Always
container_file_citation.const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"
-
-
type ResponseOutputTextAnnotationFilePath struct{…}A path to a file.
-
FileID stringThe ID of the file.
-
Index int64The index of the file in the list of files.
-
Type FilePathThe type of the file path. Always
file_path.const FilePathFilePath FilePath = "file_path"
-
-
-
Text stringThe text output from the model.
-
Type OutputTextThe type of the output text. Always
output_text.const OutputTextOutputText OutputText = "output_text"
-
Logprobs []ResponseOutputTextLogprob-
Token string -
Bytes []int64 -
Logprob float64 -
TopLogprobs []ResponseOutputTextLogprobTopLogprob-
Token string -
Bytes []int64 -
Logprob float64
-
-
-
-
type ResponseOutputRefusal struct{…}A refusal from the model.
-
Refusal stringThe refusal explanation from the model.
-
Type RefusalThe type of the refusal. Always
refusal.const RefusalRefusal Refusal = "refusal"
-
-
-
Role AssistantThe role of the output message. Always
assistant.const AssistantAssistant Assistant = "assistant"
-
Status ResponseOutputMessageStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseOutputMessageStatusInProgress ResponseOutputMessageStatus = "in_progress" -
const ResponseOutputMessageStatusCompleted ResponseOutputMessageStatus = "completed" -
const ResponseOutputMessageStatusIncomplete ResponseOutputMessageStatus = "incomplete"
-
-
Type MessageThe type of the output message. Always
message.const MessageMessage Message = "message"
-
Phase ResponseOutputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const ResponseOutputMessagePhaseCommentary ResponseOutputMessagePhase = "commentary" -
const ResponseOutputMessagePhaseFinalAnswer ResponseOutputMessagePhase = "final_answer"
-
-
Response Output Refusal
-
type ResponseOutputRefusal struct{…}A refusal from the model.
-
Refusal stringThe refusal explanation from the model.
-
Type RefusalThe type of the refusal. Always
refusal.const RefusalRefusal Refusal = "refusal"
-
Response Output Text
-
type ResponseOutputText struct{…}A text output from the model.
-
Annotations []ResponseOutputTextAnnotationUnionThe annotations of the text output.
-
type ResponseOutputTextAnnotationFileCitation struct{…}A citation to a file.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the file cited.
-
Index int64The index of the file in the list of files.
-
Type FileCitationThe type of the file citation. Always
file_citation.const FileCitationFileCitation FileCitation = "file_citation"
-
-
type ResponseOutputTextAnnotationURLCitation struct{…}A citation for a web resource used to generate a model response.
-
EndIndex int64The index of the last character of the URL citation in the message.
-
StartIndex int64The index of the first character of the URL citation in the message.
-
Title stringThe title of the web resource.
-
Type URLCitationThe type of the URL citation. Always
url_citation.const URLCitationURLCitation URLCitation = "url_citation"
-
URL stringThe URL of the web resource.
-
-
type ResponseOutputTextAnnotationContainerFileCitation struct{…}A citation for a container file used to generate a model response.
-
ContainerID stringThe ID of the container file.
-
EndIndex int64The index of the last character of the container file citation in the message.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the container file cited.
-
StartIndex int64The index of the first character of the container file citation in the message.
-
Type ContainerFileCitationThe type of the container file citation. Always
container_file_citation.const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"
-
-
type ResponseOutputTextAnnotationFilePath struct{…}A path to a file.
-
FileID stringThe ID of the file.
-
Index int64The index of the file in the list of files.
-
Type FilePathThe type of the file path. Always
file_path.const FilePathFilePath FilePath = "file_path"
-
-
-
Text stringThe text output from the model.
-
Type OutputTextThe type of the output text. Always
output_text.const OutputTextOutputText OutputText = "output_text"
-
Logprobs []ResponseOutputTextLogprob-
Token string -
Bytes []int64 -
Logprob float64 -
TopLogprobs []ResponseOutputTextLogprobTopLogprob-
Token string -
Bytes []int64 -
Logprob float64
-
-
-
Response Output Text Annotation Added Event
-
type ResponseOutputTextAnnotationAddedEvent struct{…}Emitted when an annotation is added to output text content.
-
Annotation anyThe annotation object being added. (See annotation schema for details.)
-
AnnotationIndex int64The index of the annotation within the content part.
-
ContentIndex int64The index of the content part within the output item.
-
ItemID stringThe unique identifier of the item to which the annotation is being added.
-
OutputIndex int64The index of the output item in the response's output array.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseOutputTextAnnotationAddedThe type of the event. Always 'response.output_text.annotation.added'.
const ResponseOutputTextAnnotationAddedResponseOutputTextAnnotationAdded ResponseOutputTextAnnotationAdded = "response.output_text.annotation.added"
-
Response Prompt
-
type ResponsePrompt struct{…}Reference to a prompt template and its variables. Learn more.
-
ID stringThe unique identifier of the prompt template to use.
-
Variables map[string, ResponsePromptVariableUnion]Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files.
-
string -
type ResponseInputText struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
Detail ResponseInputImageDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageDetailLow ResponseInputImageDetail = "low" -
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high" -
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto" -
const ResponseInputImageDetailOriginal ResponseInputImageDetail = "original"
-
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFile struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileDetailLow ResponseInputFileDetail = "low" -
const ResponseInputFileDetailHigh ResponseInputFileDetail = "high"
-
-
FileData stringThe content of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
Version stringOptional version of the prompt template.
-
Response Queued Event
-
type ResponseQueuedEvent struct{…}Emitted when a response is queued and waiting to be processed.
-
Response ResponseThe full response object that is queued.
-
ID stringUnique identifier for this Response.
-
CreatedAt float64Unix timestamp (in seconds) of when this Response was created.
-
Error ResponseErrorAn error object returned when the model fails to generate a Response.
-
Code ResponseErrorCodeThe error code for the response.
-
const ResponseErrorCodeServerError ResponseErrorCode = "server_error" -
const ResponseErrorCodeRateLimitExceeded ResponseErrorCode = "rate_limit_exceeded" -
const ResponseErrorCodeInvalidPrompt ResponseErrorCode = "invalid_prompt" -
const ResponseErrorCodeVectorStoreTimeout ResponseErrorCode = "vector_store_timeout" -
const ResponseErrorCodeInvalidImage ResponseErrorCode = "invalid_image" -
const ResponseErrorCodeInvalidImageFormat ResponseErrorCode = "invalid_image_format" -
const ResponseErrorCodeInvalidBase64Image ResponseErrorCode = "invalid_base64_image" -
const ResponseErrorCodeInvalidImageURL ResponseErrorCode = "invalid_image_url" -
const ResponseErrorCodeImageTooLarge ResponseErrorCode = "image_too_large" -
const ResponseErrorCodeImageTooSmall ResponseErrorCode = "image_too_small" -
const ResponseErrorCodeImageParseError ResponseErrorCode = "image_parse_error" -
const ResponseErrorCodeImageContentPolicyViolation ResponseErrorCode = "image_content_policy_violation" -
const ResponseErrorCodeInvalidImageMode ResponseErrorCode = "invalid_image_mode" -
const ResponseErrorCodeImageFileTooLarge ResponseErrorCode = "image_file_too_large" -
const ResponseErrorCodeUnsupportedImageMediaType ResponseErrorCode = "unsupported_image_media_type" -
const ResponseErrorCodeEmptyImageFile ResponseErrorCode = "empty_image_file" -
const ResponseErrorCodeFailedToDownloadImage ResponseErrorCode = "failed_to_download_image" -
const ResponseErrorCodeImageFileNotFound ResponseErrorCode = "image_file_not_found"
-
-
Message stringA human-readable description of the error.
-
-
IncompleteDetails ResponseIncompleteDetailsDetails about why the response is incomplete.
-
Reason stringThe reason why the response is incomplete.
-
const ResponseIncompleteDetailsReasonMaxOutputTokens ResponseIncompleteDetailsReason = "max_output_tokens" -
const ResponseIncompleteDetailsReasonContentFilter ResponseIncompleteDetailsReason = "content_filter"
-
-
-
Instructions ResponseInstructionsUnionA system (or developer) message inserted into the model's context.
When using along with
previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses.-
string -
type ResponseInstructionsInputItemList []ResponseInputItemUnionA list of one or many input items to the model, containing different content types.
-
type EasyInputMessage struct{…}A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.-
Content EasyInputMessageContentUnionText, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
-
string -
type ResponseInputMessageContentList []ResponseInputContentUnionA list of one or many input items to the model, containing different content types.
-
type ResponseInputText struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
Detail ResponseInputImageDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageDetailLow ResponseInputImageDetail = "low" -
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high" -
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto" -
const ResponseInputImageDetailOriginal ResponseInputImageDetail = "original"
-
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFile struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileDetailLow ResponseInputFileDetail = "low" -
const ResponseInputFileDetailHigh ResponseInputFileDetail = "high"
-
-
FileData stringThe content of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Role EasyInputMessageRoleThe role of the message input. One of
user,assistant,system, ordeveloper.-
const EasyInputMessageRoleUser EasyInputMessageRole = "user" -
const EasyInputMessageRoleAssistant EasyInputMessageRole = "assistant" -
const EasyInputMessageRoleSystem EasyInputMessageRole = "system" -
const EasyInputMessageRoleDeveloper EasyInputMessageRole = "developer"
-
-
Phase EasyInputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const EasyInputMessagePhaseCommentary EasyInputMessagePhase = "commentary" -
const EasyInputMessagePhaseFinalAnswer EasyInputMessagePhase = "final_answer"
-
-
Type EasyInputMessageTypeThe type of the message input. Always
message.const EasyInputMessageTypeMessage EasyInputMessageType = "message"
-
-
type ResponseInputItemMessage struct{…}A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole.-
Content ResponseInputMessageContentListA list of one or many input items to the model, containing different content types.
-
Role stringThe role of the message input. One of
user,system, ordeveloper.-
const ResponseInputItemMessageRoleUser ResponseInputItemMessageRole = "user" -
const ResponseInputItemMessageRoleSystem ResponseInputItemMessageRole = "system" -
const ResponseInputItemMessageRoleDeveloper ResponseInputItemMessageRole = "developer"
-
-
Status stringThe status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputItemMessageStatusInProgress ResponseInputItemMessageStatus = "in_progress" -
const ResponseInputItemMessageStatusCompleted ResponseInputItemMessageStatus = "completed" -
const ResponseInputItemMessageStatusIncomplete ResponseInputItemMessageStatus = "incomplete"
-
-
Type stringThe type of the message input. Always set to
message.const ResponseInputItemMessageTypeMessage ResponseInputItemMessageType = "message"
-
-
type ResponseOutputMessage struct{…}An output message from the model.
-
ID stringThe unique ID of the output message.
-
Content []ResponseOutputMessageContentUnionThe content of the output message.
-
type ResponseOutputText struct{…}A text output from the model.
-
Annotations []ResponseOutputTextAnnotationUnionThe annotations of the text output.
-
type ResponseOutputTextAnnotationFileCitation struct{…}A citation to a file.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the file cited.
-
Index int64The index of the file in the list of files.
-
Type FileCitationThe type of the file citation. Always
file_citation.const FileCitationFileCitation FileCitation = "file_citation"
-
-
type ResponseOutputTextAnnotationURLCitation struct{…}A citation for a web resource used to generate a model response.
-
EndIndex int64The index of the last character of the URL citation in the message.
-
StartIndex int64The index of the first character of the URL citation in the message.
-
Title stringThe title of the web resource.
-
Type URLCitationThe type of the URL citation. Always
url_citation.const URLCitationURLCitation URLCitation = "url_citation"
-
URL stringThe URL of the web resource.
-
-
type ResponseOutputTextAnnotationContainerFileCitation struct{…}A citation for a container file used to generate a model response.
-
ContainerID stringThe ID of the container file.
-
EndIndex int64The index of the last character of the container file citation in the message.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the container file cited.
-
StartIndex int64The index of the first character of the container file citation in the message.
-
Type ContainerFileCitationThe type of the container file citation. Always
container_file_citation.const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"
-
-
type ResponseOutputTextAnnotationFilePath struct{…}A path to a file.
-
FileID stringThe ID of the file.
-
Index int64The index of the file in the list of files.
-
Type FilePathThe type of the file path. Always
file_path.const FilePathFilePath FilePath = "file_path"
-
-
-
Text stringThe text output from the model.
-
Type OutputTextThe type of the output text. Always
output_text.const OutputTextOutputText OutputText = "output_text"
-
Logprobs []ResponseOutputTextLogprob-
Token string -
Bytes []int64 -
Logprob float64 -
TopLogprobs []ResponseOutputTextLogprobTopLogprob-
Token string -
Bytes []int64 -
Logprob float64
-
-
-
-
type ResponseOutputRefusal struct{…}A refusal from the model.
-
Refusal stringThe refusal explanation from the model.
-
Type RefusalThe type of the refusal. Always
refusal.const RefusalRefusal Refusal = "refusal"
-
-
-
Role AssistantThe role of the output message. Always
assistant.const AssistantAssistant Assistant = "assistant"
-
Status ResponseOutputMessageStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseOutputMessageStatusInProgress ResponseOutputMessageStatus = "in_progress" -
const ResponseOutputMessageStatusCompleted ResponseOutputMessageStatus = "completed" -
const ResponseOutputMessageStatusIncomplete ResponseOutputMessageStatus = "incomplete"
-
-
Type MessageThe type of the output message. Always
message.const MessageMessage Message = "message"
-
Phase ResponseOutputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const ResponseOutputMessagePhaseCommentary ResponseOutputMessagePhase = "commentary" -
const ResponseOutputMessagePhaseFinalAnswer ResponseOutputMessagePhase = "final_answer"
-
-
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
ID stringThe unique ID of the file search tool call.
-
Queries []stringThe queries used to search for files.
-
Status ResponseFileSearchToolCallStatusThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
const ResponseFileSearchToolCallStatusInProgress ResponseFileSearchToolCallStatus = "in_progress" -
const ResponseFileSearchToolCallStatusSearching ResponseFileSearchToolCallStatus = "searching" -
const ResponseFileSearchToolCallStatusCompleted ResponseFileSearchToolCallStatus = "completed" -
const ResponseFileSearchToolCallStatusIncomplete ResponseFileSearchToolCallStatus = "incomplete" -
const ResponseFileSearchToolCallStatusFailed ResponseFileSearchToolCallStatus = "failed"
-
-
Type FileSearchCallThe type of the file search tool call. Always
file_search_call.const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"
-
Results []ResponseFileSearchToolCallResultThe results of the file search tool call.
-
Attributes map[string, ResponseFileSearchToolCallResultAttributeUnion]Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.
-
string -
float64 -
bool
-
-
FileID stringThe unique ID of the file.
-
Filename stringThe name of the file.
-
Score float64The relevance score of the file - a value between 0 and 1.
-
Text stringThe text that was retrieved from the file.
-
-
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
ID stringThe unique ID of the computer call.
-
CallID stringAn identifier used when responding to the tool call with output.
-
PendingSafetyChecks []ResponseComputerToolCallPendingSafetyCheckThe pending safety checks for the computer call.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status ResponseComputerToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseComputerToolCallStatusInProgress ResponseComputerToolCallStatus = "in_progress" -
const ResponseComputerToolCallStatusCompleted ResponseComputerToolCallStatus = "completed" -
const ResponseComputerToolCallStatusIncomplete ResponseComputerToolCallStatus = "incomplete"
-
-
Type ResponseComputerToolCallTypeThe type of the computer call. Always
computer_call.const ResponseComputerToolCallTypeComputerCall ResponseComputerToolCallType = "computer_call"
-
Action ResponseComputerToolCallActionUnionA click action.
-
type ResponseComputerToolCallActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ResponseComputerToolCallActionClickButtonLeft ResponseComputerToolCallActionClickButton = "left" -
const ResponseComputerToolCallActionClickButtonRight ResponseComputerToolCallActionClickButton = "right" -
const ResponseComputerToolCallActionClickButtonWheel ResponseComputerToolCallActionClickButton = "wheel" -
const ResponseComputerToolCallActionClickButtonBack ResponseComputerToolCallActionClickButton = "back" -
const ResponseComputerToolCallActionClickButtonForward ResponseComputerToolCallActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ResponseComputerToolCallActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ResponseComputerToolCallActionDrag struct{…}A drag action.
-
Path []ResponseComputerToolCallActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ResponseComputerToolCallActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ResponseComputerToolCallActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ResponseComputerToolCallActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ResponseComputerToolCallActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ResponseComputerToolCallActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ResponseComputerToolCallActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
Actions ComputerActionListFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
type ComputerActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ComputerActionClickButtonLeft ComputerActionClickButton = "left" -
const ComputerActionClickButtonRight ComputerActionClickButton = "right" -
const ComputerActionClickButtonWheel ComputerActionClickButton = "wheel" -
const ComputerActionClickButtonBack ComputerActionClickButton = "back" -
const ComputerActionClickButtonForward ComputerActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ComputerActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ComputerActionDrag struct{…}A drag action.
-
Path []ComputerActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ComputerActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ComputerActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ComputerActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ComputerActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ComputerActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ComputerActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
-
type ResponseInputItemComputerCallOutput struct{…}The output of a computer tool call.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Type ComputerScreenshotSpecifies the event type. For a computer screenshot, this property is always set to
computer_screenshot.const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"
-
FileID stringThe identifier of an uploaded file that contains the screenshot.
-
ImageURL stringThe URL of the screenshot image.
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
ID stringThe ID of the computer tool call output.
-
AcknowledgedSafetyChecks []ResponseInputItemComputerCallOutputAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status stringThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseInputItemComputerCallOutputStatusInProgress ResponseInputItemComputerCallOutputStatus = "in_progress" -
const ResponseInputItemComputerCallOutputStatusCompleted ResponseInputItemComputerCallOutputStatus = "completed" -
const ResponseInputItemComputerCallOutputStatusIncomplete ResponseInputItemComputerCallOutputStatus = "incomplete"
-
-
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
ID stringThe unique ID of the web search tool call.
-
Action ResponseFunctionWebSearchActionUnionAn object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
type ResponseFunctionWebSearchActionSearch struct{…}Action type "search" - Performs a web search query.
-
Type SearchThe action type.
const SearchSearch Search = "search"
-
Queries []stringThe search queries.
-
Query stringThe search query.
-
Sources []ResponseFunctionWebSearchActionSearchSourceThe sources used in the search.
-
Type URLThe type of source. Always
url.const URLURL URL = "url"
-
URL stringThe URL of the source.
-
-
-
type ResponseFunctionWebSearchActionOpenPage struct{…}Action type "open_page" - Opens a specific URL from search results.
-
Type OpenPageThe action type.
const OpenPageOpenPage OpenPage = "open_page"
-
URL stringThe URL opened by the model.
-
-
type ResponseFunctionWebSearchActionFindInPage struct{…}Action type "find_in_page": Searches for a pattern within a loaded page.
-
Pattern stringThe pattern or text to search for within the page.
-
Type FindInPageThe action type.
const FindInPageFindInPage FindInPage = "find_in_page"
-
URL stringThe URL of the page searched for the pattern.
-
-
-
Status ResponseFunctionWebSearchStatusThe status of the web search tool call.
-
const ResponseFunctionWebSearchStatusInProgress ResponseFunctionWebSearchStatus = "in_progress" -
const ResponseFunctionWebSearchStatusSearching ResponseFunctionWebSearchStatus = "searching" -
const ResponseFunctionWebSearchStatusCompleted ResponseFunctionWebSearchStatus = "completed" -
const ResponseFunctionWebSearchStatusFailed ResponseFunctionWebSearchStatus = "failed"
-
-
Type WebSearchCallThe type of the web search tool call. Always
web_search_call.const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"
-
-
type ResponseFunctionToolCall struct{…}A tool call to run a function. See the function calling guide for more information.
-
Arguments stringA JSON string of the arguments to pass to the function.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Name stringThe name of the function to run.
-
Type FunctionCallThe type of the function tool call. Always
function_call.const FunctionCallFunctionCall FunctionCall = "function_call"
-
ID stringThe unique ID of the function tool call.
-
Namespace stringThe namespace of the function to run.
-
Status ResponseFunctionToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallStatusInProgress ResponseFunctionToolCallStatus = "in_progress" -
const ResponseFunctionToolCallStatusCompleted ResponseFunctionToolCallStatus = "completed" -
const ResponseFunctionToolCallStatusIncomplete ResponseFunctionToolCallStatus = "incomplete"
-
-
-
type ResponseInputItemFunctionCallOutput struct{…}The output of a function tool call.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseInputItemFunctionCallOutputOutputUnionText, image, or file output of the function tool call.
-
string -
type ResponseFunctionCallOutputItemList []ResponseFunctionCallOutputItemUnionAn array of content outputs (text, image, file) for the function tool call.
-
type ResponseInputTextContent struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImageContent struct{…}An image input to the model. Learn about image inputs
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
Detail ResponseInputImageContentDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageContentDetailLow ResponseInputImageContentDetail = "low" -
const ResponseInputImageContentDetailHigh ResponseInputImageContentDetail = "high" -
const ResponseInputImageContentDetailAuto ResponseInputImageContentDetail = "auto" -
const ResponseInputImageContentDetailOriginal ResponseInputImageContentDetail = "original"
-
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFileContent struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileContentDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileContentDetailLow ResponseInputFileContentDetail = "low" -
const ResponseInputFileContentDetailHigh ResponseInputFileContentDetail = "high"
-
-
FileData stringThe base64-encoded data of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
ID stringThe unique ID of the function tool call output. Populated when this item is returned via API.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputItemFunctionCallOutputStatusInProgress ResponseInputItemFunctionCallOutputStatus = "in_progress" -
const ResponseInputItemFunctionCallOutputStatusCompleted ResponseInputItemFunctionCallOutputStatus = "completed" -
const ResponseInputItemFunctionCallOutputStatusIncomplete ResponseInputItemFunctionCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemToolSearchCall struct{…}-
Arguments anyThe arguments supplied to the tool search call.
-
Type ToolSearchCallThe item type. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
ID stringThe unique ID of this tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution stringWhether tool search was executed by the server or by the client.
-
const ResponseInputItemToolSearchCallExecutionServer ResponseInputItemToolSearchCallExecution = "server" -
const ResponseInputItemToolSearchCallExecutionClient ResponseInputItemToolSearchCallExecution = "client"
-
-
Status stringThe status of the tool search call.
-
const ResponseInputItemToolSearchCallStatusInProgress ResponseInputItemToolSearchCallStatus = "in_progress" -
const ResponseInputItemToolSearchCallStatusCompleted ResponseInputItemToolSearchCallStatus = "completed" -
const ResponseInputItemToolSearchCallStatusIncomplete ResponseInputItemToolSearchCallStatus = "incomplete"
-
-
-
type ResponseToolSearchOutputItemParamResp struct{…}-
Tools []ToolUnionThe loaded tool definitions returned by the tool search output.
-
type FunctionTool struct{…}Defines a function in your own code the model can choose to call. Learn more about function calling.
-
Name stringThe name of the function to call.
-
Parameters map[string, any]A JSON schema object describing the parameters of the function.
-
Strict boolWhether to enforce strict parameter validation. Default
true. -
Type FunctionThe type of the function tool. Always
function.const FunctionFunction Function = "function"
-
DeferLoading boolWhether this function is deferred and loaded via tool search.
-
Description stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
type FileSearchTool struct{…}A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
Type FileSearchThe type of the file search tool. Always
file_search.const FileSearchFileSearch FileSearch = "file_search"
-
VectorStoreIDs []stringThe IDs of the vector stores to search.
-
Filters FileSearchToolFiltersUnionA filter to apply.
-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
Key stringThe key to compare against the value.
-
Type ComparisonFilterTypeSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
const ComparisonFilterTypeEq ComparisonFilterType = "eq" -
const ComparisonFilterTypeNe ComparisonFilterType = "ne" -
const ComparisonFilterTypeGt ComparisonFilterType = "gt" -
const ComparisonFilterTypeGte ComparisonFilterType = "gte" -
const ComparisonFilterTypeLt ComparisonFilterType = "lt" -
const ComparisonFilterTypeLte ComparisonFilterType = "lte" -
const ComparisonFilterTypeIn ComparisonFilterType = "in" -
const ComparisonFilterTypeNin ComparisonFilterType = "nin"
-
-
Value ComparisonFilterValueUnionThe value to compare against the attribute key; supports string, number, or boolean types.
-
string -
float64 -
bool -
type ComparisonFilterValueArray []ComparisonFilterValueArrayItemUnion-
string -
float64
-
-
-
-
type CompoundFilter struct{…}Combine multiple filters using
andoror.-
Filters []ComparisonFilterArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
-
Type CompoundFilterTypeType of operation:
andoror.-
const CompoundFilterTypeAnd CompoundFilterType = "and" -
const CompoundFilterTypeOr CompoundFilterType = "or"
-
-
-
-
MaxNumResults int64The maximum number of results to return. This number should be between 1 and 50 inclusive.
-
RankingOptions FileSearchToolRankingOptionsRanking options for search.
-
HybridSearch FileSearchToolRankingOptionsHybridSearchWeights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
EmbeddingWeight float64The weight of the embedding in the reciprocal ranking fusion.
-
TextWeight float64The weight of the text in the reciprocal ranking fusion.
-
-
Ranker stringThe ranker to use for the file search.
-
const FileSearchToolRankingOptionsRankerAuto FileSearchToolRankingOptionsRanker = "auto" -
const FileSearchToolRankingOptionsRankerDefault2024_11_15 FileSearchToolRankingOptionsRanker = "default-2024-11-15"
-
-
ScoreThreshold float64The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
Type ComputerThe type of the computer tool. Always
computer.const ComputerComputer Computer = "computer"
-
-
type ComputerUsePreviewTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
DisplayHeight int64The height of the computer display.
-
DisplayWidth int64The width of the computer display.
-
Environment ComputerUsePreviewToolEnvironmentThe type of computer environment to control.
-
const ComputerUsePreviewToolEnvironmentWindows ComputerUsePreviewToolEnvironment = "windows" -
const ComputerUsePreviewToolEnvironmentMac ComputerUsePreviewToolEnvironment = "mac" -
const ComputerUsePreviewToolEnvironmentLinux ComputerUsePreviewToolEnvironment = "linux" -
const ComputerUsePreviewToolEnvironmentUbuntu ComputerUsePreviewToolEnvironment = "ubuntu" -
const ComputerUsePreviewToolEnvironmentBrowser ComputerUsePreviewToolEnvironment = "browser"
-
-
Type ComputerUsePreviewThe type of the computer use tool. Always
computer_use_preview.const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"
-
-
type WebSearchTool struct{…}Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
Type WebSearchToolTypeThe type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
const WebSearchToolTypeWebSearch WebSearchToolType = "web_search" -
const WebSearchToolTypeWebSearch2025_08_26 WebSearchToolType = "web_search_2025_08_26"
-
-
Filters WebSearchToolFiltersFilters for the search.
-
AllowedDomains []stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
SearchContextSize WebSearchToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchToolSearchContextSizeLow WebSearchToolSearchContextSize = "low" -
const WebSearchToolSearchContextSizeMedium WebSearchToolSearchContextSize = "medium" -
const WebSearchToolSearchContextSizeHigh WebSearchToolSearchContextSize = "high"
-
-
UserLocation WebSearchToolUserLocationThe approximate location of the user.
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
Type stringThe type of location approximation. Always
approximate.const WebSearchToolUserLocationTypeApproximate WebSearchToolUserLocationType = "approximate"
-
-
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
ServerLabel stringA label for this MCP server, used to identify it in tool calls.
-
Type McpThe type of the MCP tool. Always
mcp.const McpMcp Mcp = "mcp"
-
AllowedTools ToolMcpAllowedToolsUnionList of allowed tool names or a filter object.
-
type ToolMcpAllowedToolsMcpAllowedTools []stringA string array of allowed tool names
-
type ToolMcpAllowedToolsMcpToolFilter struct{…}A filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
Authorization stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
ConnectorID stringIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
const ToolMcpConnectorIDConnectorDropbox ToolMcpConnectorID = "connector_dropbox" -
const ToolMcpConnectorIDConnectorGmail ToolMcpConnectorID = "connector_gmail" -
const ToolMcpConnectorIDConnectorGooglecalendar ToolMcpConnectorID = "connector_googlecalendar" -
const ToolMcpConnectorIDConnectorGoogledrive ToolMcpConnectorID = "connector_googledrive" -
const ToolMcpConnectorIDConnectorMicrosoftteams ToolMcpConnectorID = "connector_microsoftteams" -
const ToolMcpConnectorIDConnectorOutlookcalendar ToolMcpConnectorID = "connector_outlookcalendar" -
const ToolMcpConnectorIDConnectorOutlookemail ToolMcpConnectorID = "connector_outlookemail" -
const ToolMcpConnectorIDConnectorSharepoint ToolMcpConnectorID = "connector_sharepoint"
-
-
DeferLoading boolWhether this MCP tool is deferred and discovered via tool search.
-
Headers map[string, string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
RequireApproval ToolMcpRequireApprovalUnionSpecify which of the MCP server's tools require approval.
-
type ToolMcpRequireApprovalMcpToolApprovalFilter 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.-
Always ToolMcpRequireApprovalMcpToolApprovalFilterAlwaysA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
Never ToolMcpRequireApprovalMcpToolApprovalFilterNeverA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
type ToolMcpRequireApprovalMcpToolApprovalSetting stringSpecify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
const ToolMcpRequireApprovalMcpToolApprovalSettingAlways ToolMcpRequireApprovalMcpToolApprovalSetting = "always" -
const ToolMcpRequireApprovalMcpToolApprovalSettingNever ToolMcpRequireApprovalMcpToolApprovalSetting = "never"
-
-
-
ServerDescription stringOptional description of the MCP server, used to provide more context.
-
ServerURL stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
TunnelID stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
Container ToolCodeInterpreterContainerUnionThe code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
string -
type ToolCodeInterpreterContainerCodeInterpreterContainerAuto struct{…}Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
Type AutoAlways
auto.const AutoAuto Auto = "auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit stringThe memory limit for the code interpreter container.
-
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"
-
-
NetworkPolicy ToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…}-
Type DisabledDisable outbound network access. Always
disabled.const DisabledDisabled Disabled = "disabled"
-
-
type ContainerNetworkPolicyAllowlist struct{…}-
AllowedDomains []stringA list of allowed domains when type is
allowlist. -
Type AllowlistAllow outbound network access only to specified domains. Always
allowlist.const AllowlistAllowlist Allowlist = "allowlist"
-
DomainSecrets []ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
Domain stringThe domain associated with the secret.
-
Name stringThe name of the secret to inject for the domain.
-
Value stringThe secret value to inject for the domain.
-
-
-
-
-
-
Type CodeInterpreterThe type of the code interpreter tool. Always
code_interpreter.const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"
-
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
Type ImageGenerationThe type of the image generation tool. Always
image_generation.const ImageGenerationImageGeneration ImageGeneration = "image_generation"
-
Action stringWhether to generate a new image or edit an existing image. Default:
auto.-
const ToolImageGenerationActionGenerate ToolImageGenerationAction = "generate" -
const ToolImageGenerationActionEdit ToolImageGenerationAction = "edit" -
const ToolImageGenerationActionAuto ToolImageGenerationAction = "auto"
-
-
Background stringAllows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
const ToolImageGenerationBackgroundTransparent ToolImageGenerationBackground = "transparent" -
const ToolImageGenerationBackgroundOpaque ToolImageGenerationBackground = "opaque" -
const ToolImageGenerationBackgroundAuto ToolImageGenerationBackground = "auto"
-
-
InputFidelity stringControl how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
const ToolImageGenerationInputFidelityHigh ToolImageGenerationInputFidelity = "high" -
const ToolImageGenerationInputFidelityLow ToolImageGenerationInputFidelity = "low"
-
-
InputImageMask ToolImageGenerationInputImageMaskOptional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
FileID stringFile ID for the mask image.
-
ImageURL stringBase64-encoded mask image.
-
-
Model stringThe image generation model to use. Default:
gpt-image-1.-
string -
string-
const ToolImageGenerationModelGPTImage1 ToolImageGenerationModel = "gpt-image-1" -
const ToolImageGenerationModelGPTImage1Mini ToolImageGenerationModel = "gpt-image-1-mini" -
const ToolImageGenerationModelGPTImage2 ToolImageGenerationModel = "gpt-image-2" -
const ToolImageGenerationModelGPTImage2_2026_04_21 ToolImageGenerationModel = "gpt-image-2-2026-04-21" -
const ToolImageGenerationModelGPTImage1_5 ToolImageGenerationModel = "gpt-image-1.5" -
const ToolImageGenerationModelChatgptImageLatest ToolImageGenerationModel = "chatgpt-image-latest"
-
-
-
Moderation stringModeration level for the generated image. Default:
auto.-
const ToolImageGenerationModerationAuto ToolImageGenerationModeration = "auto" -
const ToolImageGenerationModerationLow ToolImageGenerationModeration = "low"
-
-
OutputCompression int64Compression level for the output image. Default: 100.
-
OutputFormat stringThe output format of the generated image. One of
png,webp, orjpeg. Default:png.-
const ToolImageGenerationOutputFormatPNG ToolImageGenerationOutputFormat = "png" -
const ToolImageGenerationOutputFormatWebP ToolImageGenerationOutputFormat = "webp" -
const ToolImageGenerationOutputFormatJPEG ToolImageGenerationOutputFormat = "jpeg"
-
-
PartialImages int64Number of partial images to generate in streaming mode, from 0 (default value) to 3.
-
Quality stringThe quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
const ToolImageGenerationQualityLow ToolImageGenerationQuality = "low" -
const ToolImageGenerationQualityMedium ToolImageGenerationQuality = "medium" -
const ToolImageGenerationQualityHigh ToolImageGenerationQuality = "high" -
const ToolImageGenerationQualityAuto ToolImageGenerationQuality = "auto"
-
-
Size stringThe size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
string -
string-
const ToolImageGenerationSize1024x1024 ToolImageGenerationSize = "1024x1024" -
const ToolImageGenerationSize1024x1536 ToolImageGenerationSize = "1024x1536" -
const ToolImageGenerationSize1536x1024 ToolImageGenerationSize = "1536x1024" -
const ToolImageGenerationSizeAuto ToolImageGenerationSize = "auto"
-
-
-
-
type ToolLocalShell struct{…}A tool that allows the model to execute shell commands in a local environment.
-
Type LocalShellThe type of the local shell tool. Always
local_shell.const LocalShellLocalShell LocalShell = "local_shell"
-
-
type FunctionShellTool struct{…}A tool that allows the model to execute shell commands.
-
Type ShellThe type of the shell tool. Always
shell.const ShellShell Shell = "shell"
-
Environment FunctionShellToolEnvironmentUnion-
type ContainerAuto struct{…}-
Type ContainerAutoAutomatically creates a container for this request
const ContainerAutoContainerAuto ContainerAuto = "container_auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit ContainerAutoMemoryLimitThe memory limit for the container.
-
const ContainerAutoMemoryLimit1g ContainerAutoMemoryLimit = "1g" -
const ContainerAutoMemoryLimit4g ContainerAutoMemoryLimit = "4g" -
const ContainerAutoMemoryLimit16g ContainerAutoMemoryLimit = "16g" -
const ContainerAutoMemoryLimit64g ContainerAutoMemoryLimit = "64g"
-
-
NetworkPolicy ContainerAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…} -
type ContainerNetworkPolicyAllowlist struct{…}
-
-
Skills []ContainerAutoSkillUnionAn optional list of skills referenced by id or inline data.
-
type SkillReference struct{…}-
SkillID stringThe ID of the referenced skill.
-
Type SkillReferenceReferences a skill created with the /v1/skills endpoint.
const SkillReferenceSkillReference SkillReference = "skill_reference"
-
Version stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
type InlineSkill struct{…}-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Source InlineSkillSourceInline skill payload
-
Data stringBase64-encoded skill zip bundle.
-
MediaType ApplicationZipThe media type of the inline skill payload. Must be
application/zip.const ApplicationZipApplicationZip ApplicationZip = "application/zip"
-
Type Base64The type of the inline skill source. Must be
base64.const Base64Base64 Base64 = "base64"
-
-
Type InlineDefines an inline skill for this request.
const InlineInline Inline = "inline"
-
-
-
-
type LocalEnvironment struct{…}-
Type LocalUse a local computer environment.
const LocalLocal Local = "local"
-
Skills []LocalSkillAn optional list of skills.
-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Path stringThe path to the directory containing the skill.
-
-
-
type ContainerReference struct{…}-
ContainerID stringThe ID of the referenced container.
-
Type ContainerReferenceReferences a container created with the /v1/containers endpoint
const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
Name stringThe name of the custom tool, used to identify it in tool calls.
-
Type CustomThe type of the custom tool. Always
custom.const CustomCustom Custom = "custom"
-
DeferLoading boolWhether this tool should be deferred and discovered via tool search.
-
Description stringOptional description of the custom tool, used to provide more context.
-
Format CustomToolInputFormatUnionThe input format for the custom tool. Default is unconstrained text.
-
type CustomToolInputFormatText struct{…}Unconstrained free-form text.
-
Type TextUnconstrained text format. Always
text.const TextText Text = "text"
-
-
type CustomToolInputFormatGrammar struct{…}A grammar defined by the user.
-
Definition stringThe grammar definition.
-
Syntax stringThe syntax of the grammar definition. One of
larkorregex.-
const CustomToolInputFormatGrammarSyntaxLark CustomToolInputFormatGrammarSyntax = "lark" -
const CustomToolInputFormatGrammarSyntaxRegex CustomToolInputFormatGrammarSyntax = "regex"
-
-
Type GrammarGrammar format. Always
grammar.const GrammarGrammar Grammar = "grammar"
-
-
-
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
Description stringA description of the namespace shown to the model.
-
Name stringThe namespace name used in tool calls (for example,
crm). -
Tools []NamespaceToolToolUnionThe function/custom tools available inside this namespace.
-
type NamespaceToolToolFunction struct{…}-
Name string -
Type Functionconst FunctionFunction Function = "function"
-
DeferLoading boolWhether this function should be deferred and discovered via tool search.
-
Description string -
Parameters any -
Strict bool
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
-
Type NamespaceThe type of the tool. Always
namespace.const NamespaceNamespace Namespace = "namespace"
-
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
Type ToolSearchThe type of the tool. Always
tool_search.const ToolSearchToolSearch ToolSearch = "tool_search"
-
Description stringDescription shown to the model for a client-executed tool search tool.
-
Execution ToolSearchToolExecutionWhether tool search is executed by the server or by the client.
-
const ToolSearchToolExecutionServer ToolSearchToolExecution = "server" -
const ToolSearchToolExecutionClient ToolSearchToolExecution = "client"
-
-
Parameters anyParameter schema for a client-executed tool search tool.
-
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
Type WebSearchPreviewToolTypeThe type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
const WebSearchPreviewToolTypeWebSearchPreview WebSearchPreviewToolType = "web_search_preview" -
const WebSearchPreviewToolTypeWebSearchPreview2025_03_11 WebSearchPreviewToolType = "web_search_preview_2025_03_11"
-
-
SearchContentTypes []string-
const WebSearchPreviewToolSearchContentTypeText WebSearchPreviewToolSearchContentType = "text" -
const WebSearchPreviewToolSearchContentTypeImage WebSearchPreviewToolSearchContentType = "image"
-
-
SearchContextSize WebSearchPreviewToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchPreviewToolSearchContextSizeLow WebSearchPreviewToolSearchContextSize = "low" -
const WebSearchPreviewToolSearchContextSizeMedium WebSearchPreviewToolSearchContextSize = "medium" -
const WebSearchPreviewToolSearchContextSizeHigh WebSearchPreviewToolSearchContextSize = "high"
-
-
UserLocation WebSearchPreviewToolUserLocationThe user's location.
-
Type ApproximateThe type of location approximation. Always
approximate.const ApproximateApproximate Approximate = "approximate"
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
Type ApplyPatchThe type of the tool. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
-
Type ToolSearchOutputThe item type. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
ID stringThe unique ID of this tool search output.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemParamExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemParamExecutionServer ResponseToolSearchOutputItemParamExecution = "server" -
const ResponseToolSearchOutputItemParamExecutionClient ResponseToolSearchOutputItemParamExecution = "client"
-
-
Status ResponseToolSearchOutputItemParamStatusThe status of the tool search output.
-
const ResponseToolSearchOutputItemParamStatusInProgress ResponseToolSearchOutputItemParamStatus = "in_progress" -
const ResponseToolSearchOutputItemParamStatusCompleted ResponseToolSearchOutputItemParamStatus = "completed" -
const ResponseToolSearchOutputItemParamStatusIncomplete ResponseToolSearchOutputItemParamStatus = "incomplete"
-
-
-
type ResponseInputItemAdditionalTools struct{…}-
Role DeveloperThe role that provided the additional tools. Only
developeris supported.const DeveloperDeveloper Developer = "developer"
-
Tools []ToolUnionA list of additional tools made available at this item.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type AdditionalToolsThe item type. Always
additional_tools.const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"
-
ID stringThe unique ID of this additional tools item.
-
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
ID stringThe unique identifier of the reasoning content.
-
Summary []ResponseReasoningItemSummaryReasoning summary content.
-
Text stringA summary of the reasoning output from the model so far.
-
Type SummaryTextThe type of the object. Always
summary_text.const SummaryTextSummaryText SummaryText = "summary_text"
-
-
Type ReasoningThe type of the object. Always
reasoning.const ReasoningReasoning Reasoning = "reasoning"
-
Content []ResponseReasoningItemContentReasoning text content.
-
Text stringThe reasoning text from the model.
-
Type ReasoningTextThe type of the reasoning text. Always
reasoning_text.const ReasoningTextReasoningText ReasoningText = "reasoning_text"
-
-
EncryptedContent stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
Status ResponseReasoningItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseReasoningItemStatusInProgress ResponseReasoningItemStatus = "in_progress" -
const ResponseReasoningItemStatusCompleted ResponseReasoningItemStatus = "completed" -
const ResponseReasoningItemStatusIncomplete ResponseReasoningItemStatus = "incomplete"
-
-
-
type ResponseCompactionItemParamResp struct{…}A compaction item generated by the
v1/responses/compactAPI.-
EncryptedContent stringThe encrypted content of the compaction summary.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
ID stringThe ID of the compaction item.
-
-
type ResponseInputItemImageGenerationCall struct{…}An image generation request made by the model.
-
ID stringThe unique ID of the image generation call.
-
Result stringThe generated image encoded in base64.
-
Status stringThe status of the image generation call.
-
const ResponseInputItemImageGenerationCallStatusInProgress ResponseInputItemImageGenerationCallStatus = "in_progress" -
const ResponseInputItemImageGenerationCallStatusCompleted ResponseInputItemImageGenerationCallStatus = "completed" -
const ResponseInputItemImageGenerationCallStatusGenerating ResponseInputItemImageGenerationCallStatus = "generating" -
const ResponseInputItemImageGenerationCallStatusFailed ResponseInputItemImageGenerationCallStatus = "failed"
-
-
Type ImageGenerationCallThe type of the image generation call. Always
image_generation_call.const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"
-
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
ID stringThe unique ID of the code interpreter tool call.
-
Code stringThe code to run, or null if not available.
-
ContainerID stringThe ID of the container used to run the code.
-
Outputs []ResponseCodeInterpreterToolCallOutputUnionThe outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
type ResponseCodeInterpreterToolCallOutputLogs struct{…}The logs output from the code interpreter.
-
Logs stringThe logs output from the code interpreter.
-
Type LogsThe type of the output. Always
logs.const LogsLogs Logs = "logs"
-
-
type ResponseCodeInterpreterToolCallOutputImage struct{…}The image output from the code interpreter.
-
Type ImageThe type of the output. Always
image.const ImageImage Image = "image"
-
URL stringThe URL of the image output from the code interpreter.
-
-
-
Status ResponseCodeInterpreterToolCallStatusThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
const ResponseCodeInterpreterToolCallStatusInProgress ResponseCodeInterpreterToolCallStatus = "in_progress" -
const ResponseCodeInterpreterToolCallStatusCompleted ResponseCodeInterpreterToolCallStatus = "completed" -
const ResponseCodeInterpreterToolCallStatusIncomplete ResponseCodeInterpreterToolCallStatus = "incomplete" -
const ResponseCodeInterpreterToolCallStatusInterpreting ResponseCodeInterpreterToolCallStatus = "interpreting" -
const ResponseCodeInterpreterToolCallStatusFailed ResponseCodeInterpreterToolCallStatus = "failed"
-
-
Type CodeInterpreterCallThe type of the code interpreter tool call. Always
code_interpreter_call.const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"
-
-
type ResponseInputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
ID stringThe unique ID of the local shell call.
-
Action ResponseInputItemLocalShellCallActionExecute a shell command on the server.
-
Command []stringThe command to run.
-
Env map[string, string]Environment variables to set for the command.
-
Type ExecThe type of the local shell action. Always
exec.const ExecExec Exec = "exec"
-
TimeoutMs int64Optional timeout in milliseconds for the command.
-
User stringOptional user to run the command as.
-
WorkingDirectory stringOptional working directory to run the command in.
-
-
CallID stringThe unique ID of the local shell tool call generated by the model.
-
Status stringThe status of the local shell call.
-
const ResponseInputItemLocalShellCallStatusInProgress ResponseInputItemLocalShellCallStatus = "in_progress" -
const ResponseInputItemLocalShellCallStatusCompleted ResponseInputItemLocalShellCallStatus = "completed" -
const ResponseInputItemLocalShellCallStatusIncomplete ResponseInputItemLocalShellCallStatus = "incomplete"
-
-
Type LocalShellCallThe type of the local shell call. Always
local_shell_call.const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"
-
-
type ResponseInputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
ID stringThe unique ID of the local shell tool call generated by the model.
-
Output stringA JSON string of the output of the local shell tool call.
-
Type LocalShellCallOutputThe type of the local shell tool call output. Always
local_shell_call_output.const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete.-
const ResponseInputItemLocalShellCallOutputStatusInProgress ResponseInputItemLocalShellCallOutputStatus = "in_progress" -
const ResponseInputItemLocalShellCallOutputStatusCompleted ResponseInputItemLocalShellCallOutputStatus = "completed" -
const ResponseInputItemLocalShellCallOutputStatusIncomplete ResponseInputItemLocalShellCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemShellCall struct{…}A tool representing a request to execute one or more shell commands.
-
Action ResponseInputItemShellCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []stringOrdered shell commands for the execution environment to run.
-
MaxOutputLength int64Maximum number of UTF-8 characters to capture from combined stdout and stderr output.
-
TimeoutMs int64Maximum wall-clock time in milliseconds to allow the shell commands to run.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Environment ResponseInputItemShellCallEnvironmentUnionThe environment to execute the shell commands in.
-
type LocalEnvironment struct{…} -
type ContainerReference struct{…}
-
-
Status stringThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseInputItemShellCallStatusInProgress ResponseInputItemShellCallStatus = "in_progress" -
const ResponseInputItemShellCallStatusCompleted ResponseInputItemShellCallStatus = "completed" -
const ResponseInputItemShellCallStatusIncomplete ResponseInputItemShellCallStatus = "incomplete"
-
-
-
type ResponseInputItemShellCallOutput struct{…}The streamed output items emitted by a shell tool call.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Output []ResponseFunctionShellCallOutputContentCaptured chunks of stdout and stderr output, along with their associated outcomes.
-
Outcome ResponseFunctionShellCallOutputContentOutcomeUnionThe exit or timeout outcome associated with this shell call.
-
type ResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellCallOutputContentOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64The exit code returned by the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringCaptured stderr output for the shell call.
-
Stdout stringCaptured stdout output for the shell call.
-
-
Type ShellCallOutputThe type of the item. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
ID stringThe unique ID of the shell tool call output. Populated when this item is returned via API.
-
MaxOutputLength int64The maximum number of UTF-8 characters captured for this shell call's combined output.
-
Status stringThe status of the shell call output.
-
const ResponseInputItemShellCallOutputStatusInProgress ResponseInputItemShellCallOutputStatus = "in_progress" -
const ResponseInputItemShellCallOutputStatusCompleted ResponseInputItemShellCallOutputStatus = "completed" -
const ResponseInputItemShellCallOutputStatusIncomplete ResponseInputItemShellCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemApplyPatchCall struct{…}A tool call representing a request to create, delete, or update files using diff patches.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseInputItemApplyPatchCallOperationUnionThe specific create, delete, or update instruction for the apply_patch tool call.
-
type ResponseInputItemApplyPatchCallOperationCreateFile struct{…}Instruction for creating a new file via the apply_patch tool.
-
Diff stringUnified diff content to apply when creating the file.
-
Path stringPath of the file to create relative to the workspace root.
-
Type CreateFileThe operation type. Always
create_file.const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseInputItemApplyPatchCallOperationDeleteFile struct{…}Instruction for deleting an existing file via the apply_patch tool.
-
Path stringPath of the file to delete relative to the workspace root.
-
Type DeleteFileThe operation type. Always
delete_file.const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseInputItemApplyPatchCallOperationUpdateFile struct{…}Instruction for updating an existing file via the apply_patch tool.
-
Diff stringUnified diff content to apply to the existing file.
-
Path stringPath of the file to update relative to the workspace root.
-
Type UpdateFileThe operation type. Always
update_file.const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status stringThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseInputItemApplyPatchCallStatusInProgress ResponseInputItemApplyPatchCallStatus = "in_progress" -
const ResponseInputItemApplyPatchCallStatusCompleted ResponseInputItemApplyPatchCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
-
type ResponseInputItemApplyPatchCallOutput struct{…}The streamed output emitted by an apply patch tool call.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status stringThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseInputItemApplyPatchCallOutputStatusCompleted ResponseInputItemApplyPatchCallOutputStatus = "completed" -
const ResponseInputItemApplyPatchCallOutputStatusFailed ResponseInputItemApplyPatchCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
Output stringOptional human-readable log text from the apply patch tool (e.g., patch results or errors).
-
-
type ResponseInputItemMcpListTools struct{…}A list of tools available on an MCP server.
-
ID stringThe unique ID of the list.
-
ServerLabel stringThe label of the MCP server.
-
Tools []ResponseInputItemMcpListToolsToolThe tools available on the server.
-
InputSchema anyThe JSON schema describing the tool's input.
-
Name stringThe name of the tool.
-
Annotations anyAdditional annotations about the tool.
-
Description stringThe description of the tool.
-
-
Type McpListToolsThe type of the item. Always
mcp_list_tools.const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
-
Error stringError message if the server could not list tools.
-
-
type ResponseInputItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
ID stringThe unique ID of the approval request.
-
Arguments stringA JSON string of arguments for the tool.
-
Name stringThe name of the tool to run.
-
ServerLabel stringThe label of the MCP server making the request.
-
Type McpApprovalRequestThe type of the item. Always
mcp_approval_request.const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"
-
-
type ResponseInputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
ApprovalRequestID stringThe ID of the approval request being answered.
-
Approve boolWhether the request was approved.
-
Type McpApprovalResponseThe type of the item. Always
mcp_approval_response.const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
-
ID stringThe unique ID of the approval response
-
Reason stringOptional reason for the decision.
-
-
type ResponseInputItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
ID stringThe unique ID of the tool call.
-
Arguments stringA JSON string of the arguments passed to the tool.
-
Name stringThe name of the tool that was run.
-
ServerLabel stringThe label of the MCP server running the tool.
-
Type McpCallThe type of the item. Always
mcp_call.const McpCallMcpCall McpCall = "mcp_call"
-
ApprovalRequestID stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
Error stringThe error from the tool call, if any.
-
Output stringThe output from the tool call.
-
Status stringThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
const ResponseInputItemMcpCallStatusInProgress ResponseInputItemMcpCallStatus = "in_progress" -
const ResponseInputItemMcpCallStatusCompleted ResponseInputItemMcpCallStatus = "completed" -
const ResponseInputItemMcpCallStatusIncomplete ResponseInputItemMcpCallStatus = "incomplete" -
const ResponseInputItemMcpCallStatusCalling ResponseInputItemMcpCallStatus = "calling" -
const ResponseInputItemMcpCallStatusFailed ResponseInputItemMcpCallStatus = "failed"
-
-
-
type ResponseCustomToolCallOutput struct{…}The output of a custom tool call from your code, being sent back to the model.
-
CallID stringThe call ID, used to map this custom tool call output to a custom tool call.
-
Output ResponseCustomToolCallOutputOutputUnionThe output from the custom tool call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseCustomToolCallOutputOutputOutputContentList []ResponseCustomToolCallOutputOutputOutputContentListItemUnionText, image, or file output of the custom tool call.
-
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
-
Type CustomToolCallOutputThe type of the custom tool call output. Always
custom_tool_call_output.const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"
-
ID stringThe unique ID of the custom tool call output in the OpenAI platform.
-
-
type ResponseCustomToolCall struct{…}A call to a custom tool created by the model.
-
CallID stringAn identifier used to map this custom tool call to a tool call output.
-
Input stringThe input for the custom tool call generated by the model.
-
Name stringThe name of the custom tool being called.
-
Type CustomToolCallThe type of the custom tool call. Always
custom_tool_call.const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"
-
ID stringThe unique ID of the custom tool call in the OpenAI platform.
-
Namespace stringThe namespace of the custom tool being called.
-
-
type ResponseInputItemCompactionTrigger struct{…}Compacts the current context. Must be the final input item.
-
Type CompactionTriggerThe type of the item. Always
compaction_trigger.const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"
-
-
type ResponseInputItemItemReference struct{…}An internal identifier for an item to reference.
-
ID stringThe ID of the item to reference.
-
Type stringThe type of item to reference. Always
item_reference.const ResponseInputItemItemReferenceTypeItemReference ResponseInputItemItemReferenceType = "item_reference"
-
-
-
-
Metadata MetadataSet of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
-
Model ResponsesModelModel ID used to generate the response, like
gpt-4ooro3. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models.-
string -
type ChatModel string-
const ChatModelGPT5_4 ChatModel = "gpt-5.4" -
const ChatModelGPT5_4Mini ChatModel = "gpt-5.4-mini" -
const ChatModelGPT5_4Nano ChatModel = "gpt-5.4-nano" -
const ChatModelGPT5_4Mini2026_03_17 ChatModel = "gpt-5.4-mini-2026-03-17" -
const ChatModelGPT5_4Nano2026_03_17 ChatModel = "gpt-5.4-nano-2026-03-17" -
const ChatModelGPT5_3ChatLatest ChatModel = "gpt-5.3-chat-latest" -
const ChatModelGPT5_2 ChatModel = "gpt-5.2" -
const ChatModelGPT5_2_2025_12_11 ChatModel = "gpt-5.2-2025-12-11" -
const ChatModelGPT5_2ChatLatest ChatModel = "gpt-5.2-chat-latest" -
const ChatModelGPT5_2Pro ChatModel = "gpt-5.2-pro" -
const ChatModelGPT5_2Pro2025_12_11 ChatModel = "gpt-5.2-pro-2025-12-11" -
const ChatModelGPT5_1 ChatModel = "gpt-5.1" -
const ChatModelGPT5_1_2025_11_13 ChatModel = "gpt-5.1-2025-11-13" -
const ChatModelGPT5_1Codex ChatModel = "gpt-5.1-codex" -
const ChatModelGPT5_1Mini ChatModel = "gpt-5.1-mini" -
const ChatModelGPT5_1ChatLatest ChatModel = "gpt-5.1-chat-latest" -
const ChatModelGPT5 ChatModel = "gpt-5" -
const ChatModelGPT5Mini ChatModel = "gpt-5-mini" -
const ChatModelGPT5Nano ChatModel = "gpt-5-nano" -
const ChatModelGPT5_2025_08_07 ChatModel = "gpt-5-2025-08-07" -
const ChatModelGPT5Mini2025_08_07 ChatModel = "gpt-5-mini-2025-08-07" -
const ChatModelGPT5Nano2025_08_07 ChatModel = "gpt-5-nano-2025-08-07" -
const ChatModelGPT5ChatLatest ChatModel = "gpt-5-chat-latest" -
const ChatModelGPT4_1 ChatModel = "gpt-4.1" -
const ChatModelGPT4_1Mini ChatModel = "gpt-4.1-mini" -
const ChatModelGPT4_1Nano ChatModel = "gpt-4.1-nano" -
const ChatModelGPT4_1_2025_04_14 ChatModel = "gpt-4.1-2025-04-14" -
const ChatModelGPT4_1Mini2025_04_14 ChatModel = "gpt-4.1-mini-2025-04-14" -
const ChatModelGPT4_1Nano2025_04_14 ChatModel = "gpt-4.1-nano-2025-04-14" -
const ChatModelO4Mini ChatModel = "o4-mini" -
const ChatModelO4Mini2025_04_16 ChatModel = "o4-mini-2025-04-16" -
const ChatModelO3 ChatModel = "o3" -
const ChatModelO3_2025_04_16 ChatModel = "o3-2025-04-16" -
const ChatModelO3Mini ChatModel = "o3-mini" -
const ChatModelO3Mini2025_01_31 ChatModel = "o3-mini-2025-01-31" -
const ChatModelO1 ChatModel = "o1" -
const ChatModelO1_2024_12_17 ChatModel = "o1-2024-12-17" -
const ChatModelO1Preview ChatModel = "o1-preview" -
const ChatModelO1Preview2024_09_12 ChatModel = "o1-preview-2024-09-12" -
const ChatModelO1Mini ChatModel = "o1-mini" -
const ChatModelO1Mini2024_09_12 ChatModel = "o1-mini-2024-09-12" -
const ChatModelGPT4o ChatModel = "gpt-4o" -
const ChatModelGPT4o2024_11_20 ChatModel = "gpt-4o-2024-11-20" -
const ChatModelGPT4o2024_08_06 ChatModel = "gpt-4o-2024-08-06" -
const ChatModelGPT4o2024_05_13 ChatModel = "gpt-4o-2024-05-13" -
const ChatModelGPT4oAudioPreview ChatModel = "gpt-4o-audio-preview" -
const ChatModelGPT4oAudioPreview2024_10_01 ChatModel = "gpt-4o-audio-preview-2024-10-01" -
const ChatModelGPT4oAudioPreview2024_12_17 ChatModel = "gpt-4o-audio-preview-2024-12-17" -
const ChatModelGPT4oAudioPreview2025_06_03 ChatModel = "gpt-4o-audio-preview-2025-06-03" -
const ChatModelGPT4oMiniAudioPreview ChatModel = "gpt-4o-mini-audio-preview" -
const ChatModelGPT4oMiniAudioPreview2024_12_17 ChatModel = "gpt-4o-mini-audio-preview-2024-12-17" -
const ChatModelGPT4oSearchPreview ChatModel = "gpt-4o-search-preview" -
const ChatModelGPT4oMiniSearchPreview ChatModel = "gpt-4o-mini-search-preview" -
const ChatModelGPT4oSearchPreview2025_03_11 ChatModel = "gpt-4o-search-preview-2025-03-11" -
const ChatModelGPT4oMiniSearchPreview2025_03_11 ChatModel = "gpt-4o-mini-search-preview-2025-03-11" -
const ChatModelChatgpt4oLatest ChatModel = "chatgpt-4o-latest" -
const ChatModelCodexMiniLatest ChatModel = "codex-mini-latest" -
const ChatModelGPT4oMini ChatModel = "gpt-4o-mini" -
const ChatModelGPT4oMini2024_07_18 ChatModel = "gpt-4o-mini-2024-07-18" -
const ChatModelGPT4Turbo ChatModel = "gpt-4-turbo" -
const ChatModelGPT4Turbo2024_04_09 ChatModel = "gpt-4-turbo-2024-04-09" -
const ChatModelGPT4_0125Preview ChatModel = "gpt-4-0125-preview" -
const ChatModelGPT4TurboPreview ChatModel = "gpt-4-turbo-preview" -
const ChatModelGPT4_1106Preview ChatModel = "gpt-4-1106-preview" -
const ChatModelGPT4VisionPreview ChatModel = "gpt-4-vision-preview" -
const ChatModelGPT4 ChatModel = "gpt-4" -
const ChatModelGPT4_0314 ChatModel = "gpt-4-0314" -
const ChatModelGPT4_0613 ChatModel = "gpt-4-0613" -
const ChatModelGPT4_32k ChatModel = "gpt-4-32k" -
const ChatModelGPT4_32k0314 ChatModel = "gpt-4-32k-0314" -
const ChatModelGPT4_32k0613 ChatModel = "gpt-4-32k-0613" -
const ChatModelGPT3_5Turbo ChatModel = "gpt-3.5-turbo" -
const ChatModelGPT3_5Turbo16k ChatModel = "gpt-3.5-turbo-16k" -
const ChatModelGPT3_5Turbo0301 ChatModel = "gpt-3.5-turbo-0301" -
const ChatModelGPT3_5Turbo0613 ChatModel = "gpt-3.5-turbo-0613" -
const ChatModelGPT3_5Turbo1106 ChatModel = "gpt-3.5-turbo-1106" -
const ChatModelGPT3_5Turbo0125 ChatModel = "gpt-3.5-turbo-0125" -
const ChatModelGPT3_5Turbo16k0613 ChatModel = "gpt-3.5-turbo-16k-0613"
-
-
type ResponsesModel string-
const ResponsesModelO1Pro ResponsesModel = "o1-pro" -
const ResponsesModelO1Pro2025_03_19 ResponsesModel = "o1-pro-2025-03-19" -
const ResponsesModelO3Pro ResponsesModel = "o3-pro" -
const ResponsesModelO3Pro2025_06_10 ResponsesModel = "o3-pro-2025-06-10" -
const ResponsesModelO3DeepResearch ResponsesModel = "o3-deep-research" -
const ResponsesModelO3DeepResearch2025_06_26 ResponsesModel = "o3-deep-research-2025-06-26" -
const ResponsesModelO4MiniDeepResearch ResponsesModel = "o4-mini-deep-research" -
const ResponsesModelO4MiniDeepResearch2025_06_26 ResponsesModel = "o4-mini-deep-research-2025-06-26" -
const ResponsesModelComputerUsePreview ResponsesModel = "computer-use-preview" -
const ResponsesModelComputerUsePreview2025_03_11 ResponsesModel = "computer-use-preview-2025-03-11" -
const ResponsesModelGPT5Codex ResponsesModel = "gpt-5-codex" -
const ResponsesModelGPT5Pro ResponsesModel = "gpt-5-pro" -
const ResponsesModelGPT5Pro2025_10_06 ResponsesModel = "gpt-5-pro-2025-10-06" -
const ResponsesModelGPT5_1CodexMax ResponsesModel = "gpt-5.1-codex-max"
-
-
-
Object ResponseThe object type of this resource - always set to
response.const ResponseResponse Response = "response"
-
Output []ResponseOutputItemUnionAn array of content items generated by the model.
-
The length and order of items in the
outputarray is dependent on the model's response. -
Rather than accessing the first item in the
outputarray and assuming it's anassistantmessage with the content generated by the model, you might consider using theoutput_textproperty where supported in SDKs. -
type ResponseOutputMessage struct{…}An output message from the model.
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
type ResponseFunctionToolCall struct{…}A tool call to run a function. See the function calling guide for more information.
-
type ResponseFunctionToolCallOutputItem struct{…}-
ID stringThe unique ID of the function call tool output.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseFunctionToolCallOutputItemOutputUnionThe output from the function call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseFunctionToolCallOutputItemOutputOutputContentList []ResponseFunctionToolCallOutputItemOutputOutputContentListItemUnionText, image, or file output of the function call.
-
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
-
Status ResponseFunctionToolCallOutputItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallOutputItemStatusInProgress ResponseFunctionToolCallOutputItemStatus = "in_progress" -
const ResponseFunctionToolCallOutputItemStatusCompleted ResponseFunctionToolCallOutputItemStatus = "completed" -
const ResponseFunctionToolCallOutputItemStatusIncomplete ResponseFunctionToolCallOutputItemStatus = "incomplete"
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
type ResponseComputerToolCallOutputItem struct{…}-
ID stringThe unique ID of the computer call tool output.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Status ResponseComputerToolCallOutputItemStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseComputerToolCallOutputItemStatusCompleted ResponseComputerToolCallOutputItemStatus = "completed" -
const ResponseComputerToolCallOutputItemStatusIncomplete ResponseComputerToolCallOutputItemStatus = "incomplete" -
const ResponseComputerToolCallOutputItemStatusFailed ResponseComputerToolCallOutputItemStatus = "failed" -
const ResponseComputerToolCallOutputItemStatusInProgress ResponseComputerToolCallOutputItemStatus = "in_progress"
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
AcknowledgedSafetyChecks []ResponseComputerToolCallOutputItemAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context. -
type ResponseToolSearchCall struct{…}-
ID stringThe unique ID of the tool search call item.
-
Arguments anyArguments used for the tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchCallExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchCallExecutionServer ResponseToolSearchCallExecution = "server" -
const ResponseToolSearchCallExecutionClient ResponseToolSearchCallExecution = "client"
-
-
Status ResponseToolSearchCallStatusThe status of the tool search call item that was recorded.
-
const ResponseToolSearchCallStatusInProgress ResponseToolSearchCallStatus = "in_progress" -
const ResponseToolSearchCallStatusCompleted ResponseToolSearchCallStatus = "completed" -
const ResponseToolSearchCallStatusIncomplete ResponseToolSearchCallStatus = "incomplete"
-
-
Type ToolSearchCallThe type of the item. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseToolSearchOutputItem struct{…}-
ID stringThe unique ID of the tool search output item.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemExecutionServer ResponseToolSearchOutputItemExecution = "server" -
const ResponseToolSearchOutputItemExecutionClient ResponseToolSearchOutputItemExecution = "client"
-
-
Status ResponseToolSearchOutputItemStatusThe status of the tool search output item that was recorded.
-
const ResponseToolSearchOutputItemStatusInProgress ResponseToolSearchOutputItemStatus = "in_progress" -
const ResponseToolSearchOutputItemStatusCompleted ResponseToolSearchOutputItemStatus = "completed" -
const ResponseToolSearchOutputItemStatusIncomplete ResponseToolSearchOutputItemStatus = "incomplete"
-
-
Tools []ToolUnionThe loaded tool definitions returned by tool search.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type ToolSearchOutputThe type of the item. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseOutputItemAdditionalTools struct{…}-
ID stringThe unique ID of the additional tools item.
-
Role stringThe role that provided the additional tools.
-
const ResponseOutputItemAdditionalToolsRoleUnknown ResponseOutputItemAdditionalToolsRole = "unknown" -
const ResponseOutputItemAdditionalToolsRoleUser ResponseOutputItemAdditionalToolsRole = "user" -
const ResponseOutputItemAdditionalToolsRoleAssistant ResponseOutputItemAdditionalToolsRole = "assistant" -
const ResponseOutputItemAdditionalToolsRoleSystem ResponseOutputItemAdditionalToolsRole = "system" -
const ResponseOutputItemAdditionalToolsRoleCritic ResponseOutputItemAdditionalToolsRole = "critic" -
const ResponseOutputItemAdditionalToolsRoleDiscriminator ResponseOutputItemAdditionalToolsRole = "discriminator" -
const ResponseOutputItemAdditionalToolsRoleDeveloper ResponseOutputItemAdditionalToolsRole = "developer" -
const ResponseOutputItemAdditionalToolsRoleTool ResponseOutputItemAdditionalToolsRole = "tool"
-
-
Tools []ToolUnionThe additional tool definitions made available at this item.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type AdditionalToolsThe type of the item. Always
additional_tools.const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"
-
-
type ResponseCompactionItem struct{…}A compaction item generated by the
v1/responses/compactAPI.-
ID stringThe unique ID of the compaction item.
-
EncryptedContent stringThe encrypted content that was produced by compaction.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseOutputItemImageGenerationCall struct{…}An image generation request made by the model.
-
ID stringThe unique ID of the image generation call.
-
Result stringThe generated image encoded in base64.
-
Status stringThe status of the image generation call.
-
const ResponseOutputItemImageGenerationCallStatusInProgress ResponseOutputItemImageGenerationCallStatus = "in_progress" -
const ResponseOutputItemImageGenerationCallStatusCompleted ResponseOutputItemImageGenerationCallStatus = "completed" -
const ResponseOutputItemImageGenerationCallStatusGenerating ResponseOutputItemImageGenerationCallStatus = "generating" -
const ResponseOutputItemImageGenerationCallStatusFailed ResponseOutputItemImageGenerationCallStatus = "failed"
-
-
Type ImageGenerationCallThe type of the image generation call. Always
image_generation_call.const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"
-
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
type ResponseOutputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
ID stringThe unique ID of the local shell call.
-
Action ResponseOutputItemLocalShellCallActionExecute a shell command on the server.
-
Command []stringThe command to run.
-
Env map[string, string]Environment variables to set for the command.
-
Type ExecThe type of the local shell action. Always
exec.const ExecExec Exec = "exec"
-
TimeoutMs int64Optional timeout in milliseconds for the command.
-
User stringOptional user to run the command as.
-
WorkingDirectory stringOptional working directory to run the command in.
-
-
CallID stringThe unique ID of the local shell tool call generated by the model.
-
Status stringThe status of the local shell call.
-
const ResponseOutputItemLocalShellCallStatusInProgress ResponseOutputItemLocalShellCallStatus = "in_progress" -
const ResponseOutputItemLocalShellCallStatusCompleted ResponseOutputItemLocalShellCallStatus = "completed" -
const ResponseOutputItemLocalShellCallStatusIncomplete ResponseOutputItemLocalShellCallStatus = "incomplete"
-
-
Type LocalShellCallThe type of the local shell call. Always
local_shell_call.const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"
-
-
type ResponseOutputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
ID stringThe unique ID of the local shell tool call generated by the model.
-
Output stringA JSON string of the output of the local shell tool call.
-
Type LocalShellCallOutputThe type of the local shell tool call output. Always
local_shell_call_output.const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete.-
const ResponseOutputItemLocalShellCallOutputStatusInProgress ResponseOutputItemLocalShellCallOutputStatus = "in_progress" -
const ResponseOutputItemLocalShellCallOutputStatusCompleted ResponseOutputItemLocalShellCallOutputStatus = "completed" -
const ResponseOutputItemLocalShellCallOutputStatusIncomplete ResponseOutputItemLocalShellCallOutputStatus = "incomplete"
-
-
-
type ResponseFunctionShellToolCall struct{…}A tool call that executes one or more shell commands in a managed environment.
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Action ResponseFunctionShellToolCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []string -
MaxOutputLength int64Optional maximum number of characters to return from each command.
-
TimeoutMs int64Optional timeout in milliseconds for the commands.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Environment ResponseFunctionShellToolCallEnvironmentUnionRepresents the use of a local environment to perform shell actions.
-
type ResponseLocalEnvironment struct{…}Represents the use of a local environment to perform shell actions.
-
Type LocalThe environment type. Always
local.const LocalLocal Local = "local"
-
-
type ResponseContainerReference struct{…}Represents a container created with /v1/containers.
-
ContainerID string -
Type ContainerReferenceThe environment type. Always
container_reference.const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
Status ResponseFunctionShellToolCallStatusThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallStatusInProgress ResponseFunctionShellToolCallStatus = "in_progress" -
const ResponseFunctionShellToolCallStatusCompleted ResponseFunctionShellToolCallStatus = "completed" -
const ResponseFunctionShellToolCallStatusIncomplete ResponseFunctionShellToolCallStatus = "incomplete"
-
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseFunctionShellToolCallOutput struct{…}The output of a shell tool call that was emitted.
-
ID stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
MaxOutputLength int64The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
Output []ResponseFunctionShellToolCallOutputOutputAn array of shell call output contents
-
Outcome ResponseFunctionShellToolCallOutputOutputOutcomeUnionRepresents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
type ResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64Exit code from the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringThe standard error output that was captured.
-
Stdout stringThe standard output that was captured.
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
Status ResponseFunctionShellToolCallOutputStatusThe status of the shell call output. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallOutputStatusInProgress ResponseFunctionShellToolCallOutputStatus = "in_progress" -
const ResponseFunctionShellToolCallOutputStatusCompleted ResponseFunctionShellToolCallOutputStatus = "completed" -
const ResponseFunctionShellToolCallOutputStatusIncomplete ResponseFunctionShellToolCallOutputStatus = "incomplete"
-
-
Type ShellCallOutputThe type of the shell call output. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseApplyPatchToolCall struct{…}A tool call that applies file diffs by creating, deleting, or updating files.
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseApplyPatchToolCallOperationUnionOne of the create_file, delete_file, or update_file operations applied via apply_patch.
-
type ResponseApplyPatchToolCallOperationCreateFile struct{…}Instruction describing how to create a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to create.
-
Type CreateFileCreate a new file with the provided diff.
const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseApplyPatchToolCallOperationDeleteFile struct{…}Instruction describing how to delete a file via the apply_patch tool.
-
Path stringPath of the file to delete.
-
Type DeleteFileDelete the specified file.
const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseApplyPatchToolCallOperationUpdateFile struct{…}Instruction describing how to update a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to update.
-
Type UpdateFileUpdate an existing file with the provided diff.
const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status ResponseApplyPatchToolCallStatusThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseApplyPatchToolCallStatusInProgress ResponseApplyPatchToolCallStatus = "in_progress" -
const ResponseApplyPatchToolCallStatusCompleted ResponseApplyPatchToolCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseApplyPatchToolCallOutput struct{…}The output emitted by an apply patch tool call.
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status ResponseApplyPatchToolCallOutputStatusThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseApplyPatchToolCallOutputStatusCompleted ResponseApplyPatchToolCallOutputStatus = "completed" -
const ResponseApplyPatchToolCallOutputStatusFailed ResponseApplyPatchToolCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
CreatedBy stringThe ID of the entity that created this tool call output.
-
Output stringOptional textual output returned by the apply patch tool.
-
-
type ResponseOutputItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
ID stringThe unique ID of the tool call.
-
Arguments stringA JSON string of the arguments passed to the tool.
-
Name stringThe name of the tool that was run.
-
ServerLabel stringThe label of the MCP server running the tool.
-
Type McpCallThe type of the item. Always
mcp_call.const McpCallMcpCall McpCall = "mcp_call"
-
ApprovalRequestID stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
Error stringThe error from the tool call, if any.
-
Output stringThe output from the tool call.
-
Status stringThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
const ResponseOutputItemMcpCallStatusInProgress ResponseOutputItemMcpCallStatus = "in_progress" -
const ResponseOutputItemMcpCallStatusCompleted ResponseOutputItemMcpCallStatus = "completed" -
const ResponseOutputItemMcpCallStatusIncomplete ResponseOutputItemMcpCallStatus = "incomplete" -
const ResponseOutputItemMcpCallStatusCalling ResponseOutputItemMcpCallStatus = "calling" -
const ResponseOutputItemMcpCallStatusFailed ResponseOutputItemMcpCallStatus = "failed"
-
-
-
type ResponseOutputItemMcpListTools struct{…}A list of tools available on an MCP server.
-
ID stringThe unique ID of the list.
-
ServerLabel stringThe label of the MCP server.
-
Tools []ResponseOutputItemMcpListToolsToolThe tools available on the server.
-
InputSchema anyThe JSON schema describing the tool's input.
-
Name stringThe name of the tool.
-
Annotations anyAdditional annotations about the tool.
-
Description stringThe description of the tool.
-
-
Type McpListToolsThe type of the item. Always
mcp_list_tools.const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
-
Error stringError message if the server could not list tools.
-
-
type ResponseOutputItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
ID stringThe unique ID of the approval request.
-
Arguments stringA JSON string of arguments for the tool.
-
Name stringThe name of the tool to run.
-
ServerLabel stringThe label of the MCP server making the request.
-
Type McpApprovalRequestThe type of the item. Always
mcp_approval_request.const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"
-
-
type ResponseOutputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
ID stringThe unique ID of the approval response
-
ApprovalRequestID stringThe ID of the approval request being answered.
-
Approve boolWhether the request was approved.
-
Type McpApprovalResponseThe type of the item. Always
mcp_approval_response.const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
-
Reason stringOptional reason for the decision.
-
-
type ResponseCustomToolCall struct{…}A call to a custom tool created by the model.
-
type ResponseCustomToolCallOutputItem struct{…}The output of a custom tool call from your code, being sent back to the model.
-
ID stringThe unique ID of the custom tool call output item.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseCustomToolCallOutputItemStatusInProgress ResponseCustomToolCallOutputItemStatus = "in_progress" -
const ResponseCustomToolCallOutputItemStatusCompleted ResponseCustomToolCallOutputItemStatus = "completed" -
const ResponseCustomToolCallOutputItemStatusIncomplete ResponseCustomToolCallOutputItemStatus = "incomplete"
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
-
ParallelToolCalls boolWhether to allow the model to run tool calls in parallel.
-
Temperature float64What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or
top_pbut not both. -
ToolChoice ResponseToolChoiceUnionHow the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call.-
type ToolChoiceOptions stringControls which (if any) tool is called by the model.
nonemeans the model will not call any tool and instead generates a message.automeans the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools.-
const ToolChoiceOptionsNone ToolChoiceOptions = "none" -
const ToolChoiceOptionsAuto ToolChoiceOptions = "auto" -
const ToolChoiceOptionsRequired ToolChoiceOptions = "required"
-
-
type ToolChoiceAllowed struct{…}Constrains the tools available to the model to a pre-defined set.
-
Mode ToolChoiceAllowedModeConstrains the tools available to the model to a pre-defined set.
autoallows the model to pick from among the allowed tools and generate a message.requiredrequires the model to call one or more of the allowed tools.-
const ToolChoiceAllowedModeAuto ToolChoiceAllowedMode = "auto" -
const ToolChoiceAllowedModeRequired ToolChoiceAllowedMode = "required"
-
-
Tools []map[string, any]A list of tool definitions that the model should be allowed to call.
For the Responses API, the list of tool definitions might look like:
[ { "type": "function", "name": "get_weather" }, { "type": "mcp", "server_label": "deepwiki" }, { "type": "image_generation" } ] -
Type AllowedToolsAllowed tool configuration type. Always
allowed_tools.const AllowedToolsAllowedTools AllowedTools = "allowed_tools"
-
-
type ToolChoiceTypes struct{…}Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
-
Type ToolChoiceTypesTypeThe type of hosted tool the model should to use. Learn more about built-in tools.
Allowed values are:
-
file_search -
web_search_preview -
computer -
computer_use_preview -
computer_use -
code_interpreter -
image_generation -
const ToolChoiceTypesTypeFileSearch ToolChoiceTypesType = "file_search" -
const ToolChoiceTypesTypeWebSearchPreview ToolChoiceTypesType = "web_search_preview" -
const ToolChoiceTypesTypeComputer ToolChoiceTypesType = "computer" -
const ToolChoiceTypesTypeComputerUsePreview ToolChoiceTypesType = "computer_use_preview" -
const ToolChoiceTypesTypeComputerUse ToolChoiceTypesType = "computer_use" -
const ToolChoiceTypesTypeWebSearchPreview2025_03_11 ToolChoiceTypesType = "web_search_preview_2025_03_11" -
const ToolChoiceTypesTypeImageGeneration ToolChoiceTypesType = "image_generation" -
const ToolChoiceTypesTypeCodeInterpreter ToolChoiceTypesType = "code_interpreter"
-
-
-
type ToolChoiceFunction struct{…}Use this option to force the model to call a specific function.
-
Name stringThe name of the function to call.
-
Type FunctionFor function calling, the type is always
function.const FunctionFunction Function = "function"
-
-
type ToolChoiceMcp struct{…}Use this option to force the model to call a specific tool on a remote MCP server.
-
ServerLabel stringThe label of the MCP server to use.
-
Type McpFor MCP tools, the type is always
mcp.const McpMcp Mcp = "mcp"
-
Name stringThe name of the tool to call on the server.
-
-
type ToolChoiceCustom struct{…}Use this option to force the model to call a specific custom tool.
-
Name stringThe name of the custom tool to call.
-
Type CustomFor custom tool calling, the type is always
custom.const CustomCustom Custom = "custom"
-
-
type ToolChoiceApplyPatch struct{…}Forces the model to call the apply_patch tool when executing a tool call.
-
Type ApplyPatchThe tool to call. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
type ToolChoiceShell struct{…}Forces the model to call the shell tool when a tool call is required.
-
Type ShellThe tool to call. Always
shell.const ShellShell Shell = "shell"
-
-
-
Tools []ToolUnionAn array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.We support the following categories of tools:
-
Built-in tools: Tools that are provided by OpenAI that extend the model's capabilities, like web search or file search. Learn more about built-in tools.
-
MCP Tools: Integrations with third-party systems via custom MCP servers or predefined connectors such as Google Drive and SharePoint. Learn more about MCP Tools.
-
Function calls (custom tools): Functions that are defined by you, enabling the model to call your own code with strongly typed arguments and outputs. Learn more about function calling. You can also use custom tools to call your own code.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
TopP float64An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
We generally recommend altering this or
temperaturebut not both. -
Background boolWhether to run the model response in the background. Learn more.
-
CompletedAt float64Unix timestamp (in seconds) of when this Response was completed. Only present when the status is
completed. -
Conversation ResponseConversationThe conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
-
ID stringThe unique ID of the conversation that this response was associated with.
-
-
MaxOutputTokens int64An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
MaxToolCalls int64The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored.
-
Moderation ResponseModerationModeration results for the response input and output, if moderated completions were requested.
-
Input ResponseModerationInputUnionModeration for the response input.
-
type ResponseModerationInputModerationResult struct{…}A moderation result produced for the response input or output.
-
Categories map[string, bool]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
CategoryAppliedInputTypes map[string, []string]Which modalities of input are reflected by the score for each category.
-
const ResponseModerationInputModerationResultCategoryAppliedInputTypeText ResponseModerationInputModerationResultCategoryAppliedInputType = "text" -
const ResponseModerationInputModerationResultCategoryAppliedInputTypeImage ResponseModerationInputModerationResultCategoryAppliedInputType = "image"
-
-
CategoryScores map[string, float64]A dictionary of moderation categories to scores.
-
Flagged boolA boolean indicating whether the content was flagged by any category.
-
Model stringThe moderation model that produced this result.
-
Type ModerationResultThe object type, which was always
moderation_resultfor successful moderation results.const ModerationResultModerationResult ModerationResult = "moderation_result"
-
-
type ResponseModerationInputError struct{…}An error produced while attempting moderation for the response input or output.
-
Code stringThe error code.
-
Message stringThe error message.
-
Type ErrorThe object type, which was always
errorfor moderation failures.const ErrorError Error = "error"
-
-
-
Output ResponseModerationOutputUnionModeration for the response output.
-
type ResponseModerationOutputModerationResult struct{…}A moderation result produced for the response input or output.
-
Categories map[string, bool]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
CategoryAppliedInputTypes map[string, []string]Which modalities of input are reflected by the score for each category.
-
const ResponseModerationOutputModerationResultCategoryAppliedInputTypeText ResponseModerationOutputModerationResultCategoryAppliedInputType = "text" -
const ResponseModerationOutputModerationResultCategoryAppliedInputTypeImage ResponseModerationOutputModerationResultCategoryAppliedInputType = "image"
-
-
CategoryScores map[string, float64]A dictionary of moderation categories to scores.
-
Flagged boolA boolean indicating whether the content was flagged by any category.
-
Model stringThe moderation model that produced this result.
-
Type ModerationResultThe object type, which was always
moderation_resultfor successful moderation results.const ModerationResultModerationResult ModerationResult = "moderation_result"
-
-
type ResponseModerationOutputError struct{…}An error produced while attempting moderation for the response input or output.
-
Code stringThe error code.
-
Message stringThe error message.
-
Type ErrorThe object type, which was always
errorfor moderation failures.const ErrorError Error = "error"
-
-
-
-
PreviousResponseID stringThe unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about conversation state. Cannot be used in conjunction with
conversation. -
Prompt ResponsePromptReference to a prompt template and its variables. Learn more.
-
ID stringThe unique identifier of the prompt template to use.
-
Variables map[string, ResponsePromptVariableUnion]Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files.
-
string -
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
Version stringOptional version of the prompt template.
-
-
PromptCacheKey stringUsed by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more. -
PromptCacheRetention ResponsePromptCacheRetentionThe retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. Forgpt-5.5,gpt-5.5-pro, and future models, only24his supported.For older models that support both
in_memoryand24h, the default depends on your organization's data retention policy:-
Organizations without ZDR enabled default to
24h. -
Organizations with ZDR enabled default to
in_memorywhenprompt_cache_retentionis not specified. -
const ResponsePromptCacheRetentionInMemory ResponsePromptCacheRetention = "in_memory" -
const ResponsePromptCacheRetention24h ResponsePromptCacheRetention = "24h"
-
-
Reasoning Reasoninggpt-5 and o-series models only
Configuration options for reasoning models.
-
Context ReasoningContextControls which reasoning items are rendered back to the model on later turns. When returned on a response, this is the effective reasoning context mode used for the response.
-
const ReasoningContextAuto ReasoningContext = "auto" -
const ReasoningContextCurrentTurn ReasoningContext = "current_turn" -
const ReasoningContextAllTurns ReasoningContext = "all_turns"
-
-
Effort ReasoningEffortConstrains effort on reasoning for reasoning models. Currently supported values are
none,minimal,low,medium,high, andxhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.-
gpt-5.1defaults tonone, which does not perform reasoning. The supported reasoning values forgpt-5.1arenone,low,medium, andhigh. Tool calls are supported for all reasoning values in gpt-5.1. -
All models before
gpt-5.1default tomediumreasoning effort, and do not supportnone. -
The
gpt-5-promodel defaults to (and only supports)highreasoning effort. -
xhighis supported for all models aftergpt-5.1-codex-max. -
const ReasoningEffortNone ReasoningEffort = "none" -
const ReasoningEffortMinimal ReasoningEffort = "minimal" -
const ReasoningEffortLow ReasoningEffort = "low" -
const ReasoningEffortMedium ReasoningEffort = "medium" -
const ReasoningEffortHigh ReasoningEffort = "high" -
const ReasoningEffortXhigh ReasoningEffort = "xhigh"
-
-
GenerateSummary ReasoningGenerateSummaryDeprecated: use
summaryinstead.A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.-
const ReasoningGenerateSummaryAuto ReasoningGenerateSummary = "auto" -
const ReasoningGenerateSummaryConcise ReasoningGenerateSummary = "concise" -
const ReasoningGenerateSummaryDetailed ReasoningGenerateSummary = "detailed"
-
-
Summary ReasoningSummaryA summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.conciseis supported forcomputer-use-previewmodels and all reasoning models aftergpt-5.-
const ReasoningSummaryAuto ReasoningSummary = "auto" -
const ReasoningSummaryConcise ReasoningSummary = "concise" -
const ReasoningSummaryDetailed ReasoningSummary = "detailed"
-
-
-
SafetyIdentifier stringA stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
ServiceTier ResponseServiceTierSpecifies the processing type used for serving the request.
- If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'.
- If set to 'default', then the request will be processed with the standard pricing and performance for the selected model.
- If set to 'flex' or 'priority', then the request will be processed with the corresponding service tier.
- When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.-
const ResponseServiceTierAuto ResponseServiceTier = "auto" -
const ResponseServiceTierDefault ResponseServiceTier = "default" -
const ResponseServiceTierFlex ResponseServiceTier = "flex" -
const ResponseServiceTierScale ResponseServiceTier = "scale" -
const ResponseServiceTierPriority ResponseServiceTier = "priority"
-
Status ResponseStatusThe status of the response generation. One of
completed,failed,in_progress,cancelled,queued, orincomplete.-
const ResponseStatusCompleted ResponseStatus = "completed" -
const ResponseStatusFailed ResponseStatus = "failed" -
const ResponseStatusInProgress ResponseStatus = "in_progress" -
const ResponseStatusCancelled ResponseStatus = "cancelled" -
const ResponseStatusQueued ResponseStatus = "queued" -
const ResponseStatusIncomplete ResponseStatus = "incomplete"
-
-
Text ResponseTextConfigConfiguration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
Format ResponseFormatTextConfigUnionAn object specifying the format that the model must output.
Configuring
{ "type": "json_schema" }enables Structured Outputs, which ensures the model will match your supplied JSON schema. Learn more in the Structured Outputs guide.The default format is
{ "type": "text" }with no additional options.Not recommended for gpt-4o and newer models:
Setting to
{ "type": "json_object" }enables the older JSON mode, which ensures the message the model generates is valid JSON. Usingjson_schemais preferred for models that support it.-
type ResponseFormatText struct{…}Default response format. Used to generate text responses.
-
Type TextThe type of response format being defined. Always
text.const TextText Text = "text"
-
-
type ResponseFormatTextJSONSchemaConfig struct{…}JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
Name stringThe name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
-
Schema map[string, any]The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
-
Type JSONSchemaThe type of response format being defined. Always
json_schema.const JSONSchemaJSONSchema JSONSchema = "json_schema"
-
Description stringA description of what the response format is for, used by the model to determine how to respond in the format.
-
Strict boolWhether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the
schemafield. Only a subset of JSON Schema is supported whenstrictistrue. To learn more, read the Structured Outputs guide.
-
-
type ResponseFormatJSONObject struct{…}JSON object response format. An older method of generating JSON responses. Using
json_schemais 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 JSONObjectThe type of response format being defined. Always
json_object.const JSONObjectJSONObject JSONObject = "json_object"
-
-
-
Verbosity ResponseTextConfigVerbosityConstrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses. Currently supported values are
low,medium, andhigh.-
const ResponseTextConfigVerbosityLow ResponseTextConfigVerbosity = "low" -
const ResponseTextConfigVerbosityMedium ResponseTextConfigVerbosity = "medium" -
const ResponseTextConfigVerbosityHigh ResponseTextConfigVerbosity = "high"
-
-
TopLogprobs int64An integer between 0 and 20 specifying the maximum number of most likely tokens to return at each token position, each with an associated log probability. In some cases, the number of returned tokens may be fewer than requested.
-
Truncation ResponseTruncationThe truncation strategy to use for the model response.
-
auto: If the input to this Response exceeds the model's context window size, the model will truncate the response to fit the context window by dropping items from the beginning of the conversation. -
disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error. -
const ResponseTruncationAuto ResponseTruncation = "auto" -
const ResponseTruncationDisabled ResponseTruncation = "disabled"
-
-
Usage ResponseUsageRepresents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
-
InputTokens int64The number of input tokens.
-
InputTokensDetails ResponseUsageInputTokensDetailsA detailed breakdown of the input tokens.
-
CachedTokens int64The number of tokens that were retrieved from the cache. More on prompt caching.
-
-
OutputTokens int64The number of output tokens.
-
OutputTokensDetails ResponseUsageOutputTokensDetailsA detailed breakdown of the output tokens.
-
ReasoningTokens int64The number of reasoning tokens.
-
-
TotalTokens int64The total number of tokens used.
-
-
User stringThis field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead to maintain caching optimizations. A stable identifier for your end-users. Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. Learn more.
-
-
SequenceNumber int64The sequence number for this event.
-
Type ResponseQueuedThe type of the event. Always 'response.queued'.
const ResponseQueuedResponseQueued ResponseQueued = "response.queued"
-
Response Reasoning Item
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
ID stringThe unique identifier of the reasoning content.
-
Summary []ResponseReasoningItemSummaryReasoning summary content.
-
Text stringA summary of the reasoning output from the model so far.
-
Type SummaryTextThe type of the object. Always
summary_text.const SummaryTextSummaryText SummaryText = "summary_text"
-
-
Type ReasoningThe type of the object. Always
reasoning.const ReasoningReasoning Reasoning = "reasoning"
-
Content []ResponseReasoningItemContentReasoning text content.
-
Text stringThe reasoning text from the model.
-
Type ReasoningTextThe type of the reasoning text. Always
reasoning_text.const ReasoningTextReasoningText ReasoningText = "reasoning_text"
-
-
EncryptedContent stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
Status ResponseReasoningItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseReasoningItemStatusInProgress ResponseReasoningItemStatus = "in_progress" -
const ResponseReasoningItemStatusCompleted ResponseReasoningItemStatus = "completed" -
const ResponseReasoningItemStatusIncomplete ResponseReasoningItemStatus = "incomplete"
-
-
Response Reasoning Summary Part Added Event
-
type ResponseReasoningSummaryPartAddedEvent struct{…}Emitted when a new reasoning summary part is added.
-
ItemID stringThe ID of the item this summary part is associated with.
-
OutputIndex int64The index of the output item this summary part is associated with.
-
Part ResponseReasoningSummaryPartAddedEventPartThe summary part that was added.
-
Text stringThe text of the summary part.
-
Type SummaryTextThe type of the summary part. Always
summary_text.const SummaryTextSummaryText SummaryText = "summary_text"
-
-
SequenceNumber int64The sequence number of this event.
-
SummaryIndex int64The index of the summary part within the reasoning summary.
-
Type ResponseReasoningSummaryPartAddedThe type of the event. Always
response.reasoning_summary_part.added.const ResponseReasoningSummaryPartAddedResponseReasoningSummaryPartAdded ResponseReasoningSummaryPartAdded = "response.reasoning_summary_part.added"
-
Response Reasoning Summary Part Done Event
-
type ResponseReasoningSummaryPartDoneEvent struct{…}Emitted when a reasoning summary part is completed.
-
ItemID stringThe ID of the item this summary part is associated with.
-
OutputIndex int64The index of the output item this summary part is associated with.
-
Part ResponseReasoningSummaryPartDoneEventPartThe completed summary part.
-
Text stringThe text of the summary part.
-
Type SummaryTextThe type of the summary part. Always
summary_text.const SummaryTextSummaryText SummaryText = "summary_text"
-
-
SequenceNumber int64The sequence number of this event.
-
SummaryIndex int64The index of the summary part within the reasoning summary.
-
Type ResponseReasoningSummaryPartDoneThe type of the event. Always
response.reasoning_summary_part.done.const ResponseReasoningSummaryPartDoneResponseReasoningSummaryPartDone ResponseReasoningSummaryPartDone = "response.reasoning_summary_part.done"
-
Response Reasoning Summary Text Delta Event
-
type ResponseReasoningSummaryTextDeltaEvent struct{…}Emitted when a delta is added to a reasoning summary text.
-
Delta stringThe text delta that was added to the summary.
-
ItemID stringThe ID of the item this summary text delta is associated with.
-
OutputIndex int64The index of the output item this summary text delta is associated with.
-
SequenceNumber int64The sequence number of this event.
-
SummaryIndex int64The index of the summary part within the reasoning summary.
-
Type ResponseReasoningSummaryTextDeltaThe type of the event. Always
response.reasoning_summary_text.delta.const ResponseReasoningSummaryTextDeltaResponseReasoningSummaryTextDelta ResponseReasoningSummaryTextDelta = "response.reasoning_summary_text.delta"
-
Response Reasoning Summary Text Done Event
-
type ResponseReasoningSummaryTextDoneEvent struct{…}Emitted when a reasoning summary text is completed.
-
ItemID stringThe ID of the item this summary text is associated with.
-
OutputIndex int64The index of the output item this summary text is associated with.
-
SequenceNumber int64The sequence number of this event.
-
SummaryIndex int64The index of the summary part within the reasoning summary.
-
Text stringThe full text of the completed reasoning summary.
-
Type ResponseReasoningSummaryTextDoneThe type of the event. Always
response.reasoning_summary_text.done.const ResponseReasoningSummaryTextDoneResponseReasoningSummaryTextDone ResponseReasoningSummaryTextDone = "response.reasoning_summary_text.done"
-
Response Reasoning Text Delta Event
-
type ResponseReasoningTextDeltaEvent struct{…}Emitted when a delta is added to a reasoning text.
-
ContentIndex int64The index of the reasoning content part this delta is associated with.
-
Delta stringThe text delta that was added to the reasoning content.
-
ItemID stringThe ID of the item this reasoning text delta is associated with.
-
OutputIndex int64The index of the output item this reasoning text delta is associated with.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseReasoningTextDeltaThe type of the event. Always
response.reasoning_text.delta.const ResponseReasoningTextDeltaResponseReasoningTextDelta ResponseReasoningTextDelta = "response.reasoning_text.delta"
-
Response Reasoning Text Done Event
-
type ResponseReasoningTextDoneEvent struct{…}Emitted when a reasoning text is completed.
-
ContentIndex int64The index of the reasoning content part.
-
ItemID stringThe ID of the item this reasoning text is associated with.
-
OutputIndex int64The index of the output item this reasoning text is associated with.
-
SequenceNumber int64The sequence number of this event.
-
Text stringThe full text of the completed reasoning content.
-
Type ResponseReasoningTextDoneThe type of the event. Always
response.reasoning_text.done.const ResponseReasoningTextDoneResponseReasoningTextDone ResponseReasoningTextDone = "response.reasoning_text.done"
-
Response Refusal Delta Event
-
type ResponseRefusalDeltaEvent struct{…}Emitted when there is a partial refusal text.
-
ContentIndex int64The index of the content part that the refusal text is added to.
-
Delta stringThe refusal text that is added.
-
ItemID stringThe ID of the output item that the refusal text is added to.
-
OutputIndex int64The index of the output item that the refusal text is added to.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseRefusalDeltaThe type of the event. Always
response.refusal.delta.const ResponseRefusalDeltaResponseRefusalDelta ResponseRefusalDelta = "response.refusal.delta"
-
Response Refusal Done Event
-
type ResponseRefusalDoneEvent struct{…}Emitted when refusal text is finalized.
-
ContentIndex int64The index of the content part that the refusal text is finalized.
-
ItemID stringThe ID of the output item that the refusal text is finalized.
-
OutputIndex int64The index of the output item that the refusal text is finalized.
-
Refusal stringThe refusal text that is finalized.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseRefusalDoneThe type of the event. Always
response.refusal.done.const ResponseRefusalDoneResponseRefusalDone ResponseRefusalDone = "response.refusal.done"
-
Response Status
-
type ResponseStatus stringThe status of the response generation. One of
completed,failed,in_progress,cancelled,queued, orincomplete.-
const ResponseStatusCompleted ResponseStatus = "completed" -
const ResponseStatusFailed ResponseStatus = "failed" -
const ResponseStatusInProgress ResponseStatus = "in_progress" -
const ResponseStatusCancelled ResponseStatus = "cancelled" -
const ResponseStatusQueued ResponseStatus = "queued" -
const ResponseStatusIncomplete ResponseStatus = "incomplete"
-
Response Stream Event
-
type ResponseStreamEventUnion interface{…}Emitted when there is a partial audio response.
-
type ResponseAudioDeltaEvent struct{…}Emitted when there is a partial audio response.
-
Delta stringA chunk of Base64 encoded response audio bytes.
-
SequenceNumber int64A sequence number for this chunk of the stream response.
-
Type ResponseAudioDeltaThe type of the event. Always
response.audio.delta.const ResponseAudioDeltaResponseAudioDelta ResponseAudioDelta = "response.audio.delta"
-
-
type ResponseAudioDoneEvent struct{…}Emitted when the audio response is complete.
-
SequenceNumber int64The sequence number of the delta.
-
Type ResponseAudioDoneThe type of the event. Always
response.audio.done.const ResponseAudioDoneResponseAudioDone ResponseAudioDone = "response.audio.done"
-
-
type ResponseAudioTranscriptDeltaEvent struct{…}Emitted when there is a partial transcript of audio.
-
Delta stringThe partial transcript of the audio response.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseAudioTranscriptDeltaThe type of the event. Always
response.audio.transcript.delta.const ResponseAudioTranscriptDeltaResponseAudioTranscriptDelta ResponseAudioTranscriptDelta = "response.audio.transcript.delta"
-
-
type ResponseAudioTranscriptDoneEvent struct{…}Emitted when the full audio transcript is completed.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseAudioTranscriptDoneThe type of the event. Always
response.audio.transcript.done.const ResponseAudioTranscriptDoneResponseAudioTranscriptDone ResponseAudioTranscriptDone = "response.audio.transcript.done"
-
-
type ResponseCodeInterpreterCallCodeDeltaEvent struct{…}Emitted when a partial code snippet is streamed by the code interpreter.
-
Delta stringThe partial code snippet being streamed by the code interpreter.
-
ItemID stringThe unique identifier of the code interpreter tool call item.
-
OutputIndex int64The index of the output item in the response for which the code is being streamed.
-
SequenceNumber int64The sequence number of this event, used to order streaming events.
-
Type ResponseCodeInterpreterCallCodeDeltaThe type of the event. Always
response.code_interpreter_call_code.delta.const ResponseCodeInterpreterCallCodeDeltaResponseCodeInterpreterCallCodeDelta ResponseCodeInterpreterCallCodeDelta = "response.code_interpreter_call_code.delta"
-
-
type ResponseCodeInterpreterCallCodeDoneEvent struct{…}Emitted when the code snippet is finalized by the code interpreter.
-
Code stringThe final code snippet output by the code interpreter.
-
ItemID stringThe unique identifier of the code interpreter tool call item.
-
OutputIndex int64The index of the output item in the response for which the code is finalized.
-
SequenceNumber int64The sequence number of this event, used to order streaming events.
-
Type ResponseCodeInterpreterCallCodeDoneThe type of the event. Always
response.code_interpreter_call_code.done.const ResponseCodeInterpreterCallCodeDoneResponseCodeInterpreterCallCodeDone ResponseCodeInterpreterCallCodeDone = "response.code_interpreter_call_code.done"
-
-
type ResponseCodeInterpreterCallCompletedEvent struct{…}Emitted when the code interpreter call is completed.
-
ItemID stringThe unique identifier of the code interpreter tool call item.
-
OutputIndex int64The index of the output item in the response for which the code interpreter call is completed.
-
SequenceNumber int64The sequence number of this event, used to order streaming events.
-
Type ResponseCodeInterpreterCallCompletedThe type of the event. Always
response.code_interpreter_call.completed.const ResponseCodeInterpreterCallCompletedResponseCodeInterpreterCallCompleted ResponseCodeInterpreterCallCompleted = "response.code_interpreter_call.completed"
-
-
type ResponseCodeInterpreterCallInProgressEvent struct{…}Emitted when a code interpreter call is in progress.
-
ItemID stringThe unique identifier of the code interpreter tool call item.
-
OutputIndex int64The index of the output item in the response for which the code interpreter call is in progress.
-
SequenceNumber int64The sequence number of this event, used to order streaming events.
-
Type ResponseCodeInterpreterCallInProgressThe type of the event. Always
response.code_interpreter_call.in_progress.const ResponseCodeInterpreterCallInProgressResponseCodeInterpreterCallInProgress ResponseCodeInterpreterCallInProgress = "response.code_interpreter_call.in_progress"
-
-
type ResponseCodeInterpreterCallInterpretingEvent struct{…}Emitted when the code interpreter is actively interpreting the code snippet.
-
ItemID stringThe unique identifier of the code interpreter tool call item.
-
OutputIndex int64The index of the output item in the response for which the code interpreter is interpreting code.
-
SequenceNumber int64The sequence number of this event, used to order streaming events.
-
Type ResponseCodeInterpreterCallInterpretingThe type of the event. Always
response.code_interpreter_call.interpreting.const ResponseCodeInterpreterCallInterpretingResponseCodeInterpreterCallInterpreting ResponseCodeInterpreterCallInterpreting = "response.code_interpreter_call.interpreting"
-
-
type ResponseCompletedEvent struct{…}Emitted when the model response is complete.
-
Response ResponseProperties of the completed response.
-
ID stringUnique identifier for this Response.
-
CreatedAt float64Unix timestamp (in seconds) of when this Response was created.
-
Error ResponseErrorAn error object returned when the model fails to generate a Response.
-
Code ResponseErrorCodeThe error code for the response.
-
const ResponseErrorCodeServerError ResponseErrorCode = "server_error" -
const ResponseErrorCodeRateLimitExceeded ResponseErrorCode = "rate_limit_exceeded" -
const ResponseErrorCodeInvalidPrompt ResponseErrorCode = "invalid_prompt" -
const ResponseErrorCodeVectorStoreTimeout ResponseErrorCode = "vector_store_timeout" -
const ResponseErrorCodeInvalidImage ResponseErrorCode = "invalid_image" -
const ResponseErrorCodeInvalidImageFormat ResponseErrorCode = "invalid_image_format" -
const ResponseErrorCodeInvalidBase64Image ResponseErrorCode = "invalid_base64_image" -
const ResponseErrorCodeInvalidImageURL ResponseErrorCode = "invalid_image_url" -
const ResponseErrorCodeImageTooLarge ResponseErrorCode = "image_too_large" -
const ResponseErrorCodeImageTooSmall ResponseErrorCode = "image_too_small" -
const ResponseErrorCodeImageParseError ResponseErrorCode = "image_parse_error" -
const ResponseErrorCodeImageContentPolicyViolation ResponseErrorCode = "image_content_policy_violation" -
const ResponseErrorCodeInvalidImageMode ResponseErrorCode = "invalid_image_mode" -
const ResponseErrorCodeImageFileTooLarge ResponseErrorCode = "image_file_too_large" -
const ResponseErrorCodeUnsupportedImageMediaType ResponseErrorCode = "unsupported_image_media_type" -
const ResponseErrorCodeEmptyImageFile ResponseErrorCode = "empty_image_file" -
const ResponseErrorCodeFailedToDownloadImage ResponseErrorCode = "failed_to_download_image" -
const ResponseErrorCodeImageFileNotFound ResponseErrorCode = "image_file_not_found"
-
-
Message stringA human-readable description of the error.
-
-
IncompleteDetails ResponseIncompleteDetailsDetails about why the response is incomplete.
-
Reason stringThe reason why the response is incomplete.
-
const ResponseIncompleteDetailsReasonMaxOutputTokens ResponseIncompleteDetailsReason = "max_output_tokens" -
const ResponseIncompleteDetailsReasonContentFilter ResponseIncompleteDetailsReason = "content_filter"
-
-
-
Instructions ResponseInstructionsUnionA system (or developer) message inserted into the model's context.
When using along with
previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses.-
string -
type ResponseInstructionsInputItemList []ResponseInputItemUnionA list of one or many input items to the model, containing different content types.
-
type EasyInputMessage struct{…}A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.-
Content EasyInputMessageContentUnionText, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
-
string -
type ResponseInputMessageContentList []ResponseInputContentUnionA list of one or many input items to the model, containing different content types.
-
type ResponseInputText struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
Detail ResponseInputImageDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageDetailLow ResponseInputImageDetail = "low" -
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high" -
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto" -
const ResponseInputImageDetailOriginal ResponseInputImageDetail = "original"
-
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFile struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileDetailLow ResponseInputFileDetail = "low" -
const ResponseInputFileDetailHigh ResponseInputFileDetail = "high"
-
-
FileData stringThe content of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Role EasyInputMessageRoleThe role of the message input. One of
user,assistant,system, ordeveloper.-
const EasyInputMessageRoleUser EasyInputMessageRole = "user" -
const EasyInputMessageRoleAssistant EasyInputMessageRole = "assistant" -
const EasyInputMessageRoleSystem EasyInputMessageRole = "system" -
const EasyInputMessageRoleDeveloper EasyInputMessageRole = "developer"
-
-
Phase EasyInputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const EasyInputMessagePhaseCommentary EasyInputMessagePhase = "commentary" -
const EasyInputMessagePhaseFinalAnswer EasyInputMessagePhase = "final_answer"
-
-
Type EasyInputMessageTypeThe type of the message input. Always
message.const EasyInputMessageTypeMessage EasyInputMessageType = "message"
-
-
type ResponseInputItemMessage struct{…}A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole.-
Content ResponseInputMessageContentListA list of one or many input items to the model, containing different content types.
-
Role stringThe role of the message input. One of
user,system, ordeveloper.-
const ResponseInputItemMessageRoleUser ResponseInputItemMessageRole = "user" -
const ResponseInputItemMessageRoleSystem ResponseInputItemMessageRole = "system" -
const ResponseInputItemMessageRoleDeveloper ResponseInputItemMessageRole = "developer"
-
-
Status stringThe status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputItemMessageStatusInProgress ResponseInputItemMessageStatus = "in_progress" -
const ResponseInputItemMessageStatusCompleted ResponseInputItemMessageStatus = "completed" -
const ResponseInputItemMessageStatusIncomplete ResponseInputItemMessageStatus = "incomplete"
-
-
Type stringThe type of the message input. Always set to
message.const ResponseInputItemMessageTypeMessage ResponseInputItemMessageType = "message"
-
-
type ResponseOutputMessage struct{…}An output message from the model.
-
ID stringThe unique ID of the output message.
-
Content []ResponseOutputMessageContentUnionThe content of the output message.
-
type ResponseOutputText struct{…}A text output from the model.
-
Annotations []ResponseOutputTextAnnotationUnionThe annotations of the text output.
-
type ResponseOutputTextAnnotationFileCitation struct{…}A citation to a file.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the file cited.
-
Index int64The index of the file in the list of files.
-
Type FileCitationThe type of the file citation. Always
file_citation.const FileCitationFileCitation FileCitation = "file_citation"
-
-
type ResponseOutputTextAnnotationURLCitation struct{…}A citation for a web resource used to generate a model response.
-
EndIndex int64The index of the last character of the URL citation in the message.
-
StartIndex int64The index of the first character of the URL citation in the message.
-
Title stringThe title of the web resource.
-
Type URLCitationThe type of the URL citation. Always
url_citation.const URLCitationURLCitation URLCitation = "url_citation"
-
URL stringThe URL of the web resource.
-
-
type ResponseOutputTextAnnotationContainerFileCitation struct{…}A citation for a container file used to generate a model response.
-
ContainerID stringThe ID of the container file.
-
EndIndex int64The index of the last character of the container file citation in the message.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the container file cited.
-
StartIndex int64The index of the first character of the container file citation in the message.
-
Type ContainerFileCitationThe type of the container file citation. Always
container_file_citation.const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"
-
-
type ResponseOutputTextAnnotationFilePath struct{…}A path to a file.
-
FileID stringThe ID of the file.
-
Index int64The index of the file in the list of files.
-
Type FilePathThe type of the file path. Always
file_path.const FilePathFilePath FilePath = "file_path"
-
-
-
Text stringThe text output from the model.
-
Type OutputTextThe type of the output text. Always
output_text.const OutputTextOutputText OutputText = "output_text"
-
Logprobs []ResponseOutputTextLogprob-
Token string -
Bytes []int64 -
Logprob float64 -
TopLogprobs []ResponseOutputTextLogprobTopLogprob-
Token string -
Bytes []int64 -
Logprob float64
-
-
-
-
type ResponseOutputRefusal struct{…}A refusal from the model.
-
Refusal stringThe refusal explanation from the model.
-
Type RefusalThe type of the refusal. Always
refusal.const RefusalRefusal Refusal = "refusal"
-
-
-
Role AssistantThe role of the output message. Always
assistant.const AssistantAssistant Assistant = "assistant"
-
Status ResponseOutputMessageStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseOutputMessageStatusInProgress ResponseOutputMessageStatus = "in_progress" -
const ResponseOutputMessageStatusCompleted ResponseOutputMessageStatus = "completed" -
const ResponseOutputMessageStatusIncomplete ResponseOutputMessageStatus = "incomplete"
-
-
Type MessageThe type of the output message. Always
message.const MessageMessage Message = "message"
-
Phase ResponseOutputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const ResponseOutputMessagePhaseCommentary ResponseOutputMessagePhase = "commentary" -
const ResponseOutputMessagePhaseFinalAnswer ResponseOutputMessagePhase = "final_answer"
-
-
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
ID stringThe unique ID of the file search tool call.
-
Queries []stringThe queries used to search for files.
-
Status ResponseFileSearchToolCallStatusThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
const ResponseFileSearchToolCallStatusInProgress ResponseFileSearchToolCallStatus = "in_progress" -
const ResponseFileSearchToolCallStatusSearching ResponseFileSearchToolCallStatus = "searching" -
const ResponseFileSearchToolCallStatusCompleted ResponseFileSearchToolCallStatus = "completed" -
const ResponseFileSearchToolCallStatusIncomplete ResponseFileSearchToolCallStatus = "incomplete" -
const ResponseFileSearchToolCallStatusFailed ResponseFileSearchToolCallStatus = "failed"
-
-
Type FileSearchCallThe type of the file search tool call. Always
file_search_call.const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"
-
Results []ResponseFileSearchToolCallResultThe results of the file search tool call.
-
Attributes map[string, ResponseFileSearchToolCallResultAttributeUnion]Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.
-
string -
float64 -
bool
-
-
FileID stringThe unique ID of the file.
-
Filename stringThe name of the file.
-
Score float64The relevance score of the file - a value between 0 and 1.
-
Text stringThe text that was retrieved from the file.
-
-
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
ID stringThe unique ID of the computer call.
-
CallID stringAn identifier used when responding to the tool call with output.
-
PendingSafetyChecks []ResponseComputerToolCallPendingSafetyCheckThe pending safety checks for the computer call.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status ResponseComputerToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseComputerToolCallStatusInProgress ResponseComputerToolCallStatus = "in_progress" -
const ResponseComputerToolCallStatusCompleted ResponseComputerToolCallStatus = "completed" -
const ResponseComputerToolCallStatusIncomplete ResponseComputerToolCallStatus = "incomplete"
-
-
Type ResponseComputerToolCallTypeThe type of the computer call. Always
computer_call.const ResponseComputerToolCallTypeComputerCall ResponseComputerToolCallType = "computer_call"
-
Action ResponseComputerToolCallActionUnionA click action.
-
type ResponseComputerToolCallActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ResponseComputerToolCallActionClickButtonLeft ResponseComputerToolCallActionClickButton = "left" -
const ResponseComputerToolCallActionClickButtonRight ResponseComputerToolCallActionClickButton = "right" -
const ResponseComputerToolCallActionClickButtonWheel ResponseComputerToolCallActionClickButton = "wheel" -
const ResponseComputerToolCallActionClickButtonBack ResponseComputerToolCallActionClickButton = "back" -
const ResponseComputerToolCallActionClickButtonForward ResponseComputerToolCallActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ResponseComputerToolCallActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ResponseComputerToolCallActionDrag struct{…}A drag action.
-
Path []ResponseComputerToolCallActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ResponseComputerToolCallActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ResponseComputerToolCallActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ResponseComputerToolCallActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ResponseComputerToolCallActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ResponseComputerToolCallActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ResponseComputerToolCallActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
Actions ComputerActionListFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
type ComputerActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ComputerActionClickButtonLeft ComputerActionClickButton = "left" -
const ComputerActionClickButtonRight ComputerActionClickButton = "right" -
const ComputerActionClickButtonWheel ComputerActionClickButton = "wheel" -
const ComputerActionClickButtonBack ComputerActionClickButton = "back" -
const ComputerActionClickButtonForward ComputerActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ComputerActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ComputerActionDrag struct{…}A drag action.
-
Path []ComputerActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ComputerActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ComputerActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ComputerActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ComputerActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ComputerActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ComputerActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
-
type ResponseInputItemComputerCallOutput struct{…}The output of a computer tool call.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Type ComputerScreenshotSpecifies the event type. For a computer screenshot, this property is always set to
computer_screenshot.const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"
-
FileID stringThe identifier of an uploaded file that contains the screenshot.
-
ImageURL stringThe URL of the screenshot image.
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
ID stringThe ID of the computer tool call output.
-
AcknowledgedSafetyChecks []ResponseInputItemComputerCallOutputAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status stringThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseInputItemComputerCallOutputStatusInProgress ResponseInputItemComputerCallOutputStatus = "in_progress" -
const ResponseInputItemComputerCallOutputStatusCompleted ResponseInputItemComputerCallOutputStatus = "completed" -
const ResponseInputItemComputerCallOutputStatusIncomplete ResponseInputItemComputerCallOutputStatus = "incomplete"
-
-
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
ID stringThe unique ID of the web search tool call.
-
Action ResponseFunctionWebSearchActionUnionAn object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
type ResponseFunctionWebSearchActionSearch struct{…}Action type "search" - Performs a web search query.
-
Type SearchThe action type.
const SearchSearch Search = "search"
-
Queries []stringThe search queries.
-
Query stringThe search query.
-
Sources []ResponseFunctionWebSearchActionSearchSourceThe sources used in the search.
-
Type URLThe type of source. Always
url.const URLURL URL = "url"
-
URL stringThe URL of the source.
-
-
-
type ResponseFunctionWebSearchActionOpenPage struct{…}Action type "open_page" - Opens a specific URL from search results.
-
Type OpenPageThe action type.
const OpenPageOpenPage OpenPage = "open_page"
-
URL stringThe URL opened by the model.
-
-
type ResponseFunctionWebSearchActionFindInPage struct{…}Action type "find_in_page": Searches for a pattern within a loaded page.
-
Pattern stringThe pattern or text to search for within the page.
-
Type FindInPageThe action type.
const FindInPageFindInPage FindInPage = "find_in_page"
-
URL stringThe URL of the page searched for the pattern.
-
-
-
Status ResponseFunctionWebSearchStatusThe status of the web search tool call.
-
const ResponseFunctionWebSearchStatusInProgress ResponseFunctionWebSearchStatus = "in_progress" -
const ResponseFunctionWebSearchStatusSearching ResponseFunctionWebSearchStatus = "searching" -
const ResponseFunctionWebSearchStatusCompleted ResponseFunctionWebSearchStatus = "completed" -
const ResponseFunctionWebSearchStatusFailed ResponseFunctionWebSearchStatus = "failed"
-
-
Type WebSearchCallThe type of the web search tool call. Always
web_search_call.const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"
-
-
type ResponseFunctionToolCall struct{…}A tool call to run a function. See the function calling guide for more information.
-
Arguments stringA JSON string of the arguments to pass to the function.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Name stringThe name of the function to run.
-
Type FunctionCallThe type of the function tool call. Always
function_call.const FunctionCallFunctionCall FunctionCall = "function_call"
-
ID stringThe unique ID of the function tool call.
-
Namespace stringThe namespace of the function to run.
-
Status ResponseFunctionToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallStatusInProgress ResponseFunctionToolCallStatus = "in_progress" -
const ResponseFunctionToolCallStatusCompleted ResponseFunctionToolCallStatus = "completed" -
const ResponseFunctionToolCallStatusIncomplete ResponseFunctionToolCallStatus = "incomplete"
-
-
-
type ResponseInputItemFunctionCallOutput struct{…}The output of a function tool call.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseInputItemFunctionCallOutputOutputUnionText, image, or file output of the function tool call.
-
string -
type ResponseFunctionCallOutputItemList []ResponseFunctionCallOutputItemUnionAn array of content outputs (text, image, file) for the function tool call.
-
type ResponseInputTextContent struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImageContent struct{…}An image input to the model. Learn about image inputs
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
Detail ResponseInputImageContentDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageContentDetailLow ResponseInputImageContentDetail = "low" -
const ResponseInputImageContentDetailHigh ResponseInputImageContentDetail = "high" -
const ResponseInputImageContentDetailAuto ResponseInputImageContentDetail = "auto" -
const ResponseInputImageContentDetailOriginal ResponseInputImageContentDetail = "original"
-
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFileContent struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileContentDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileContentDetailLow ResponseInputFileContentDetail = "low" -
const ResponseInputFileContentDetailHigh ResponseInputFileContentDetail = "high"
-
-
FileData stringThe base64-encoded data of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
ID stringThe unique ID of the function tool call output. Populated when this item is returned via API.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputItemFunctionCallOutputStatusInProgress ResponseInputItemFunctionCallOutputStatus = "in_progress" -
const ResponseInputItemFunctionCallOutputStatusCompleted ResponseInputItemFunctionCallOutputStatus = "completed" -
const ResponseInputItemFunctionCallOutputStatusIncomplete ResponseInputItemFunctionCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemToolSearchCall struct{…}-
Arguments anyThe arguments supplied to the tool search call.
-
Type ToolSearchCallThe item type. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
ID stringThe unique ID of this tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution stringWhether tool search was executed by the server or by the client.
-
const ResponseInputItemToolSearchCallExecutionServer ResponseInputItemToolSearchCallExecution = "server" -
const ResponseInputItemToolSearchCallExecutionClient ResponseInputItemToolSearchCallExecution = "client"
-
-
Status stringThe status of the tool search call.
-
const ResponseInputItemToolSearchCallStatusInProgress ResponseInputItemToolSearchCallStatus = "in_progress" -
const ResponseInputItemToolSearchCallStatusCompleted ResponseInputItemToolSearchCallStatus = "completed" -
const ResponseInputItemToolSearchCallStatusIncomplete ResponseInputItemToolSearchCallStatus = "incomplete"
-
-
-
type ResponseToolSearchOutputItemParamResp struct{…}-
Tools []ToolUnionThe loaded tool definitions returned by the tool search output.
-
type FunctionTool struct{…}Defines a function in your own code the model can choose to call. Learn more about function calling.
-
Name stringThe name of the function to call.
-
Parameters map[string, any]A JSON schema object describing the parameters of the function.
-
Strict boolWhether to enforce strict parameter validation. Default
true. -
Type FunctionThe type of the function tool. Always
function.const FunctionFunction Function = "function"
-
DeferLoading boolWhether this function is deferred and loaded via tool search.
-
Description stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
type FileSearchTool struct{…}A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
Type FileSearchThe type of the file search tool. Always
file_search.const FileSearchFileSearch FileSearch = "file_search"
-
VectorStoreIDs []stringThe IDs of the vector stores to search.
-
Filters FileSearchToolFiltersUnionA filter to apply.
-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
Key stringThe key to compare against the value.
-
Type ComparisonFilterTypeSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
const ComparisonFilterTypeEq ComparisonFilterType = "eq" -
const ComparisonFilterTypeNe ComparisonFilterType = "ne" -
const ComparisonFilterTypeGt ComparisonFilterType = "gt" -
const ComparisonFilterTypeGte ComparisonFilterType = "gte" -
const ComparisonFilterTypeLt ComparisonFilterType = "lt" -
const ComparisonFilterTypeLte ComparisonFilterType = "lte" -
const ComparisonFilterTypeIn ComparisonFilterType = "in" -
const ComparisonFilterTypeNin ComparisonFilterType = "nin"
-
-
Value ComparisonFilterValueUnionThe value to compare against the attribute key; supports string, number, or boolean types.
-
string -
float64 -
bool -
type ComparisonFilterValueArray []ComparisonFilterValueArrayItemUnion-
string -
float64
-
-
-
-
type CompoundFilter struct{…}Combine multiple filters using
andoror.-
Filters []ComparisonFilterArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
-
Type CompoundFilterTypeType of operation:
andoror.-
const CompoundFilterTypeAnd CompoundFilterType = "and" -
const CompoundFilterTypeOr CompoundFilterType = "or"
-
-
-
-
MaxNumResults int64The maximum number of results to return. This number should be between 1 and 50 inclusive.
-
RankingOptions FileSearchToolRankingOptionsRanking options for search.
-
HybridSearch FileSearchToolRankingOptionsHybridSearchWeights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
EmbeddingWeight float64The weight of the embedding in the reciprocal ranking fusion.
-
TextWeight float64The weight of the text in the reciprocal ranking fusion.
-
-
Ranker stringThe ranker to use for the file search.
-
const FileSearchToolRankingOptionsRankerAuto FileSearchToolRankingOptionsRanker = "auto" -
const FileSearchToolRankingOptionsRankerDefault2024_11_15 FileSearchToolRankingOptionsRanker = "default-2024-11-15"
-
-
ScoreThreshold float64The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
Type ComputerThe type of the computer tool. Always
computer.const ComputerComputer Computer = "computer"
-
-
type ComputerUsePreviewTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
DisplayHeight int64The height of the computer display.
-
DisplayWidth int64The width of the computer display.
-
Environment ComputerUsePreviewToolEnvironmentThe type of computer environment to control.
-
const ComputerUsePreviewToolEnvironmentWindows ComputerUsePreviewToolEnvironment = "windows" -
const ComputerUsePreviewToolEnvironmentMac ComputerUsePreviewToolEnvironment = "mac" -
const ComputerUsePreviewToolEnvironmentLinux ComputerUsePreviewToolEnvironment = "linux" -
const ComputerUsePreviewToolEnvironmentUbuntu ComputerUsePreviewToolEnvironment = "ubuntu" -
const ComputerUsePreviewToolEnvironmentBrowser ComputerUsePreviewToolEnvironment = "browser"
-
-
Type ComputerUsePreviewThe type of the computer use tool. Always
computer_use_preview.const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"
-
-
type WebSearchTool struct{…}Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
Type WebSearchToolTypeThe type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
const WebSearchToolTypeWebSearch WebSearchToolType = "web_search" -
const WebSearchToolTypeWebSearch2025_08_26 WebSearchToolType = "web_search_2025_08_26"
-
-
Filters WebSearchToolFiltersFilters for the search.
-
AllowedDomains []stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
SearchContextSize WebSearchToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchToolSearchContextSizeLow WebSearchToolSearchContextSize = "low" -
const WebSearchToolSearchContextSizeMedium WebSearchToolSearchContextSize = "medium" -
const WebSearchToolSearchContextSizeHigh WebSearchToolSearchContextSize = "high"
-
-
UserLocation WebSearchToolUserLocationThe approximate location of the user.
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
Type stringThe type of location approximation. Always
approximate.const WebSearchToolUserLocationTypeApproximate WebSearchToolUserLocationType = "approximate"
-
-
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
ServerLabel stringA label for this MCP server, used to identify it in tool calls.
-
Type McpThe type of the MCP tool. Always
mcp.const McpMcp Mcp = "mcp"
-
AllowedTools ToolMcpAllowedToolsUnionList of allowed tool names or a filter object.
-
type ToolMcpAllowedToolsMcpAllowedTools []stringA string array of allowed tool names
-
type ToolMcpAllowedToolsMcpToolFilter struct{…}A filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
Authorization stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
ConnectorID stringIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
const ToolMcpConnectorIDConnectorDropbox ToolMcpConnectorID = "connector_dropbox" -
const ToolMcpConnectorIDConnectorGmail ToolMcpConnectorID = "connector_gmail" -
const ToolMcpConnectorIDConnectorGooglecalendar ToolMcpConnectorID = "connector_googlecalendar" -
const ToolMcpConnectorIDConnectorGoogledrive ToolMcpConnectorID = "connector_googledrive" -
const ToolMcpConnectorIDConnectorMicrosoftteams ToolMcpConnectorID = "connector_microsoftteams" -
const ToolMcpConnectorIDConnectorOutlookcalendar ToolMcpConnectorID = "connector_outlookcalendar" -
const ToolMcpConnectorIDConnectorOutlookemail ToolMcpConnectorID = "connector_outlookemail" -
const ToolMcpConnectorIDConnectorSharepoint ToolMcpConnectorID = "connector_sharepoint"
-
-
DeferLoading boolWhether this MCP tool is deferred and discovered via tool search.
-
Headers map[string, string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
RequireApproval ToolMcpRequireApprovalUnionSpecify which of the MCP server's tools require approval.
-
type ToolMcpRequireApprovalMcpToolApprovalFilter 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.-
Always ToolMcpRequireApprovalMcpToolApprovalFilterAlwaysA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
Never ToolMcpRequireApprovalMcpToolApprovalFilterNeverA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
type ToolMcpRequireApprovalMcpToolApprovalSetting stringSpecify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
const ToolMcpRequireApprovalMcpToolApprovalSettingAlways ToolMcpRequireApprovalMcpToolApprovalSetting = "always" -
const ToolMcpRequireApprovalMcpToolApprovalSettingNever ToolMcpRequireApprovalMcpToolApprovalSetting = "never"
-
-
-
ServerDescription stringOptional description of the MCP server, used to provide more context.
-
ServerURL stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
TunnelID stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
Container ToolCodeInterpreterContainerUnionThe code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
string -
type ToolCodeInterpreterContainerCodeInterpreterContainerAuto struct{…}Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
Type AutoAlways
auto.const AutoAuto Auto = "auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit stringThe memory limit for the code interpreter container.
-
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"
-
-
NetworkPolicy ToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…}-
Type DisabledDisable outbound network access. Always
disabled.const DisabledDisabled Disabled = "disabled"
-
-
type ContainerNetworkPolicyAllowlist struct{…}-
AllowedDomains []stringA list of allowed domains when type is
allowlist. -
Type AllowlistAllow outbound network access only to specified domains. Always
allowlist.const AllowlistAllowlist Allowlist = "allowlist"
-
DomainSecrets []ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
Domain stringThe domain associated with the secret.
-
Name stringThe name of the secret to inject for the domain.
-
Value stringThe secret value to inject for the domain.
-
-
-
-
-
-
Type CodeInterpreterThe type of the code interpreter tool. Always
code_interpreter.const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"
-
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
Type ImageGenerationThe type of the image generation tool. Always
image_generation.const ImageGenerationImageGeneration ImageGeneration = "image_generation"
-
Action stringWhether to generate a new image or edit an existing image. Default:
auto.-
const ToolImageGenerationActionGenerate ToolImageGenerationAction = "generate" -
const ToolImageGenerationActionEdit ToolImageGenerationAction = "edit" -
const ToolImageGenerationActionAuto ToolImageGenerationAction = "auto"
-
-
Background stringAllows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
const ToolImageGenerationBackgroundTransparent ToolImageGenerationBackground = "transparent" -
const ToolImageGenerationBackgroundOpaque ToolImageGenerationBackground = "opaque" -
const ToolImageGenerationBackgroundAuto ToolImageGenerationBackground = "auto"
-
-
InputFidelity stringControl how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
const ToolImageGenerationInputFidelityHigh ToolImageGenerationInputFidelity = "high" -
const ToolImageGenerationInputFidelityLow ToolImageGenerationInputFidelity = "low"
-
-
InputImageMask ToolImageGenerationInputImageMaskOptional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
FileID stringFile ID for the mask image.
-
ImageURL stringBase64-encoded mask image.
-
-
Model stringThe image generation model to use. Default:
gpt-image-1.-
string -
string-
const ToolImageGenerationModelGPTImage1 ToolImageGenerationModel = "gpt-image-1" -
const ToolImageGenerationModelGPTImage1Mini ToolImageGenerationModel = "gpt-image-1-mini" -
const ToolImageGenerationModelGPTImage2 ToolImageGenerationModel = "gpt-image-2" -
const ToolImageGenerationModelGPTImage2_2026_04_21 ToolImageGenerationModel = "gpt-image-2-2026-04-21" -
const ToolImageGenerationModelGPTImage1_5 ToolImageGenerationModel = "gpt-image-1.5" -
const ToolImageGenerationModelChatgptImageLatest ToolImageGenerationModel = "chatgpt-image-latest"
-
-
-
Moderation stringModeration level for the generated image. Default:
auto.-
const ToolImageGenerationModerationAuto ToolImageGenerationModeration = "auto" -
const ToolImageGenerationModerationLow ToolImageGenerationModeration = "low"
-
-
OutputCompression int64Compression level for the output image. Default: 100.
-
OutputFormat stringThe output format of the generated image. One of
png,webp, orjpeg. Default:png.-
const ToolImageGenerationOutputFormatPNG ToolImageGenerationOutputFormat = "png" -
const ToolImageGenerationOutputFormatWebP ToolImageGenerationOutputFormat = "webp" -
const ToolImageGenerationOutputFormatJPEG ToolImageGenerationOutputFormat = "jpeg"
-
-
PartialImages int64Number of partial images to generate in streaming mode, from 0 (default value) to 3.
-
Quality stringThe quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
const ToolImageGenerationQualityLow ToolImageGenerationQuality = "low" -
const ToolImageGenerationQualityMedium ToolImageGenerationQuality = "medium" -
const ToolImageGenerationQualityHigh ToolImageGenerationQuality = "high" -
const ToolImageGenerationQualityAuto ToolImageGenerationQuality = "auto"
-
-
Size stringThe size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
string -
string-
const ToolImageGenerationSize1024x1024 ToolImageGenerationSize = "1024x1024" -
const ToolImageGenerationSize1024x1536 ToolImageGenerationSize = "1024x1536" -
const ToolImageGenerationSize1536x1024 ToolImageGenerationSize = "1536x1024" -
const ToolImageGenerationSizeAuto ToolImageGenerationSize = "auto"
-
-
-
-
type ToolLocalShell struct{…}A tool that allows the model to execute shell commands in a local environment.
-
Type LocalShellThe type of the local shell tool. Always
local_shell.const LocalShellLocalShell LocalShell = "local_shell"
-
-
type FunctionShellTool struct{…}A tool that allows the model to execute shell commands.
-
Type ShellThe type of the shell tool. Always
shell.const ShellShell Shell = "shell"
-
Environment FunctionShellToolEnvironmentUnion-
type ContainerAuto struct{…}-
Type ContainerAutoAutomatically creates a container for this request
const ContainerAutoContainerAuto ContainerAuto = "container_auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit ContainerAutoMemoryLimitThe memory limit for the container.
-
const ContainerAutoMemoryLimit1g ContainerAutoMemoryLimit = "1g" -
const ContainerAutoMemoryLimit4g ContainerAutoMemoryLimit = "4g" -
const ContainerAutoMemoryLimit16g ContainerAutoMemoryLimit = "16g" -
const ContainerAutoMemoryLimit64g ContainerAutoMemoryLimit = "64g"
-
-
NetworkPolicy ContainerAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…} -
type ContainerNetworkPolicyAllowlist struct{…}
-
-
Skills []ContainerAutoSkillUnionAn optional list of skills referenced by id or inline data.
-
type SkillReference struct{…}-
SkillID stringThe ID of the referenced skill.
-
Type SkillReferenceReferences a skill created with the /v1/skills endpoint.
const SkillReferenceSkillReference SkillReference = "skill_reference"
-
Version stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
type InlineSkill struct{…}-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Source InlineSkillSourceInline skill payload
-
Data stringBase64-encoded skill zip bundle.
-
MediaType ApplicationZipThe media type of the inline skill payload. Must be
application/zip.const ApplicationZipApplicationZip ApplicationZip = "application/zip"
-
Type Base64The type of the inline skill source. Must be
base64.const Base64Base64 Base64 = "base64"
-
-
Type InlineDefines an inline skill for this request.
const InlineInline Inline = "inline"
-
-
-
-
type LocalEnvironment struct{…}-
Type LocalUse a local computer environment.
const LocalLocal Local = "local"
-
Skills []LocalSkillAn optional list of skills.
-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Path stringThe path to the directory containing the skill.
-
-
-
type ContainerReference struct{…}-
ContainerID stringThe ID of the referenced container.
-
Type ContainerReferenceReferences a container created with the /v1/containers endpoint
const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
Name stringThe name of the custom tool, used to identify it in tool calls.
-
Type CustomThe type of the custom tool. Always
custom.const CustomCustom Custom = "custom"
-
DeferLoading boolWhether this tool should be deferred and discovered via tool search.
-
Description stringOptional description of the custom tool, used to provide more context.
-
Format CustomToolInputFormatUnionThe input format for the custom tool. Default is unconstrained text.
-
type CustomToolInputFormatText struct{…}Unconstrained free-form text.
-
Type TextUnconstrained text format. Always
text.const TextText Text = "text"
-
-
type CustomToolInputFormatGrammar struct{…}A grammar defined by the user.
-
Definition stringThe grammar definition.
-
Syntax stringThe syntax of the grammar definition. One of
larkorregex.-
const CustomToolInputFormatGrammarSyntaxLark CustomToolInputFormatGrammarSyntax = "lark" -
const CustomToolInputFormatGrammarSyntaxRegex CustomToolInputFormatGrammarSyntax = "regex"
-
-
Type GrammarGrammar format. Always
grammar.const GrammarGrammar Grammar = "grammar"
-
-
-
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
Description stringA description of the namespace shown to the model.
-
Name stringThe namespace name used in tool calls (for example,
crm). -
Tools []NamespaceToolToolUnionThe function/custom tools available inside this namespace.
-
type NamespaceToolToolFunction struct{…}-
Name string -
Type Functionconst FunctionFunction Function = "function"
-
DeferLoading boolWhether this function should be deferred and discovered via tool search.
-
Description string -
Parameters any -
Strict bool
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
-
Type NamespaceThe type of the tool. Always
namespace.const NamespaceNamespace Namespace = "namespace"
-
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
Type ToolSearchThe type of the tool. Always
tool_search.const ToolSearchToolSearch ToolSearch = "tool_search"
-
Description stringDescription shown to the model for a client-executed tool search tool.
-
Execution ToolSearchToolExecutionWhether tool search is executed by the server or by the client.
-
const ToolSearchToolExecutionServer ToolSearchToolExecution = "server" -
const ToolSearchToolExecutionClient ToolSearchToolExecution = "client"
-
-
Parameters anyParameter schema for a client-executed tool search tool.
-
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
Type WebSearchPreviewToolTypeThe type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
const WebSearchPreviewToolTypeWebSearchPreview WebSearchPreviewToolType = "web_search_preview" -
const WebSearchPreviewToolTypeWebSearchPreview2025_03_11 WebSearchPreviewToolType = "web_search_preview_2025_03_11"
-
-
SearchContentTypes []string-
const WebSearchPreviewToolSearchContentTypeText WebSearchPreviewToolSearchContentType = "text" -
const WebSearchPreviewToolSearchContentTypeImage WebSearchPreviewToolSearchContentType = "image"
-
-
SearchContextSize WebSearchPreviewToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchPreviewToolSearchContextSizeLow WebSearchPreviewToolSearchContextSize = "low" -
const WebSearchPreviewToolSearchContextSizeMedium WebSearchPreviewToolSearchContextSize = "medium" -
const WebSearchPreviewToolSearchContextSizeHigh WebSearchPreviewToolSearchContextSize = "high"
-
-
UserLocation WebSearchPreviewToolUserLocationThe user's location.
-
Type ApproximateThe type of location approximation. Always
approximate.const ApproximateApproximate Approximate = "approximate"
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
Type ApplyPatchThe type of the tool. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
-
Type ToolSearchOutputThe item type. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
ID stringThe unique ID of this tool search output.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemParamExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemParamExecutionServer ResponseToolSearchOutputItemParamExecution = "server" -
const ResponseToolSearchOutputItemParamExecutionClient ResponseToolSearchOutputItemParamExecution = "client"
-
-
Status ResponseToolSearchOutputItemParamStatusThe status of the tool search output.
-
const ResponseToolSearchOutputItemParamStatusInProgress ResponseToolSearchOutputItemParamStatus = "in_progress" -
const ResponseToolSearchOutputItemParamStatusCompleted ResponseToolSearchOutputItemParamStatus = "completed" -
const ResponseToolSearchOutputItemParamStatusIncomplete ResponseToolSearchOutputItemParamStatus = "incomplete"
-
-
-
type ResponseInputItemAdditionalTools struct{…}-
Role DeveloperThe role that provided the additional tools. Only
developeris supported.const DeveloperDeveloper Developer = "developer"
-
Tools []ToolUnionA list of additional tools made available at this item.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type AdditionalToolsThe item type. Always
additional_tools.const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"
-
ID stringThe unique ID of this additional tools item.
-
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
ID stringThe unique identifier of the reasoning content.
-
Summary []ResponseReasoningItemSummaryReasoning summary content.
-
Text stringA summary of the reasoning output from the model so far.
-
Type SummaryTextThe type of the object. Always
summary_text.const SummaryTextSummaryText SummaryText = "summary_text"
-
-
Type ReasoningThe type of the object. Always
reasoning.const ReasoningReasoning Reasoning = "reasoning"
-
Content []ResponseReasoningItemContentReasoning text content.
-
Text stringThe reasoning text from the model.
-
Type ReasoningTextThe type of the reasoning text. Always
reasoning_text.const ReasoningTextReasoningText ReasoningText = "reasoning_text"
-
-
EncryptedContent stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
Status ResponseReasoningItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseReasoningItemStatusInProgress ResponseReasoningItemStatus = "in_progress" -
const ResponseReasoningItemStatusCompleted ResponseReasoningItemStatus = "completed" -
const ResponseReasoningItemStatusIncomplete ResponseReasoningItemStatus = "incomplete"
-
-
-
type ResponseCompactionItemParamResp struct{…}A compaction item generated by the
v1/responses/compactAPI.-
EncryptedContent stringThe encrypted content of the compaction summary.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
ID stringThe ID of the compaction item.
-
-
type ResponseInputItemImageGenerationCall struct{…}An image generation request made by the model.
-
ID stringThe unique ID of the image generation call.
-
Result stringThe generated image encoded in base64.
-
Status stringThe status of the image generation call.
-
const ResponseInputItemImageGenerationCallStatusInProgress ResponseInputItemImageGenerationCallStatus = "in_progress" -
const ResponseInputItemImageGenerationCallStatusCompleted ResponseInputItemImageGenerationCallStatus = "completed" -
const ResponseInputItemImageGenerationCallStatusGenerating ResponseInputItemImageGenerationCallStatus = "generating" -
const ResponseInputItemImageGenerationCallStatusFailed ResponseInputItemImageGenerationCallStatus = "failed"
-
-
Type ImageGenerationCallThe type of the image generation call. Always
image_generation_call.const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"
-
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
ID stringThe unique ID of the code interpreter tool call.
-
Code stringThe code to run, or null if not available.
-
ContainerID stringThe ID of the container used to run the code.
-
Outputs []ResponseCodeInterpreterToolCallOutputUnionThe outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
type ResponseCodeInterpreterToolCallOutputLogs struct{…}The logs output from the code interpreter.
-
Logs stringThe logs output from the code interpreter.
-
Type LogsThe type of the output. Always
logs.const LogsLogs Logs = "logs"
-
-
type ResponseCodeInterpreterToolCallOutputImage struct{…}The image output from the code interpreter.
-
Type ImageThe type of the output. Always
image.const ImageImage Image = "image"
-
URL stringThe URL of the image output from the code interpreter.
-
-
-
Status ResponseCodeInterpreterToolCallStatusThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
const ResponseCodeInterpreterToolCallStatusInProgress ResponseCodeInterpreterToolCallStatus = "in_progress" -
const ResponseCodeInterpreterToolCallStatusCompleted ResponseCodeInterpreterToolCallStatus = "completed" -
const ResponseCodeInterpreterToolCallStatusIncomplete ResponseCodeInterpreterToolCallStatus = "incomplete" -
const ResponseCodeInterpreterToolCallStatusInterpreting ResponseCodeInterpreterToolCallStatus = "interpreting" -
const ResponseCodeInterpreterToolCallStatusFailed ResponseCodeInterpreterToolCallStatus = "failed"
-
-
Type CodeInterpreterCallThe type of the code interpreter tool call. Always
code_interpreter_call.const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"
-
-
type ResponseInputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
ID stringThe unique ID of the local shell call.
-
Action ResponseInputItemLocalShellCallActionExecute a shell command on the server.
-
Command []stringThe command to run.
-
Env map[string, string]Environment variables to set for the command.
-
Type ExecThe type of the local shell action. Always
exec.const ExecExec Exec = "exec"
-
TimeoutMs int64Optional timeout in milliseconds for the command.
-
User stringOptional user to run the command as.
-
WorkingDirectory stringOptional working directory to run the command in.
-
-
CallID stringThe unique ID of the local shell tool call generated by the model.
-
Status stringThe status of the local shell call.
-
const ResponseInputItemLocalShellCallStatusInProgress ResponseInputItemLocalShellCallStatus = "in_progress" -
const ResponseInputItemLocalShellCallStatusCompleted ResponseInputItemLocalShellCallStatus = "completed" -
const ResponseInputItemLocalShellCallStatusIncomplete ResponseInputItemLocalShellCallStatus = "incomplete"
-
-
Type LocalShellCallThe type of the local shell call. Always
local_shell_call.const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"
-
-
type ResponseInputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
ID stringThe unique ID of the local shell tool call generated by the model.
-
Output stringA JSON string of the output of the local shell tool call.
-
Type LocalShellCallOutputThe type of the local shell tool call output. Always
local_shell_call_output.const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete.-
const ResponseInputItemLocalShellCallOutputStatusInProgress ResponseInputItemLocalShellCallOutputStatus = "in_progress" -
const ResponseInputItemLocalShellCallOutputStatusCompleted ResponseInputItemLocalShellCallOutputStatus = "completed" -
const ResponseInputItemLocalShellCallOutputStatusIncomplete ResponseInputItemLocalShellCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemShellCall struct{…}A tool representing a request to execute one or more shell commands.
-
Action ResponseInputItemShellCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []stringOrdered shell commands for the execution environment to run.
-
MaxOutputLength int64Maximum number of UTF-8 characters to capture from combined stdout and stderr output.
-
TimeoutMs int64Maximum wall-clock time in milliseconds to allow the shell commands to run.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Environment ResponseInputItemShellCallEnvironmentUnionThe environment to execute the shell commands in.
-
type LocalEnvironment struct{…} -
type ContainerReference struct{…}
-
-
Status stringThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseInputItemShellCallStatusInProgress ResponseInputItemShellCallStatus = "in_progress" -
const ResponseInputItemShellCallStatusCompleted ResponseInputItemShellCallStatus = "completed" -
const ResponseInputItemShellCallStatusIncomplete ResponseInputItemShellCallStatus = "incomplete"
-
-
-
type ResponseInputItemShellCallOutput struct{…}The streamed output items emitted by a shell tool call.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Output []ResponseFunctionShellCallOutputContentCaptured chunks of stdout and stderr output, along with their associated outcomes.
-
Outcome ResponseFunctionShellCallOutputContentOutcomeUnionThe exit or timeout outcome associated with this shell call.
-
type ResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellCallOutputContentOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64The exit code returned by the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringCaptured stderr output for the shell call.
-
Stdout stringCaptured stdout output for the shell call.
-
-
Type ShellCallOutputThe type of the item. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
ID stringThe unique ID of the shell tool call output. Populated when this item is returned via API.
-
MaxOutputLength int64The maximum number of UTF-8 characters captured for this shell call's combined output.
-
Status stringThe status of the shell call output.
-
const ResponseInputItemShellCallOutputStatusInProgress ResponseInputItemShellCallOutputStatus = "in_progress" -
const ResponseInputItemShellCallOutputStatusCompleted ResponseInputItemShellCallOutputStatus = "completed" -
const ResponseInputItemShellCallOutputStatusIncomplete ResponseInputItemShellCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemApplyPatchCall struct{…}A tool call representing a request to create, delete, or update files using diff patches.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseInputItemApplyPatchCallOperationUnionThe specific create, delete, or update instruction for the apply_patch tool call.
-
type ResponseInputItemApplyPatchCallOperationCreateFile struct{…}Instruction for creating a new file via the apply_patch tool.
-
Diff stringUnified diff content to apply when creating the file.
-
Path stringPath of the file to create relative to the workspace root.
-
Type CreateFileThe operation type. Always
create_file.const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseInputItemApplyPatchCallOperationDeleteFile struct{…}Instruction for deleting an existing file via the apply_patch tool.
-
Path stringPath of the file to delete relative to the workspace root.
-
Type DeleteFileThe operation type. Always
delete_file.const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseInputItemApplyPatchCallOperationUpdateFile struct{…}Instruction for updating an existing file via the apply_patch tool.
-
Diff stringUnified diff content to apply to the existing file.
-
Path stringPath of the file to update relative to the workspace root.
-
Type UpdateFileThe operation type. Always
update_file.const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status stringThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseInputItemApplyPatchCallStatusInProgress ResponseInputItemApplyPatchCallStatus = "in_progress" -
const ResponseInputItemApplyPatchCallStatusCompleted ResponseInputItemApplyPatchCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
-
type ResponseInputItemApplyPatchCallOutput struct{…}The streamed output emitted by an apply patch tool call.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status stringThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseInputItemApplyPatchCallOutputStatusCompleted ResponseInputItemApplyPatchCallOutputStatus = "completed" -
const ResponseInputItemApplyPatchCallOutputStatusFailed ResponseInputItemApplyPatchCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
Output stringOptional human-readable log text from the apply patch tool (e.g., patch results or errors).
-
-
type ResponseInputItemMcpListTools struct{…}A list of tools available on an MCP server.
-
ID stringThe unique ID of the list.
-
ServerLabel stringThe label of the MCP server.
-
Tools []ResponseInputItemMcpListToolsToolThe tools available on the server.
-
InputSchema anyThe JSON schema describing the tool's input.
-
Name stringThe name of the tool.
-
Annotations anyAdditional annotations about the tool.
-
Description stringThe description of the tool.
-
-
Type McpListToolsThe type of the item. Always
mcp_list_tools.const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
-
Error stringError message if the server could not list tools.
-
-
type ResponseInputItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
ID stringThe unique ID of the approval request.
-
Arguments stringA JSON string of arguments for the tool.
-
Name stringThe name of the tool to run.
-
ServerLabel stringThe label of the MCP server making the request.
-
Type McpApprovalRequestThe type of the item. Always
mcp_approval_request.const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"
-
-
type ResponseInputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
ApprovalRequestID stringThe ID of the approval request being answered.
-
Approve boolWhether the request was approved.
-
Type McpApprovalResponseThe type of the item. Always
mcp_approval_response.const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
-
ID stringThe unique ID of the approval response
-
Reason stringOptional reason for the decision.
-
-
type ResponseInputItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
ID stringThe unique ID of the tool call.
-
Arguments stringA JSON string of the arguments passed to the tool.
-
Name stringThe name of the tool that was run.
-
ServerLabel stringThe label of the MCP server running the tool.
-
Type McpCallThe type of the item. Always
mcp_call.const McpCallMcpCall McpCall = "mcp_call"
-
ApprovalRequestID stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
Error stringThe error from the tool call, if any.
-
Output stringThe output from the tool call.
-
Status stringThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
const ResponseInputItemMcpCallStatusInProgress ResponseInputItemMcpCallStatus = "in_progress" -
const ResponseInputItemMcpCallStatusCompleted ResponseInputItemMcpCallStatus = "completed" -
const ResponseInputItemMcpCallStatusIncomplete ResponseInputItemMcpCallStatus = "incomplete" -
const ResponseInputItemMcpCallStatusCalling ResponseInputItemMcpCallStatus = "calling" -
const ResponseInputItemMcpCallStatusFailed ResponseInputItemMcpCallStatus = "failed"
-
-
-
type ResponseCustomToolCallOutput struct{…}The output of a custom tool call from your code, being sent back to the model.
-
CallID stringThe call ID, used to map this custom tool call output to a custom tool call.
-
Output ResponseCustomToolCallOutputOutputUnionThe output from the custom tool call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseCustomToolCallOutputOutputOutputContentList []ResponseCustomToolCallOutputOutputOutputContentListItemUnionText, image, or file output of the custom tool call.
-
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
-
Type CustomToolCallOutputThe type of the custom tool call output. Always
custom_tool_call_output.const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"
-
ID stringThe unique ID of the custom tool call output in the OpenAI platform.
-
-
type ResponseCustomToolCall struct{…}A call to a custom tool created by the model.
-
CallID stringAn identifier used to map this custom tool call to a tool call output.
-
Input stringThe input for the custom tool call generated by the model.
-
Name stringThe name of the custom tool being called.
-
Type CustomToolCallThe type of the custom tool call. Always
custom_tool_call.const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"
-
ID stringThe unique ID of the custom tool call in the OpenAI platform.
-
Namespace stringThe namespace of the custom tool being called.
-
-
type ResponseInputItemCompactionTrigger struct{…}Compacts the current context. Must be the final input item.
-
Type CompactionTriggerThe type of the item. Always
compaction_trigger.const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"
-
-
type ResponseInputItemItemReference struct{…}An internal identifier for an item to reference.
-
ID stringThe ID of the item to reference.
-
Type stringThe type of item to reference. Always
item_reference.const ResponseInputItemItemReferenceTypeItemReference ResponseInputItemItemReferenceType = "item_reference"
-
-
-
-
Metadata MetadataSet of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
-
Model ResponsesModelModel ID used to generate the response, like
gpt-4ooro3. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models.-
string -
type ChatModel string-
const ChatModelGPT5_4 ChatModel = "gpt-5.4" -
const ChatModelGPT5_4Mini ChatModel = "gpt-5.4-mini" -
const ChatModelGPT5_4Nano ChatModel = "gpt-5.4-nano" -
const ChatModelGPT5_4Mini2026_03_17 ChatModel = "gpt-5.4-mini-2026-03-17" -
const ChatModelGPT5_4Nano2026_03_17 ChatModel = "gpt-5.4-nano-2026-03-17" -
const ChatModelGPT5_3ChatLatest ChatModel = "gpt-5.3-chat-latest" -
const ChatModelGPT5_2 ChatModel = "gpt-5.2" -
const ChatModelGPT5_2_2025_12_11 ChatModel = "gpt-5.2-2025-12-11" -
const ChatModelGPT5_2ChatLatest ChatModel = "gpt-5.2-chat-latest" -
const ChatModelGPT5_2Pro ChatModel = "gpt-5.2-pro" -
const ChatModelGPT5_2Pro2025_12_11 ChatModel = "gpt-5.2-pro-2025-12-11" -
const ChatModelGPT5_1 ChatModel = "gpt-5.1" -
const ChatModelGPT5_1_2025_11_13 ChatModel = "gpt-5.1-2025-11-13" -
const ChatModelGPT5_1Codex ChatModel = "gpt-5.1-codex" -
const ChatModelGPT5_1Mini ChatModel = "gpt-5.1-mini" -
const ChatModelGPT5_1ChatLatest ChatModel = "gpt-5.1-chat-latest" -
const ChatModelGPT5 ChatModel = "gpt-5" -
const ChatModelGPT5Mini ChatModel = "gpt-5-mini" -
const ChatModelGPT5Nano ChatModel = "gpt-5-nano" -
const ChatModelGPT5_2025_08_07 ChatModel = "gpt-5-2025-08-07" -
const ChatModelGPT5Mini2025_08_07 ChatModel = "gpt-5-mini-2025-08-07" -
const ChatModelGPT5Nano2025_08_07 ChatModel = "gpt-5-nano-2025-08-07" -
const ChatModelGPT5ChatLatest ChatModel = "gpt-5-chat-latest" -
const ChatModelGPT4_1 ChatModel = "gpt-4.1" -
const ChatModelGPT4_1Mini ChatModel = "gpt-4.1-mini" -
const ChatModelGPT4_1Nano ChatModel = "gpt-4.1-nano" -
const ChatModelGPT4_1_2025_04_14 ChatModel = "gpt-4.1-2025-04-14" -
const ChatModelGPT4_1Mini2025_04_14 ChatModel = "gpt-4.1-mini-2025-04-14" -
const ChatModelGPT4_1Nano2025_04_14 ChatModel = "gpt-4.1-nano-2025-04-14" -
const ChatModelO4Mini ChatModel = "o4-mini" -
const ChatModelO4Mini2025_04_16 ChatModel = "o4-mini-2025-04-16" -
const ChatModelO3 ChatModel = "o3" -
const ChatModelO3_2025_04_16 ChatModel = "o3-2025-04-16" -
const ChatModelO3Mini ChatModel = "o3-mini" -
const ChatModelO3Mini2025_01_31 ChatModel = "o3-mini-2025-01-31" -
const ChatModelO1 ChatModel = "o1" -
const ChatModelO1_2024_12_17 ChatModel = "o1-2024-12-17" -
const ChatModelO1Preview ChatModel = "o1-preview" -
const ChatModelO1Preview2024_09_12 ChatModel = "o1-preview-2024-09-12" -
const ChatModelO1Mini ChatModel = "o1-mini" -
const ChatModelO1Mini2024_09_12 ChatModel = "o1-mini-2024-09-12" -
const ChatModelGPT4o ChatModel = "gpt-4o" -
const ChatModelGPT4o2024_11_20 ChatModel = "gpt-4o-2024-11-20" -
const ChatModelGPT4o2024_08_06 ChatModel = "gpt-4o-2024-08-06" -
const ChatModelGPT4o2024_05_13 ChatModel = "gpt-4o-2024-05-13" -
const ChatModelGPT4oAudioPreview ChatModel = "gpt-4o-audio-preview" -
const ChatModelGPT4oAudioPreview2024_10_01 ChatModel = "gpt-4o-audio-preview-2024-10-01" -
const ChatModelGPT4oAudioPreview2024_12_17 ChatModel = "gpt-4o-audio-preview-2024-12-17" -
const ChatModelGPT4oAudioPreview2025_06_03 ChatModel = "gpt-4o-audio-preview-2025-06-03" -
const ChatModelGPT4oMiniAudioPreview ChatModel = "gpt-4o-mini-audio-preview" -
const ChatModelGPT4oMiniAudioPreview2024_12_17 ChatModel = "gpt-4o-mini-audio-preview-2024-12-17" -
const ChatModelGPT4oSearchPreview ChatModel = "gpt-4o-search-preview" -
const ChatModelGPT4oMiniSearchPreview ChatModel = "gpt-4o-mini-search-preview" -
const ChatModelGPT4oSearchPreview2025_03_11 ChatModel = "gpt-4o-search-preview-2025-03-11" -
const ChatModelGPT4oMiniSearchPreview2025_03_11 ChatModel = "gpt-4o-mini-search-preview-2025-03-11" -
const ChatModelChatgpt4oLatest ChatModel = "chatgpt-4o-latest" -
const ChatModelCodexMiniLatest ChatModel = "codex-mini-latest" -
const ChatModelGPT4oMini ChatModel = "gpt-4o-mini" -
const ChatModelGPT4oMini2024_07_18 ChatModel = "gpt-4o-mini-2024-07-18" -
const ChatModelGPT4Turbo ChatModel = "gpt-4-turbo" -
const ChatModelGPT4Turbo2024_04_09 ChatModel = "gpt-4-turbo-2024-04-09" -
const ChatModelGPT4_0125Preview ChatModel = "gpt-4-0125-preview" -
const ChatModelGPT4TurboPreview ChatModel = "gpt-4-turbo-preview" -
const ChatModelGPT4_1106Preview ChatModel = "gpt-4-1106-preview" -
const ChatModelGPT4VisionPreview ChatModel = "gpt-4-vision-preview" -
const ChatModelGPT4 ChatModel = "gpt-4" -
const ChatModelGPT4_0314 ChatModel = "gpt-4-0314" -
const ChatModelGPT4_0613 ChatModel = "gpt-4-0613" -
const ChatModelGPT4_32k ChatModel = "gpt-4-32k" -
const ChatModelGPT4_32k0314 ChatModel = "gpt-4-32k-0314" -
const ChatModelGPT4_32k0613 ChatModel = "gpt-4-32k-0613" -
const ChatModelGPT3_5Turbo ChatModel = "gpt-3.5-turbo" -
const ChatModelGPT3_5Turbo16k ChatModel = "gpt-3.5-turbo-16k" -
const ChatModelGPT3_5Turbo0301 ChatModel = "gpt-3.5-turbo-0301" -
const ChatModelGPT3_5Turbo0613 ChatModel = "gpt-3.5-turbo-0613" -
const ChatModelGPT3_5Turbo1106 ChatModel = "gpt-3.5-turbo-1106" -
const ChatModelGPT3_5Turbo0125 ChatModel = "gpt-3.5-turbo-0125" -
const ChatModelGPT3_5Turbo16k0613 ChatModel = "gpt-3.5-turbo-16k-0613"
-
-
type ResponsesModel string-
const ResponsesModelO1Pro ResponsesModel = "o1-pro" -
const ResponsesModelO1Pro2025_03_19 ResponsesModel = "o1-pro-2025-03-19" -
const ResponsesModelO3Pro ResponsesModel = "o3-pro" -
const ResponsesModelO3Pro2025_06_10 ResponsesModel = "o3-pro-2025-06-10" -
const ResponsesModelO3DeepResearch ResponsesModel = "o3-deep-research" -
const ResponsesModelO3DeepResearch2025_06_26 ResponsesModel = "o3-deep-research-2025-06-26" -
const ResponsesModelO4MiniDeepResearch ResponsesModel = "o4-mini-deep-research" -
const ResponsesModelO4MiniDeepResearch2025_06_26 ResponsesModel = "o4-mini-deep-research-2025-06-26" -
const ResponsesModelComputerUsePreview ResponsesModel = "computer-use-preview" -
const ResponsesModelComputerUsePreview2025_03_11 ResponsesModel = "computer-use-preview-2025-03-11" -
const ResponsesModelGPT5Codex ResponsesModel = "gpt-5-codex" -
const ResponsesModelGPT5Pro ResponsesModel = "gpt-5-pro" -
const ResponsesModelGPT5Pro2025_10_06 ResponsesModel = "gpt-5-pro-2025-10-06" -
const ResponsesModelGPT5_1CodexMax ResponsesModel = "gpt-5.1-codex-max"
-
-
-
Object ResponseThe object type of this resource - always set to
response.const ResponseResponse Response = "response"
-
Output []ResponseOutputItemUnionAn array of content items generated by the model.
-
The length and order of items in the
outputarray is dependent on the model's response. -
Rather than accessing the first item in the
outputarray and assuming it's anassistantmessage with the content generated by the model, you might consider using theoutput_textproperty where supported in SDKs. -
type ResponseOutputMessage struct{…}An output message from the model.
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
type ResponseFunctionToolCall struct{…}A tool call to run a function. See the function calling guide for more information.
-
type ResponseFunctionToolCallOutputItem struct{…}-
ID stringThe unique ID of the function call tool output.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseFunctionToolCallOutputItemOutputUnionThe output from the function call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseFunctionToolCallOutputItemOutputOutputContentList []ResponseFunctionToolCallOutputItemOutputOutputContentListItemUnionText, image, or file output of the function call.
-
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
-
Status ResponseFunctionToolCallOutputItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallOutputItemStatusInProgress ResponseFunctionToolCallOutputItemStatus = "in_progress" -
const ResponseFunctionToolCallOutputItemStatusCompleted ResponseFunctionToolCallOutputItemStatus = "completed" -
const ResponseFunctionToolCallOutputItemStatusIncomplete ResponseFunctionToolCallOutputItemStatus = "incomplete"
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
type ResponseComputerToolCallOutputItem struct{…}-
ID stringThe unique ID of the computer call tool output.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Status ResponseComputerToolCallOutputItemStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseComputerToolCallOutputItemStatusCompleted ResponseComputerToolCallOutputItemStatus = "completed" -
const ResponseComputerToolCallOutputItemStatusIncomplete ResponseComputerToolCallOutputItemStatus = "incomplete" -
const ResponseComputerToolCallOutputItemStatusFailed ResponseComputerToolCallOutputItemStatus = "failed" -
const ResponseComputerToolCallOutputItemStatusInProgress ResponseComputerToolCallOutputItemStatus = "in_progress"
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
AcknowledgedSafetyChecks []ResponseComputerToolCallOutputItemAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context. -
type ResponseToolSearchCall struct{…}-
ID stringThe unique ID of the tool search call item.
-
Arguments anyArguments used for the tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchCallExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchCallExecutionServer ResponseToolSearchCallExecution = "server" -
const ResponseToolSearchCallExecutionClient ResponseToolSearchCallExecution = "client"
-
-
Status ResponseToolSearchCallStatusThe status of the tool search call item that was recorded.
-
const ResponseToolSearchCallStatusInProgress ResponseToolSearchCallStatus = "in_progress" -
const ResponseToolSearchCallStatusCompleted ResponseToolSearchCallStatus = "completed" -
const ResponseToolSearchCallStatusIncomplete ResponseToolSearchCallStatus = "incomplete"
-
-
Type ToolSearchCallThe type of the item. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseToolSearchOutputItem struct{…}-
ID stringThe unique ID of the tool search output item.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemExecutionServer ResponseToolSearchOutputItemExecution = "server" -
const ResponseToolSearchOutputItemExecutionClient ResponseToolSearchOutputItemExecution = "client"
-
-
Status ResponseToolSearchOutputItemStatusThe status of the tool search output item that was recorded.
-
const ResponseToolSearchOutputItemStatusInProgress ResponseToolSearchOutputItemStatus = "in_progress" -
const ResponseToolSearchOutputItemStatusCompleted ResponseToolSearchOutputItemStatus = "completed" -
const ResponseToolSearchOutputItemStatusIncomplete ResponseToolSearchOutputItemStatus = "incomplete"
-
-
Tools []ToolUnionThe loaded tool definitions returned by tool search.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type ToolSearchOutputThe type of the item. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseOutputItemAdditionalTools struct{…}-
ID stringThe unique ID of the additional tools item.
-
Role stringThe role that provided the additional tools.
-
const ResponseOutputItemAdditionalToolsRoleUnknown ResponseOutputItemAdditionalToolsRole = "unknown" -
const ResponseOutputItemAdditionalToolsRoleUser ResponseOutputItemAdditionalToolsRole = "user" -
const ResponseOutputItemAdditionalToolsRoleAssistant ResponseOutputItemAdditionalToolsRole = "assistant" -
const ResponseOutputItemAdditionalToolsRoleSystem ResponseOutputItemAdditionalToolsRole = "system" -
const ResponseOutputItemAdditionalToolsRoleCritic ResponseOutputItemAdditionalToolsRole = "critic" -
const ResponseOutputItemAdditionalToolsRoleDiscriminator ResponseOutputItemAdditionalToolsRole = "discriminator" -
const ResponseOutputItemAdditionalToolsRoleDeveloper ResponseOutputItemAdditionalToolsRole = "developer" -
const ResponseOutputItemAdditionalToolsRoleTool ResponseOutputItemAdditionalToolsRole = "tool"
-
-
Tools []ToolUnionThe additional tool definitions made available at this item.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type AdditionalToolsThe type of the item. Always
additional_tools.const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"
-
-
type ResponseCompactionItem struct{…}A compaction item generated by the
v1/responses/compactAPI.-
ID stringThe unique ID of the compaction item.
-
EncryptedContent stringThe encrypted content that was produced by compaction.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseOutputItemImageGenerationCall struct{…}An image generation request made by the model.
-
ID stringThe unique ID of the image generation call.
-
Result stringThe generated image encoded in base64.
-
Status stringThe status of the image generation call.
-
const ResponseOutputItemImageGenerationCallStatusInProgress ResponseOutputItemImageGenerationCallStatus = "in_progress" -
const ResponseOutputItemImageGenerationCallStatusCompleted ResponseOutputItemImageGenerationCallStatus = "completed" -
const ResponseOutputItemImageGenerationCallStatusGenerating ResponseOutputItemImageGenerationCallStatus = "generating" -
const ResponseOutputItemImageGenerationCallStatusFailed ResponseOutputItemImageGenerationCallStatus = "failed"
-
-
Type ImageGenerationCallThe type of the image generation call. Always
image_generation_call.const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"
-
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
type ResponseOutputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
ID stringThe unique ID of the local shell call.
-
Action ResponseOutputItemLocalShellCallActionExecute a shell command on the server.
-
Command []stringThe command to run.
-
Env map[string, string]Environment variables to set for the command.
-
Type ExecThe type of the local shell action. Always
exec.const ExecExec Exec = "exec"
-
TimeoutMs int64Optional timeout in milliseconds for the command.
-
User stringOptional user to run the command as.
-
WorkingDirectory stringOptional working directory to run the command in.
-
-
CallID stringThe unique ID of the local shell tool call generated by the model.
-
Status stringThe status of the local shell call.
-
const ResponseOutputItemLocalShellCallStatusInProgress ResponseOutputItemLocalShellCallStatus = "in_progress" -
const ResponseOutputItemLocalShellCallStatusCompleted ResponseOutputItemLocalShellCallStatus = "completed" -
const ResponseOutputItemLocalShellCallStatusIncomplete ResponseOutputItemLocalShellCallStatus = "incomplete"
-
-
Type LocalShellCallThe type of the local shell call. Always
local_shell_call.const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"
-
-
type ResponseOutputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
ID stringThe unique ID of the local shell tool call generated by the model.
-
Output stringA JSON string of the output of the local shell tool call.
-
Type LocalShellCallOutputThe type of the local shell tool call output. Always
local_shell_call_output.const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete.-
const ResponseOutputItemLocalShellCallOutputStatusInProgress ResponseOutputItemLocalShellCallOutputStatus = "in_progress" -
const ResponseOutputItemLocalShellCallOutputStatusCompleted ResponseOutputItemLocalShellCallOutputStatus = "completed" -
const ResponseOutputItemLocalShellCallOutputStatusIncomplete ResponseOutputItemLocalShellCallOutputStatus = "incomplete"
-
-
-
type ResponseFunctionShellToolCall struct{…}A tool call that executes one or more shell commands in a managed environment.
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Action ResponseFunctionShellToolCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []string -
MaxOutputLength int64Optional maximum number of characters to return from each command.
-
TimeoutMs int64Optional timeout in milliseconds for the commands.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Environment ResponseFunctionShellToolCallEnvironmentUnionRepresents the use of a local environment to perform shell actions.
-
type ResponseLocalEnvironment struct{…}Represents the use of a local environment to perform shell actions.
-
Type LocalThe environment type. Always
local.const LocalLocal Local = "local"
-
-
type ResponseContainerReference struct{…}Represents a container created with /v1/containers.
-
ContainerID string -
Type ContainerReferenceThe environment type. Always
container_reference.const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
Status ResponseFunctionShellToolCallStatusThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallStatusInProgress ResponseFunctionShellToolCallStatus = "in_progress" -
const ResponseFunctionShellToolCallStatusCompleted ResponseFunctionShellToolCallStatus = "completed" -
const ResponseFunctionShellToolCallStatusIncomplete ResponseFunctionShellToolCallStatus = "incomplete"
-
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseFunctionShellToolCallOutput struct{…}The output of a shell tool call that was emitted.
-
ID stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
MaxOutputLength int64The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
Output []ResponseFunctionShellToolCallOutputOutputAn array of shell call output contents
-
Outcome ResponseFunctionShellToolCallOutputOutputOutcomeUnionRepresents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
type ResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64Exit code from the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringThe standard error output that was captured.
-
Stdout stringThe standard output that was captured.
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
Status ResponseFunctionShellToolCallOutputStatusThe status of the shell call output. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallOutputStatusInProgress ResponseFunctionShellToolCallOutputStatus = "in_progress" -
const ResponseFunctionShellToolCallOutputStatusCompleted ResponseFunctionShellToolCallOutputStatus = "completed" -
const ResponseFunctionShellToolCallOutputStatusIncomplete ResponseFunctionShellToolCallOutputStatus = "incomplete"
-
-
Type ShellCallOutputThe type of the shell call output. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseApplyPatchToolCall struct{…}A tool call that applies file diffs by creating, deleting, or updating files.
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseApplyPatchToolCallOperationUnionOne of the create_file, delete_file, or update_file operations applied via apply_patch.
-
type ResponseApplyPatchToolCallOperationCreateFile struct{…}Instruction describing how to create a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to create.
-
Type CreateFileCreate a new file with the provided diff.
const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseApplyPatchToolCallOperationDeleteFile struct{…}Instruction describing how to delete a file via the apply_patch tool.
-
Path stringPath of the file to delete.
-
Type DeleteFileDelete the specified file.
const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseApplyPatchToolCallOperationUpdateFile struct{…}Instruction describing how to update a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to update.
-
Type UpdateFileUpdate an existing file with the provided diff.
const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status ResponseApplyPatchToolCallStatusThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseApplyPatchToolCallStatusInProgress ResponseApplyPatchToolCallStatus = "in_progress" -
const ResponseApplyPatchToolCallStatusCompleted ResponseApplyPatchToolCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseApplyPatchToolCallOutput struct{…}The output emitted by an apply patch tool call.
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status ResponseApplyPatchToolCallOutputStatusThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseApplyPatchToolCallOutputStatusCompleted ResponseApplyPatchToolCallOutputStatus = "completed" -
const ResponseApplyPatchToolCallOutputStatusFailed ResponseApplyPatchToolCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
CreatedBy stringThe ID of the entity that created this tool call output.
-
Output stringOptional textual output returned by the apply patch tool.
-
-
type ResponseOutputItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
ID stringThe unique ID of the tool call.
-
Arguments stringA JSON string of the arguments passed to the tool.
-
Name stringThe name of the tool that was run.
-
ServerLabel stringThe label of the MCP server running the tool.
-
Type McpCallThe type of the item. Always
mcp_call.const McpCallMcpCall McpCall = "mcp_call"
-
ApprovalRequestID stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
Error stringThe error from the tool call, if any.
-
Output stringThe output from the tool call.
-
Status stringThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
const ResponseOutputItemMcpCallStatusInProgress ResponseOutputItemMcpCallStatus = "in_progress" -
const ResponseOutputItemMcpCallStatusCompleted ResponseOutputItemMcpCallStatus = "completed" -
const ResponseOutputItemMcpCallStatusIncomplete ResponseOutputItemMcpCallStatus = "incomplete" -
const ResponseOutputItemMcpCallStatusCalling ResponseOutputItemMcpCallStatus = "calling" -
const ResponseOutputItemMcpCallStatusFailed ResponseOutputItemMcpCallStatus = "failed"
-
-
-
type ResponseOutputItemMcpListTools struct{…}A list of tools available on an MCP server.
-
ID stringThe unique ID of the list.
-
ServerLabel stringThe label of the MCP server.
-
Tools []ResponseOutputItemMcpListToolsToolThe tools available on the server.
-
InputSchema anyThe JSON schema describing the tool's input.
-
Name stringThe name of the tool.
-
Annotations anyAdditional annotations about the tool.
-
Description stringThe description of the tool.
-
-
Type McpListToolsThe type of the item. Always
mcp_list_tools.const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
-
Error stringError message if the server could not list tools.
-
-
type ResponseOutputItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
ID stringThe unique ID of the approval request.
-
Arguments stringA JSON string of arguments for the tool.
-
Name stringThe name of the tool to run.
-
ServerLabel stringThe label of the MCP server making the request.
-
Type McpApprovalRequestThe type of the item. Always
mcp_approval_request.const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"
-
-
type ResponseOutputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
ID stringThe unique ID of the approval response
-
ApprovalRequestID stringThe ID of the approval request being answered.
-
Approve boolWhether the request was approved.
-
Type McpApprovalResponseThe type of the item. Always
mcp_approval_response.const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
-
Reason stringOptional reason for the decision.
-
-
type ResponseCustomToolCall struct{…}A call to a custom tool created by the model.
-
type ResponseCustomToolCallOutputItem struct{…}The output of a custom tool call from your code, being sent back to the model.
-
ID stringThe unique ID of the custom tool call output item.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseCustomToolCallOutputItemStatusInProgress ResponseCustomToolCallOutputItemStatus = "in_progress" -
const ResponseCustomToolCallOutputItemStatusCompleted ResponseCustomToolCallOutputItemStatus = "completed" -
const ResponseCustomToolCallOutputItemStatusIncomplete ResponseCustomToolCallOutputItemStatus = "incomplete"
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
-
ParallelToolCalls boolWhether to allow the model to run tool calls in parallel.
-
Temperature float64What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or
top_pbut not both. -
ToolChoice ResponseToolChoiceUnionHow the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call.-
type ToolChoiceOptions stringControls which (if any) tool is called by the model.
nonemeans the model will not call any tool and instead generates a message.automeans the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools.-
const ToolChoiceOptionsNone ToolChoiceOptions = "none" -
const ToolChoiceOptionsAuto ToolChoiceOptions = "auto" -
const ToolChoiceOptionsRequired ToolChoiceOptions = "required"
-
-
type ToolChoiceAllowed struct{…}Constrains the tools available to the model to a pre-defined set.
-
Mode ToolChoiceAllowedModeConstrains the tools available to the model to a pre-defined set.
autoallows the model to pick from among the allowed tools and generate a message.requiredrequires the model to call one or more of the allowed tools.-
const ToolChoiceAllowedModeAuto ToolChoiceAllowedMode = "auto" -
const ToolChoiceAllowedModeRequired ToolChoiceAllowedMode = "required"
-
-
Tools []map[string, any]A list of tool definitions that the model should be allowed to call.
For the Responses API, the list of tool definitions might look like:
[ { "type": "function", "name": "get_weather" }, { "type": "mcp", "server_label": "deepwiki" }, { "type": "image_generation" } ] -
Type AllowedToolsAllowed tool configuration type. Always
allowed_tools.const AllowedToolsAllowedTools AllowedTools = "allowed_tools"
-
-
type ToolChoiceTypes struct{…}Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
-
Type ToolChoiceTypesTypeThe type of hosted tool the model should to use. Learn more about built-in tools.
Allowed values are:
-
file_search -
web_search_preview -
computer -
computer_use_preview -
computer_use -
code_interpreter -
image_generation -
const ToolChoiceTypesTypeFileSearch ToolChoiceTypesType = "file_search" -
const ToolChoiceTypesTypeWebSearchPreview ToolChoiceTypesType = "web_search_preview" -
const ToolChoiceTypesTypeComputer ToolChoiceTypesType = "computer" -
const ToolChoiceTypesTypeComputerUsePreview ToolChoiceTypesType = "computer_use_preview" -
const ToolChoiceTypesTypeComputerUse ToolChoiceTypesType = "computer_use" -
const ToolChoiceTypesTypeWebSearchPreview2025_03_11 ToolChoiceTypesType = "web_search_preview_2025_03_11" -
const ToolChoiceTypesTypeImageGeneration ToolChoiceTypesType = "image_generation" -
const ToolChoiceTypesTypeCodeInterpreter ToolChoiceTypesType = "code_interpreter"
-
-
-
type ToolChoiceFunction struct{…}Use this option to force the model to call a specific function.
-
Name stringThe name of the function to call.
-
Type FunctionFor function calling, the type is always
function.const FunctionFunction Function = "function"
-
-
type ToolChoiceMcp struct{…}Use this option to force the model to call a specific tool on a remote MCP server.
-
ServerLabel stringThe label of the MCP server to use.
-
Type McpFor MCP tools, the type is always
mcp.const McpMcp Mcp = "mcp"
-
Name stringThe name of the tool to call on the server.
-
-
type ToolChoiceCustom struct{…}Use this option to force the model to call a specific custom tool.
-
Name stringThe name of the custom tool to call.
-
Type CustomFor custom tool calling, the type is always
custom.const CustomCustom Custom = "custom"
-
-
type ToolChoiceApplyPatch struct{…}Forces the model to call the apply_patch tool when executing a tool call.
-
Type ApplyPatchThe tool to call. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
type ToolChoiceShell struct{…}Forces the model to call the shell tool when a tool call is required.
-
Type ShellThe tool to call. Always
shell.const ShellShell Shell = "shell"
-
-
-
Tools []ToolUnionAn array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.We support the following categories of tools:
-
Built-in tools: Tools that are provided by OpenAI that extend the model's capabilities, like web search or file search. Learn more about built-in tools.
-
MCP Tools: Integrations with third-party systems via custom MCP servers or predefined connectors such as Google Drive and SharePoint. Learn more about MCP Tools.
-
Function calls (custom tools): Functions that are defined by you, enabling the model to call your own code with strongly typed arguments and outputs. Learn more about function calling. You can also use custom tools to call your own code.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
TopP float64An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
We generally recommend altering this or
temperaturebut not both. -
Background boolWhether to run the model response in the background. Learn more.
-
CompletedAt float64Unix timestamp (in seconds) of when this Response was completed. Only present when the status is
completed. -
Conversation ResponseConversationThe conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
-
ID stringThe unique ID of the conversation that this response was associated with.
-
-
MaxOutputTokens int64An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
MaxToolCalls int64The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored.
-
Moderation ResponseModerationModeration results for the response input and output, if moderated completions were requested.
-
Input ResponseModerationInputUnionModeration for the response input.
-
type ResponseModerationInputModerationResult struct{…}A moderation result produced for the response input or output.
-
Categories map[string, bool]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
CategoryAppliedInputTypes map[string, []string]Which modalities of input are reflected by the score for each category.
-
const ResponseModerationInputModerationResultCategoryAppliedInputTypeText ResponseModerationInputModerationResultCategoryAppliedInputType = "text" -
const ResponseModerationInputModerationResultCategoryAppliedInputTypeImage ResponseModerationInputModerationResultCategoryAppliedInputType = "image"
-
-
CategoryScores map[string, float64]A dictionary of moderation categories to scores.
-
Flagged boolA boolean indicating whether the content was flagged by any category.
-
Model stringThe moderation model that produced this result.
-
Type ModerationResultThe object type, which was always
moderation_resultfor successful moderation results.const ModerationResultModerationResult ModerationResult = "moderation_result"
-
-
type ResponseModerationInputError struct{…}An error produced while attempting moderation for the response input or output.
-
Code stringThe error code.
-
Message stringThe error message.
-
Type ErrorThe object type, which was always
errorfor moderation failures.const ErrorError Error = "error"
-
-
-
Output ResponseModerationOutputUnionModeration for the response output.
-
type ResponseModerationOutputModerationResult struct{…}A moderation result produced for the response input or output.
-
Categories map[string, bool]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
CategoryAppliedInputTypes map[string, []string]Which modalities of input are reflected by the score for each category.
-
const ResponseModerationOutputModerationResultCategoryAppliedInputTypeText ResponseModerationOutputModerationResultCategoryAppliedInputType = "text" -
const ResponseModerationOutputModerationResultCategoryAppliedInputTypeImage ResponseModerationOutputModerationResultCategoryAppliedInputType = "image"
-
-
CategoryScores map[string, float64]A dictionary of moderation categories to scores.
-
Flagged boolA boolean indicating whether the content was flagged by any category.
-
Model stringThe moderation model that produced this result.
-
Type ModerationResultThe object type, which was always
moderation_resultfor successful moderation results.const ModerationResultModerationResult ModerationResult = "moderation_result"
-
-
type ResponseModerationOutputError struct{…}An error produced while attempting moderation for the response input or output.
-
Code stringThe error code.
-
Message stringThe error message.
-
Type ErrorThe object type, which was always
errorfor moderation failures.const ErrorError Error = "error"
-
-
-
-
PreviousResponseID stringThe unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about conversation state. Cannot be used in conjunction with
conversation. -
Prompt ResponsePromptReference to a prompt template and its variables. Learn more.
-
ID stringThe unique identifier of the prompt template to use.
-
Variables map[string, ResponsePromptVariableUnion]Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files.
-
string -
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
Version stringOptional version of the prompt template.
-
-
PromptCacheKey stringUsed by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more. -
PromptCacheRetention ResponsePromptCacheRetentionThe retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. Forgpt-5.5,gpt-5.5-pro, and future models, only24his supported.For older models that support both
in_memoryand24h, the default depends on your organization's data retention policy:-
Organizations without ZDR enabled default to
24h. -
Organizations with ZDR enabled default to
in_memorywhenprompt_cache_retentionis not specified. -
const ResponsePromptCacheRetentionInMemory ResponsePromptCacheRetention = "in_memory" -
const ResponsePromptCacheRetention24h ResponsePromptCacheRetention = "24h"
-
-
Reasoning Reasoninggpt-5 and o-series models only
Configuration options for reasoning models.
-
Context ReasoningContextControls which reasoning items are rendered back to the model on later turns. When returned on a response, this is the effective reasoning context mode used for the response.
-
const ReasoningContextAuto ReasoningContext = "auto" -
const ReasoningContextCurrentTurn ReasoningContext = "current_turn" -
const ReasoningContextAllTurns ReasoningContext = "all_turns"
-
-
Effort ReasoningEffortConstrains effort on reasoning for reasoning models. Currently supported values are
none,minimal,low,medium,high, andxhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.-
gpt-5.1defaults tonone, which does not perform reasoning. The supported reasoning values forgpt-5.1arenone,low,medium, andhigh. Tool calls are supported for all reasoning values in gpt-5.1. -
All models before
gpt-5.1default tomediumreasoning effort, and do not supportnone. -
The
gpt-5-promodel defaults to (and only supports)highreasoning effort. -
xhighis supported for all models aftergpt-5.1-codex-max. -
const ReasoningEffortNone ReasoningEffort = "none" -
const ReasoningEffortMinimal ReasoningEffort = "minimal" -
const ReasoningEffortLow ReasoningEffort = "low" -
const ReasoningEffortMedium ReasoningEffort = "medium" -
const ReasoningEffortHigh ReasoningEffort = "high" -
const ReasoningEffortXhigh ReasoningEffort = "xhigh"
-
-
GenerateSummary ReasoningGenerateSummaryDeprecated: use
summaryinstead.A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.-
const ReasoningGenerateSummaryAuto ReasoningGenerateSummary = "auto" -
const ReasoningGenerateSummaryConcise ReasoningGenerateSummary = "concise" -
const ReasoningGenerateSummaryDetailed ReasoningGenerateSummary = "detailed"
-
-
Summary ReasoningSummaryA summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.conciseis supported forcomputer-use-previewmodels and all reasoning models aftergpt-5.-
const ReasoningSummaryAuto ReasoningSummary = "auto" -
const ReasoningSummaryConcise ReasoningSummary = "concise" -
const ReasoningSummaryDetailed ReasoningSummary = "detailed"
-
-
-
SafetyIdentifier stringA stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
ServiceTier ResponseServiceTierSpecifies the processing type used for serving the request.
- If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'.
- If set to 'default', then the request will be processed with the standard pricing and performance for the selected model.
- If set to 'flex' or 'priority', then the request will be processed with the corresponding service tier.
- When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.-
const ResponseServiceTierAuto ResponseServiceTier = "auto" -
const ResponseServiceTierDefault ResponseServiceTier = "default" -
const ResponseServiceTierFlex ResponseServiceTier = "flex" -
const ResponseServiceTierScale ResponseServiceTier = "scale" -
const ResponseServiceTierPriority ResponseServiceTier = "priority"
-
Status ResponseStatusThe status of the response generation. One of
completed,failed,in_progress,cancelled,queued, orincomplete.-
const ResponseStatusCompleted ResponseStatus = "completed" -
const ResponseStatusFailed ResponseStatus = "failed" -
const ResponseStatusInProgress ResponseStatus = "in_progress" -
const ResponseStatusCancelled ResponseStatus = "cancelled" -
const ResponseStatusQueued ResponseStatus = "queued" -
const ResponseStatusIncomplete ResponseStatus = "incomplete"
-
-
Text ResponseTextConfigConfiguration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
Format ResponseFormatTextConfigUnionAn object specifying the format that the model must output.
Configuring
{ "type": "json_schema" }enables Structured Outputs, which ensures the model will match your supplied JSON schema. Learn more in the Structured Outputs guide.The default format is
{ "type": "text" }with no additional options.Not recommended for gpt-4o and newer models:
Setting to
{ "type": "json_object" }enables the older JSON mode, which ensures the message the model generates is valid JSON. Usingjson_schemais preferred for models that support it.-
type ResponseFormatText struct{…}Default response format. Used to generate text responses.
-
Type TextThe type of response format being defined. Always
text.const TextText Text = "text"
-
-
type ResponseFormatTextJSONSchemaConfig struct{…}JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
Name stringThe name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
-
Schema map[string, any]The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
-
Type JSONSchemaThe type of response format being defined. Always
json_schema.const JSONSchemaJSONSchema JSONSchema = "json_schema"
-
Description stringA description of what the response format is for, used by the model to determine how to respond in the format.
-
Strict boolWhether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the
schemafield. Only a subset of JSON Schema is supported whenstrictistrue. To learn more, read the Structured Outputs guide.
-
-
type ResponseFormatJSONObject struct{…}JSON object response format. An older method of generating JSON responses. Using
json_schemais 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 JSONObjectThe type of response format being defined. Always
json_object.const JSONObjectJSONObject JSONObject = "json_object"
-
-
-
Verbosity ResponseTextConfigVerbosityConstrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses. Currently supported values are
low,medium, andhigh.-
const ResponseTextConfigVerbosityLow ResponseTextConfigVerbosity = "low" -
const ResponseTextConfigVerbosityMedium ResponseTextConfigVerbosity = "medium" -
const ResponseTextConfigVerbosityHigh ResponseTextConfigVerbosity = "high"
-
-
TopLogprobs int64An integer between 0 and 20 specifying the maximum number of most likely tokens to return at each token position, each with an associated log probability. In some cases, the number of returned tokens may be fewer than requested.
-
Truncation ResponseTruncationThe truncation strategy to use for the model response.
-
auto: If the input to this Response exceeds the model's context window size, the model will truncate the response to fit the context window by dropping items from the beginning of the conversation. -
disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error. -
const ResponseTruncationAuto ResponseTruncation = "auto" -
const ResponseTruncationDisabled ResponseTruncation = "disabled"
-
-
Usage ResponseUsageRepresents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
-
InputTokens int64The number of input tokens.
-
InputTokensDetails ResponseUsageInputTokensDetailsA detailed breakdown of the input tokens.
-
CachedTokens int64The number of tokens that were retrieved from the cache. More on prompt caching.
-
-
OutputTokens int64The number of output tokens.
-
OutputTokensDetails ResponseUsageOutputTokensDetailsA detailed breakdown of the output tokens.
-
ReasoningTokens int64The number of reasoning tokens.
-
-
TotalTokens int64The total number of tokens used.
-
-
User stringThis field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead to maintain caching optimizations. A stable identifier for your end-users. Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. Learn more.
-
-
SequenceNumber int64The sequence number for this event.
-
Type ResponseCompletedThe type of the event. Always
response.completed.const ResponseCompletedResponseCompleted ResponseCompleted = "response.completed"
-
-
type ResponseContentPartAddedEvent struct{…}Emitted when a new content part is added.
-
ContentIndex int64The index of the content part that was added.
-
ItemID stringThe ID of the output item that the content part was added to.
-
OutputIndex int64The index of the output item that the content part was added to.
-
Part ResponseContentPartAddedEventPartUnionThe content part that was added.
-
type ResponseOutputText struct{…}A text output from the model.
-
type ResponseOutputRefusal struct{…}A refusal from the model.
-
type ResponseContentPartAddedEventPartReasoningText struct{…}Reasoning text from the model.
-
Text stringThe reasoning text from the model.
-
Type ReasoningTextThe type of the reasoning text. Always
reasoning_text.const ReasoningTextReasoningText ReasoningText = "reasoning_text"
-
-
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseContentPartAddedThe type of the event. Always
response.content_part.added.const ResponseContentPartAddedResponseContentPartAdded ResponseContentPartAdded = "response.content_part.added"
-
-
type ResponseContentPartDoneEvent struct{…}Emitted when a content part is done.
-
ContentIndex int64The index of the content part that is done.
-
ItemID stringThe ID of the output item that the content part was added to.
-
OutputIndex int64The index of the output item that the content part was added to.
-
Part ResponseContentPartDoneEventPartUnionThe content part that is done.
-
type ResponseOutputText struct{…}A text output from the model.
-
type ResponseOutputRefusal struct{…}A refusal from the model.
-
type ResponseContentPartDoneEventPartReasoningText struct{…}Reasoning text from the model.
-
Text stringThe reasoning text from the model.
-
Type ReasoningTextThe type of the reasoning text. Always
reasoning_text.const ReasoningTextReasoningText ReasoningText = "reasoning_text"
-
-
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseContentPartDoneThe type of the event. Always
response.content_part.done.const ResponseContentPartDoneResponseContentPartDone ResponseContentPartDone = "response.content_part.done"
-
-
type ResponseCreatedEvent struct{…}An event that is emitted when a response is created.
-
Response ResponseThe response that was created.
-
SequenceNumber int64The sequence number for this event.
-
Type ResponseCreatedThe type of the event. Always
response.created.const ResponseCreatedResponseCreated ResponseCreated = "response.created"
-
-
type ResponseErrorEvent struct{…}Emitted when an error occurs.
-
Code stringThe error code.
-
Message stringThe error message.
-
Param stringThe error parameter.
-
SequenceNumber int64The sequence number of this event.
-
Type ErrorThe type of the event. Always
error.const ErrorError Error = "error"
-
-
type ResponseFileSearchCallCompletedEvent struct{…}Emitted when a file search call is completed (results found).
-
ItemID stringThe ID of the output item that the file search call is initiated.
-
OutputIndex int64The index of the output item that the file search call is initiated.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseFileSearchCallCompletedThe type of the event. Always
response.file_search_call.completed.const ResponseFileSearchCallCompletedResponseFileSearchCallCompleted ResponseFileSearchCallCompleted = "response.file_search_call.completed"
-
-
type ResponseFileSearchCallInProgressEvent struct{…}Emitted when a file search call is initiated.
-
ItemID stringThe ID of the output item that the file search call is initiated.
-
OutputIndex int64The index of the output item that the file search call is initiated.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseFileSearchCallInProgressThe type of the event. Always
response.file_search_call.in_progress.const ResponseFileSearchCallInProgressResponseFileSearchCallInProgress ResponseFileSearchCallInProgress = "response.file_search_call.in_progress"
-
-
type ResponseFileSearchCallSearchingEvent struct{…}Emitted when a file search is currently searching.
-
ItemID stringThe ID of the output item that the file search call is initiated.
-
OutputIndex int64The index of the output item that the file search call is searching.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseFileSearchCallSearchingThe type of the event. Always
response.file_search_call.searching.const ResponseFileSearchCallSearchingResponseFileSearchCallSearching ResponseFileSearchCallSearching = "response.file_search_call.searching"
-
-
type ResponseFunctionCallArgumentsDeltaEvent struct{…}Emitted when there is a partial function-call arguments delta.
-
Delta stringThe function-call arguments delta that is added.
-
ItemID stringThe ID of the output item that the function-call arguments delta is added to.
-
OutputIndex int64The index of the output item that the function-call arguments delta is added to.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseFunctionCallArgumentsDeltaThe type of the event. Always
response.function_call_arguments.delta.const ResponseFunctionCallArgumentsDeltaResponseFunctionCallArgumentsDelta ResponseFunctionCallArgumentsDelta = "response.function_call_arguments.delta"
-
-
type ResponseFunctionCallArgumentsDoneEvent struct{…}Emitted when function-call arguments are finalized.
-
Arguments stringThe function-call arguments.
-
ItemID stringThe ID of the item.
-
Name stringThe name of the function that was called.
-
OutputIndex int64The index of the output item.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseFunctionCallArgumentsDoneconst ResponseFunctionCallArgumentsDoneResponseFunctionCallArgumentsDone ResponseFunctionCallArgumentsDone = "response.function_call_arguments.done"
-
-
type ResponseInProgressEvent struct{…}Emitted when the response is in progress.
-
Response ResponseThe response that is in progress.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseInProgressThe type of the event. Always
response.in_progress.const ResponseInProgressResponseInProgress ResponseInProgress = "response.in_progress"
-
-
type ResponseFailedEvent struct{…}An event that is emitted when a response fails.
-
Response ResponseThe response that failed.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseFailedThe type of the event. Always
response.failed.const ResponseFailedResponseFailed ResponseFailed = "response.failed"
-
-
type ResponseIncompleteEvent struct{…}An event that is emitted when a response finishes as incomplete.
-
Response ResponseThe response that was incomplete.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseIncompleteThe type of the event. Always
response.incomplete.const ResponseIncompleteResponseIncomplete ResponseIncomplete = "response.incomplete"
-
-
type ResponseOutputItemAddedEvent struct{…}Emitted when a new output item is added.
-
Item ResponseOutputItemUnionThe output item that was added.
-
type ResponseOutputMessage struct{…}An output message from the model.
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
type ResponseFunctionToolCall struct{…}A tool call to run a function. See the function calling guide for more information.
-
type ResponseFunctionToolCallOutputItem struct{…} -
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
type ResponseComputerToolCallOutputItem struct{…} -
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context. -
type ResponseToolSearchCall struct{…} -
type ResponseToolSearchOutputItem struct{…} -
type ResponseOutputItemAdditionalTools struct{…} -
type ResponseCompactionItem struct{…}A compaction item generated by the
v1/responses/compactAPI. -
type ResponseOutputItemImageGenerationCall struct{…}An image generation request made by the model.
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
type ResponseOutputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
type ResponseOutputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
type ResponseFunctionShellToolCall struct{…}A tool call that executes one or more shell commands in a managed environment.
-
type ResponseFunctionShellToolCallOutput struct{…}The output of a shell tool call that was emitted.
-
type ResponseApplyPatchToolCall struct{…}A tool call that applies file diffs by creating, deleting, or updating files.
-
type ResponseApplyPatchToolCallOutput struct{…}The output emitted by an apply patch tool call.
-
type ResponseOutputItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
type ResponseOutputItemMcpListTools struct{…}A list of tools available on an MCP server.
-
type ResponseOutputItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
type ResponseOutputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
type ResponseCustomToolCall struct{…}A call to a custom tool created by the model.
-
type ResponseCustomToolCallOutputItem struct{…}The output of a custom tool call from your code, being sent back to the model.
-
-
OutputIndex int64The index of the output item that was added.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseOutputItemAddedThe type of the event. Always
response.output_item.added.const ResponseOutputItemAddedResponseOutputItemAdded ResponseOutputItemAdded = "response.output_item.added"
-
-
type ResponseOutputItemDoneEvent struct{…}Emitted when an output item is marked done.
-
Item ResponseOutputItemUnionThe output item that was marked done.
-
OutputIndex int64The index of the output item that was marked done.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseOutputItemDoneThe type of the event. Always
response.output_item.done.const ResponseOutputItemDoneResponseOutputItemDone ResponseOutputItemDone = "response.output_item.done"
-
-
type ResponseReasoningSummaryPartAddedEvent struct{…}Emitted when a new reasoning summary part is added.
-
ItemID stringThe ID of the item this summary part is associated with.
-
OutputIndex int64The index of the output item this summary part is associated with.
-
Part ResponseReasoningSummaryPartAddedEventPartThe summary part that was added.
-
Text stringThe text of the summary part.
-
Type SummaryTextThe type of the summary part. Always
summary_text.const SummaryTextSummaryText SummaryText = "summary_text"
-
-
SequenceNumber int64The sequence number of this event.
-
SummaryIndex int64The index of the summary part within the reasoning summary.
-
Type ResponseReasoningSummaryPartAddedThe type of the event. Always
response.reasoning_summary_part.added.const ResponseReasoningSummaryPartAddedResponseReasoningSummaryPartAdded ResponseReasoningSummaryPartAdded = "response.reasoning_summary_part.added"
-
-
type ResponseReasoningSummaryPartDoneEvent struct{…}Emitted when a reasoning summary part is completed.
-
ItemID stringThe ID of the item this summary part is associated with.
-
OutputIndex int64The index of the output item this summary part is associated with.
-
Part ResponseReasoningSummaryPartDoneEventPartThe completed summary part.
-
Text stringThe text of the summary part.
-
Type SummaryTextThe type of the summary part. Always
summary_text.const SummaryTextSummaryText SummaryText = "summary_text"
-
-
SequenceNumber int64The sequence number of this event.
-
SummaryIndex int64The index of the summary part within the reasoning summary.
-
Type ResponseReasoningSummaryPartDoneThe type of the event. Always
response.reasoning_summary_part.done.const ResponseReasoningSummaryPartDoneResponseReasoningSummaryPartDone ResponseReasoningSummaryPartDone = "response.reasoning_summary_part.done"
-
-
type ResponseReasoningSummaryTextDeltaEvent struct{…}Emitted when a delta is added to a reasoning summary text.
-
Delta stringThe text delta that was added to the summary.
-
ItemID stringThe ID of the item this summary text delta is associated with.
-
OutputIndex int64The index of the output item this summary text delta is associated with.
-
SequenceNumber int64The sequence number of this event.
-
SummaryIndex int64The index of the summary part within the reasoning summary.
-
Type ResponseReasoningSummaryTextDeltaThe type of the event. Always
response.reasoning_summary_text.delta.const ResponseReasoningSummaryTextDeltaResponseReasoningSummaryTextDelta ResponseReasoningSummaryTextDelta = "response.reasoning_summary_text.delta"
-
-
type ResponseReasoningSummaryTextDoneEvent struct{…}Emitted when a reasoning summary text is completed.
-
ItemID stringThe ID of the item this summary text is associated with.
-
OutputIndex int64The index of the output item this summary text is associated with.
-
SequenceNumber int64The sequence number of this event.
-
SummaryIndex int64The index of the summary part within the reasoning summary.
-
Text stringThe full text of the completed reasoning summary.
-
Type ResponseReasoningSummaryTextDoneThe type of the event. Always
response.reasoning_summary_text.done.const ResponseReasoningSummaryTextDoneResponseReasoningSummaryTextDone ResponseReasoningSummaryTextDone = "response.reasoning_summary_text.done"
-
-
type ResponseReasoningTextDeltaEvent struct{…}Emitted when a delta is added to a reasoning text.
-
ContentIndex int64The index of the reasoning content part this delta is associated with.
-
Delta stringThe text delta that was added to the reasoning content.
-
ItemID stringThe ID of the item this reasoning text delta is associated with.
-
OutputIndex int64The index of the output item this reasoning text delta is associated with.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseReasoningTextDeltaThe type of the event. Always
response.reasoning_text.delta.const ResponseReasoningTextDeltaResponseReasoningTextDelta ResponseReasoningTextDelta = "response.reasoning_text.delta"
-
-
type ResponseReasoningTextDoneEvent struct{…}Emitted when a reasoning text is completed.
-
ContentIndex int64The index of the reasoning content part.
-
ItemID stringThe ID of the item this reasoning text is associated with.
-
OutputIndex int64The index of the output item this reasoning text is associated with.
-
SequenceNumber int64The sequence number of this event.
-
Text stringThe full text of the completed reasoning content.
-
Type ResponseReasoningTextDoneThe type of the event. Always
response.reasoning_text.done.const ResponseReasoningTextDoneResponseReasoningTextDone ResponseReasoningTextDone = "response.reasoning_text.done"
-
-
type ResponseRefusalDeltaEvent struct{…}Emitted when there is a partial refusal text.
-
ContentIndex int64The index of the content part that the refusal text is added to.
-
Delta stringThe refusal text that is added.
-
ItemID stringThe ID of the output item that the refusal text is added to.
-
OutputIndex int64The index of the output item that the refusal text is added to.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseRefusalDeltaThe type of the event. Always
response.refusal.delta.const ResponseRefusalDeltaResponseRefusalDelta ResponseRefusalDelta = "response.refusal.delta"
-
-
type ResponseRefusalDoneEvent struct{…}Emitted when refusal text is finalized.
-
ContentIndex int64The index of the content part that the refusal text is finalized.
-
ItemID stringThe ID of the output item that the refusal text is finalized.
-
OutputIndex int64The index of the output item that the refusal text is finalized.
-
Refusal stringThe refusal text that is finalized.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseRefusalDoneThe type of the event. Always
response.refusal.done.const ResponseRefusalDoneResponseRefusalDone ResponseRefusalDone = "response.refusal.done"
-
-
type ResponseTextDeltaEvent struct{…}Emitted when there is an additional text delta.
-
ContentIndex int64The index of the content part that the text delta was added to.
-
Delta stringThe text delta that was added.
-
ItemID stringThe ID of the output item that the text delta was added to.
-
Logprobs []ResponseTextDeltaEventLogprobThe log probabilities of the tokens in the delta.
-
Token stringA possible text token.
-
Logprob float64The log probability of this token.
-
TopLogprobs []ResponseTextDeltaEventLogprobTopLogprobThe log probabilities of up to 20 of the most likely tokens.
-
Token stringA possible text token.
-
Logprob float64The log probability of this token.
-
-
-
OutputIndex int64The index of the output item that the text delta was added to.
-
SequenceNumber int64The sequence number for this event.
-
Type ResponseOutputTextDeltaThe type of the event. Always
response.output_text.delta.const ResponseOutputTextDeltaResponseOutputTextDelta ResponseOutputTextDelta = "response.output_text.delta"
-
-
type ResponseTextDoneEvent struct{…}Emitted when text content is finalized.
-
ContentIndex int64The index of the content part that the text content is finalized.
-
ItemID stringThe ID of the output item that the text content is finalized.
-
Logprobs []ResponseTextDoneEventLogprobThe log probabilities of the tokens in the delta.
-
Token stringA possible text token.
-
Logprob float64The log probability of this token.
-
TopLogprobs []ResponseTextDoneEventLogprobTopLogprobThe log probabilities of up to 20 of the most likely tokens.
-
Token stringA possible text token.
-
Logprob float64The log probability of this token.
-
-
-
OutputIndex int64The index of the output item that the text content is finalized.
-
SequenceNumber int64The sequence number for this event.
-
Text stringThe text content that is finalized.
-
Type ResponseOutputTextDoneThe type of the event. Always
response.output_text.done.const ResponseOutputTextDoneResponseOutputTextDone ResponseOutputTextDone = "response.output_text.done"
-
-
type ResponseWebSearchCallCompletedEvent struct{…}Emitted when a web search call is completed.
-
ItemID stringUnique ID for the output item associated with the web search call.
-
OutputIndex int64The index of the output item that the web search call is associated with.
-
SequenceNumber int64The sequence number of the web search call being processed.
-
Type ResponseWebSearchCallCompletedThe type of the event. Always
response.web_search_call.completed.const ResponseWebSearchCallCompletedResponseWebSearchCallCompleted ResponseWebSearchCallCompleted = "response.web_search_call.completed"
-
-
type ResponseWebSearchCallInProgressEvent struct{…}Emitted when a web search call is initiated.
-
ItemID stringUnique ID for the output item associated with the web search call.
-
OutputIndex int64The index of the output item that the web search call is associated with.
-
SequenceNumber int64The sequence number of the web search call being processed.
-
Type ResponseWebSearchCallInProgressThe type of the event. Always
response.web_search_call.in_progress.const ResponseWebSearchCallInProgressResponseWebSearchCallInProgress ResponseWebSearchCallInProgress = "response.web_search_call.in_progress"
-
-
type ResponseWebSearchCallSearchingEvent struct{…}Emitted when a web search call is executing.
-
ItemID stringUnique ID for the output item associated with the web search call.
-
OutputIndex int64The index of the output item that the web search call is associated with.
-
SequenceNumber int64The sequence number of the web search call being processed.
-
Type ResponseWebSearchCallSearchingThe type of the event. Always
response.web_search_call.searching.const ResponseWebSearchCallSearchingResponseWebSearchCallSearching ResponseWebSearchCallSearching = "response.web_search_call.searching"
-
-
type ResponseImageGenCallCompletedEvent struct{…}Emitted when an image generation tool call has completed and the final image is available.
-
ItemID stringThe unique identifier of the image generation item being processed.
-
OutputIndex int64The index of the output item in the response's output array.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseImageGenerationCallCompletedThe type of the event. Always 'response.image_generation_call.completed'.
const ResponseImageGenerationCallCompletedResponseImageGenerationCallCompleted ResponseImageGenerationCallCompleted = "response.image_generation_call.completed"
-
-
type ResponseImageGenCallGeneratingEvent struct{…}Emitted when an image generation tool call is actively generating an image (intermediate state).
-
ItemID stringThe unique identifier of the image generation item being processed.
-
OutputIndex int64The index of the output item in the response's output array.
-
SequenceNumber int64The sequence number of the image generation item being processed.
-
Type ResponseImageGenerationCallGeneratingThe type of the event. Always 'response.image_generation_call.generating'.
const ResponseImageGenerationCallGeneratingResponseImageGenerationCallGenerating ResponseImageGenerationCallGenerating = "response.image_generation_call.generating"
-
-
type ResponseImageGenCallInProgressEvent struct{…}Emitted when an image generation tool call is in progress.
-
ItemID stringThe unique identifier of the image generation item being processed.
-
OutputIndex int64The index of the output item in the response's output array.
-
SequenceNumber int64The sequence number of the image generation item being processed.
-
Type ResponseImageGenerationCallInProgressThe type of the event. Always 'response.image_generation_call.in_progress'.
const ResponseImageGenerationCallInProgressResponseImageGenerationCallInProgress ResponseImageGenerationCallInProgress = "response.image_generation_call.in_progress"
-
-
type ResponseImageGenCallPartialImageEvent struct{…}Emitted when a partial image is available during image generation streaming.
-
ItemID stringThe unique identifier of the image generation item being processed.
-
OutputIndex int64The index of the output item in the response's output array.
-
PartialImageB64 stringBase64-encoded partial image data, suitable for rendering as an image.
-
PartialImageIndex int640-based index for the partial image (backend is 1-based, but this is 0-based for the user).
-
SequenceNumber int64The sequence number of the image generation item being processed.
-
Type ResponseImageGenerationCallPartialImageThe type of the event. Always 'response.image_generation_call.partial_image'.
const ResponseImageGenerationCallPartialImageResponseImageGenerationCallPartialImage ResponseImageGenerationCallPartialImage = "response.image_generation_call.partial_image"
-
-
type ResponseMcpCallArgumentsDeltaEvent struct{…}Emitted when there is a delta (partial update) to the arguments of an MCP tool call.
-
Delta stringA JSON string containing the partial update to the arguments for the MCP tool call.
-
ItemID stringThe unique identifier of the MCP tool call item being processed.
-
OutputIndex int64The index of the output item in the response's output array.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseMcpCallArgumentsDeltaThe type of the event. Always 'response.mcp_call_arguments.delta'.
const ResponseMcpCallArgumentsDeltaResponseMcpCallArgumentsDelta ResponseMcpCallArgumentsDelta = "response.mcp_call_arguments.delta"
-
-
type ResponseMcpCallArgumentsDoneEvent struct{…}Emitted when the arguments for an MCP tool call are finalized.
-
Arguments stringA JSON string containing the finalized arguments for the MCP tool call.
-
ItemID stringThe unique identifier of the MCP tool call item being processed.
-
OutputIndex int64The index of the output item in the response's output array.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseMcpCallArgumentsDoneThe type of the event. Always 'response.mcp_call_arguments.done'.
const ResponseMcpCallArgumentsDoneResponseMcpCallArgumentsDone ResponseMcpCallArgumentsDone = "response.mcp_call_arguments.done"
-
-
type ResponseMcpCallCompletedEvent struct{…}Emitted when an MCP tool call has completed successfully.
-
ItemID stringThe ID of the MCP tool call item that completed.
-
OutputIndex int64The index of the output item that completed.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseMcpCallCompletedThe type of the event. Always 'response.mcp_call.completed'.
const ResponseMcpCallCompletedResponseMcpCallCompleted ResponseMcpCallCompleted = "response.mcp_call.completed"
-
-
type ResponseMcpCallFailedEvent struct{…}Emitted when an MCP tool call has failed.
-
ItemID stringThe ID of the MCP tool call item that failed.
-
OutputIndex int64The index of the output item that failed.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseMcpCallFailedThe type of the event. Always 'response.mcp_call.failed'.
const ResponseMcpCallFailedResponseMcpCallFailed ResponseMcpCallFailed = "response.mcp_call.failed"
-
-
type ResponseMcpCallInProgressEvent struct{…}Emitted when an MCP tool call is in progress.
-
ItemID stringThe unique identifier of the MCP tool call item being processed.
-
OutputIndex int64The index of the output item in the response's output array.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseMcpCallInProgressThe type of the event. Always 'response.mcp_call.in_progress'.
const ResponseMcpCallInProgressResponseMcpCallInProgress ResponseMcpCallInProgress = "response.mcp_call.in_progress"
-
-
type ResponseMcpListToolsCompletedEvent struct{…}Emitted when the list of available MCP tools has been successfully retrieved.
-
ItemID stringThe ID of the MCP tool call item that produced this output.
-
OutputIndex int64The index of the output item that was processed.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseMcpListToolsCompletedThe type of the event. Always 'response.mcp_list_tools.completed'.
const ResponseMcpListToolsCompletedResponseMcpListToolsCompleted ResponseMcpListToolsCompleted = "response.mcp_list_tools.completed"
-
-
type ResponseMcpListToolsFailedEvent struct{…}Emitted when the attempt to list available MCP tools has failed.
-
ItemID stringThe ID of the MCP tool call item that failed.
-
OutputIndex int64The index of the output item that failed.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseMcpListToolsFailedThe type of the event. Always 'response.mcp_list_tools.failed'.
const ResponseMcpListToolsFailedResponseMcpListToolsFailed ResponseMcpListToolsFailed = "response.mcp_list_tools.failed"
-
-
type ResponseMcpListToolsInProgressEvent struct{…}Emitted when the system is in the process of retrieving the list of available MCP tools.
-
ItemID stringThe ID of the MCP tool call item that is being processed.
-
OutputIndex int64The index of the output item that is being processed.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseMcpListToolsInProgressThe type of the event. Always 'response.mcp_list_tools.in_progress'.
const ResponseMcpListToolsInProgressResponseMcpListToolsInProgress ResponseMcpListToolsInProgress = "response.mcp_list_tools.in_progress"
-
-
type ResponseOutputTextAnnotationAddedEvent struct{…}Emitted when an annotation is added to output text content.
-
Annotation anyThe annotation object being added. (See annotation schema for details.)
-
AnnotationIndex int64The index of the annotation within the content part.
-
ContentIndex int64The index of the content part within the output item.
-
ItemID stringThe unique identifier of the item to which the annotation is being added.
-
OutputIndex int64The index of the output item in the response's output array.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseOutputTextAnnotationAddedThe type of the event. Always 'response.output_text.annotation.added'.
const ResponseOutputTextAnnotationAddedResponseOutputTextAnnotationAdded ResponseOutputTextAnnotationAdded = "response.output_text.annotation.added"
-
-
type ResponseQueuedEvent struct{…}Emitted when a response is queued and waiting to be processed.
-
Response ResponseThe full response object that is queued.
-
SequenceNumber int64The sequence number for this event.
-
Type ResponseQueuedThe type of the event. Always 'response.queued'.
const ResponseQueuedResponseQueued ResponseQueued = "response.queued"
-
-
type ResponseCustomToolCallInputDeltaEvent struct{…}Event representing a delta (partial update) to the input of a custom tool call.
-
Delta stringThe incremental input data (delta) for the custom tool call.
-
ItemID stringUnique identifier for the API item associated with this event.
-
OutputIndex int64The index of the output this delta applies to.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseCustomToolCallInputDeltaThe event type identifier.
const ResponseCustomToolCallInputDeltaResponseCustomToolCallInputDelta ResponseCustomToolCallInputDelta = "response.custom_tool_call_input.delta"
-
-
type ResponseCustomToolCallInputDoneEvent struct{…}Event indicating that input for a custom tool call is complete.
-
Input stringThe complete input data for the custom tool call.
-
ItemID stringUnique identifier for the API item associated with this event.
-
OutputIndex int64The index of the output this event applies to.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseCustomToolCallInputDoneThe event type identifier.
const ResponseCustomToolCallInputDoneResponseCustomToolCallInputDone ResponseCustomToolCallInputDone = "response.custom_tool_call_input.done"
-
-
Response Text Config
-
type ResponseTextConfig struct{…}Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
Format ResponseFormatTextConfigUnionAn object specifying the format that the model must output.
Configuring
{ "type": "json_schema" }enables Structured Outputs, which ensures the model will match your supplied JSON schema. Learn more in the Structured Outputs guide.The default format is
{ "type": "text" }with no additional options.Not recommended for gpt-4o and newer models:
Setting to
{ "type": "json_object" }enables the older JSON mode, which ensures the message the model generates is valid JSON. Usingjson_schemais preferred for models that support it.-
type ResponseFormatText struct{…}Default response format. Used to generate text responses.
-
Type TextThe type of response format being defined. Always
text.const TextText Text = "text"
-
-
type ResponseFormatTextJSONSchemaConfig struct{…}JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
Name stringThe name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
-
Schema map[string, any]The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
-
Type JSONSchemaThe type of response format being defined. Always
json_schema.const JSONSchemaJSONSchema JSONSchema = "json_schema"
-
Description stringA description of what the response format is for, used by the model to determine how to respond in the format.
-
Strict boolWhether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the
schemafield. Only a subset of JSON Schema is supported whenstrictistrue. To learn more, read the Structured Outputs guide.
-
-
type ResponseFormatJSONObject struct{…}JSON object response format. An older method of generating JSON responses. Using
json_schemais 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 JSONObjectThe type of response format being defined. Always
json_object.const JSONObjectJSONObject JSONObject = "json_object"
-
-
-
Verbosity ResponseTextConfigVerbosityConstrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses. Currently supported values are
low,medium, andhigh.-
const ResponseTextConfigVerbosityLow ResponseTextConfigVerbosity = "low" -
const ResponseTextConfigVerbosityMedium ResponseTextConfigVerbosity = "medium" -
const ResponseTextConfigVerbosityHigh ResponseTextConfigVerbosity = "high"
-
Response Text Delta Event
-
type ResponseTextDeltaEvent struct{…}Emitted when there is an additional text delta.
-
ContentIndex int64The index of the content part that the text delta was added to.
-
Delta stringThe text delta that was added.
-
ItemID stringThe ID of the output item that the text delta was added to.
-
Logprobs []ResponseTextDeltaEventLogprobThe log probabilities of the tokens in the delta.
-
Token stringA possible text token.
-
Logprob float64The log probability of this token.
-
TopLogprobs []ResponseTextDeltaEventLogprobTopLogprobThe log probabilities of up to 20 of the most likely tokens.
-
Token stringA possible text token.
-
Logprob float64The log probability of this token.
-
-
-
OutputIndex int64The index of the output item that the text delta was added to.
-
SequenceNumber int64The sequence number for this event.
-
Type ResponseOutputTextDeltaThe type of the event. Always
response.output_text.delta.const ResponseOutputTextDeltaResponseOutputTextDelta ResponseOutputTextDelta = "response.output_text.delta"
-
Response Text Done Event
-
type ResponseTextDoneEvent struct{…}Emitted when text content is finalized.
-
ContentIndex int64The index of the content part that the text content is finalized.
-
ItemID stringThe ID of the output item that the text content is finalized.
-
Logprobs []ResponseTextDoneEventLogprobThe log probabilities of the tokens in the delta.
-
Token stringA possible text token.
-
Logprob float64The log probability of this token.
-
TopLogprobs []ResponseTextDoneEventLogprobTopLogprobThe log probabilities of up to 20 of the most likely tokens.
-
Token stringA possible text token.
-
Logprob float64The log probability of this token.
-
-
-
OutputIndex int64The index of the output item that the text content is finalized.
-
SequenceNumber int64The sequence number for this event.
-
Text stringThe text content that is finalized.
-
Type ResponseOutputTextDoneThe type of the event. Always
response.output_text.done.const ResponseOutputTextDoneResponseOutputTextDone ResponseOutputTextDone = "response.output_text.done"
-
Response Tool Search Call
-
type ResponseToolSearchCall struct{…}-
ID stringThe unique ID of the tool search call item.
-
Arguments anyArguments used for the tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchCallExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchCallExecutionServer ResponseToolSearchCallExecution = "server" -
const ResponseToolSearchCallExecutionClient ResponseToolSearchCallExecution = "client"
-
-
Status ResponseToolSearchCallStatusThe status of the tool search call item that was recorded.
-
const ResponseToolSearchCallStatusInProgress ResponseToolSearchCallStatus = "in_progress" -
const ResponseToolSearchCallStatusCompleted ResponseToolSearchCallStatus = "completed" -
const ResponseToolSearchCallStatusIncomplete ResponseToolSearchCallStatus = "incomplete"
-
-
Type ToolSearchCallThe type of the item. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
CreatedBy stringThe identifier of the actor that created the item.
-
Response Tool Search Output Item
-
type ResponseToolSearchOutputItem struct{…}-
ID stringThe unique ID of the tool search output item.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemExecutionServer ResponseToolSearchOutputItemExecution = "server" -
const ResponseToolSearchOutputItemExecutionClient ResponseToolSearchOutputItemExecution = "client"
-
-
Status ResponseToolSearchOutputItemStatusThe status of the tool search output item that was recorded.
-
const ResponseToolSearchOutputItemStatusInProgress ResponseToolSearchOutputItemStatus = "in_progress" -
const ResponseToolSearchOutputItemStatusCompleted ResponseToolSearchOutputItemStatus = "completed" -
const ResponseToolSearchOutputItemStatusIncomplete ResponseToolSearchOutputItemStatus = "incomplete"
-
-
Tools []ToolUnionThe loaded tool definitions returned by tool search.
-
type FunctionTool struct{…}Defines a function in your own code the model can choose to call. Learn more about function calling.
-
Name stringThe name of the function to call.
-
Parameters map[string, any]A JSON schema object describing the parameters of the function.
-
Strict boolWhether to enforce strict parameter validation. Default
true. -
Type FunctionThe type of the function tool. Always
function.const FunctionFunction Function = "function"
-
DeferLoading boolWhether this function is deferred and loaded via tool search.
-
Description stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
type FileSearchTool struct{…}A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
Type FileSearchThe type of the file search tool. Always
file_search.const FileSearchFileSearch FileSearch = "file_search"
-
VectorStoreIDs []stringThe IDs of the vector stores to search.
-
Filters FileSearchToolFiltersUnionA filter to apply.
-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
Key stringThe key to compare against the value.
-
Type ComparisonFilterTypeSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
const ComparisonFilterTypeEq ComparisonFilterType = "eq" -
const ComparisonFilterTypeNe ComparisonFilterType = "ne" -
const ComparisonFilterTypeGt ComparisonFilterType = "gt" -
const ComparisonFilterTypeGte ComparisonFilterType = "gte" -
const ComparisonFilterTypeLt ComparisonFilterType = "lt" -
const ComparisonFilterTypeLte ComparisonFilterType = "lte" -
const ComparisonFilterTypeIn ComparisonFilterType = "in" -
const ComparisonFilterTypeNin ComparisonFilterType = "nin"
-
-
Value ComparisonFilterValueUnionThe value to compare against the attribute key; supports string, number, or boolean types.
-
string -
float64 -
bool -
type ComparisonFilterValueArray []ComparisonFilterValueArrayItemUnion-
string -
float64
-
-
-
-
type CompoundFilter struct{…}Combine multiple filters using
andoror.-
Filters []ComparisonFilterArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
-
Type CompoundFilterTypeType of operation:
andoror.-
const CompoundFilterTypeAnd CompoundFilterType = "and" -
const CompoundFilterTypeOr CompoundFilterType = "or"
-
-
-
-
MaxNumResults int64The maximum number of results to return. This number should be between 1 and 50 inclusive.
-
RankingOptions FileSearchToolRankingOptionsRanking options for search.
-
HybridSearch FileSearchToolRankingOptionsHybridSearchWeights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
EmbeddingWeight float64The weight of the embedding in the reciprocal ranking fusion.
-
TextWeight float64The weight of the text in the reciprocal ranking fusion.
-
-
Ranker stringThe ranker to use for the file search.
-
const FileSearchToolRankingOptionsRankerAuto FileSearchToolRankingOptionsRanker = "auto" -
const FileSearchToolRankingOptionsRankerDefault2024_11_15 FileSearchToolRankingOptionsRanker = "default-2024-11-15"
-
-
ScoreThreshold float64The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
Type ComputerThe type of the computer tool. Always
computer.const ComputerComputer Computer = "computer"
-
-
type ComputerUsePreviewTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
DisplayHeight int64The height of the computer display.
-
DisplayWidth int64The width of the computer display.
-
Environment ComputerUsePreviewToolEnvironmentThe type of computer environment to control.
-
const ComputerUsePreviewToolEnvironmentWindows ComputerUsePreviewToolEnvironment = "windows" -
const ComputerUsePreviewToolEnvironmentMac ComputerUsePreviewToolEnvironment = "mac" -
const ComputerUsePreviewToolEnvironmentLinux ComputerUsePreviewToolEnvironment = "linux" -
const ComputerUsePreviewToolEnvironmentUbuntu ComputerUsePreviewToolEnvironment = "ubuntu" -
const ComputerUsePreviewToolEnvironmentBrowser ComputerUsePreviewToolEnvironment = "browser"
-
-
Type ComputerUsePreviewThe type of the computer use tool. Always
computer_use_preview.const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"
-
-
type WebSearchTool struct{…}Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
Type WebSearchToolTypeThe type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
const WebSearchToolTypeWebSearch WebSearchToolType = "web_search" -
const WebSearchToolTypeWebSearch2025_08_26 WebSearchToolType = "web_search_2025_08_26"
-
-
Filters WebSearchToolFiltersFilters for the search.
-
AllowedDomains []stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
SearchContextSize WebSearchToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchToolSearchContextSizeLow WebSearchToolSearchContextSize = "low" -
const WebSearchToolSearchContextSizeMedium WebSearchToolSearchContextSize = "medium" -
const WebSearchToolSearchContextSizeHigh WebSearchToolSearchContextSize = "high"
-
-
UserLocation WebSearchToolUserLocationThe approximate location of the user.
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
Type stringThe type of location approximation. Always
approximate.const WebSearchToolUserLocationTypeApproximate WebSearchToolUserLocationType = "approximate"
-
-
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
ServerLabel stringA label for this MCP server, used to identify it in tool calls.
-
Type McpThe type of the MCP tool. Always
mcp.const McpMcp Mcp = "mcp"
-
AllowedTools ToolMcpAllowedToolsUnionList of allowed tool names or a filter object.
-
type ToolMcpAllowedToolsMcpAllowedTools []stringA string array of allowed tool names
-
type ToolMcpAllowedToolsMcpToolFilter struct{…}A filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
Authorization stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
ConnectorID stringIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
const ToolMcpConnectorIDConnectorDropbox ToolMcpConnectorID = "connector_dropbox" -
const ToolMcpConnectorIDConnectorGmail ToolMcpConnectorID = "connector_gmail" -
const ToolMcpConnectorIDConnectorGooglecalendar ToolMcpConnectorID = "connector_googlecalendar" -
const ToolMcpConnectorIDConnectorGoogledrive ToolMcpConnectorID = "connector_googledrive" -
const ToolMcpConnectorIDConnectorMicrosoftteams ToolMcpConnectorID = "connector_microsoftteams" -
const ToolMcpConnectorIDConnectorOutlookcalendar ToolMcpConnectorID = "connector_outlookcalendar" -
const ToolMcpConnectorIDConnectorOutlookemail ToolMcpConnectorID = "connector_outlookemail" -
const ToolMcpConnectorIDConnectorSharepoint ToolMcpConnectorID = "connector_sharepoint"
-
-
DeferLoading boolWhether this MCP tool is deferred and discovered via tool search.
-
Headers map[string, string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
RequireApproval ToolMcpRequireApprovalUnionSpecify which of the MCP server's tools require approval.
-
type ToolMcpRequireApprovalMcpToolApprovalFilter 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.-
Always ToolMcpRequireApprovalMcpToolApprovalFilterAlwaysA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
Never ToolMcpRequireApprovalMcpToolApprovalFilterNeverA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
type ToolMcpRequireApprovalMcpToolApprovalSetting stringSpecify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
const ToolMcpRequireApprovalMcpToolApprovalSettingAlways ToolMcpRequireApprovalMcpToolApprovalSetting = "always" -
const ToolMcpRequireApprovalMcpToolApprovalSettingNever ToolMcpRequireApprovalMcpToolApprovalSetting = "never"
-
-
-
ServerDescription stringOptional description of the MCP server, used to provide more context.
-
ServerURL stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
TunnelID stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
Container ToolCodeInterpreterContainerUnionThe code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
string -
type ToolCodeInterpreterContainerCodeInterpreterContainerAuto struct{…}Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
Type AutoAlways
auto.const AutoAuto Auto = "auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit stringThe memory limit for the code interpreter container.
-
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"
-
-
NetworkPolicy ToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…}-
Type DisabledDisable outbound network access. Always
disabled.const DisabledDisabled Disabled = "disabled"
-
-
type ContainerNetworkPolicyAllowlist struct{…}-
AllowedDomains []stringA list of allowed domains when type is
allowlist. -
Type AllowlistAllow outbound network access only to specified domains. Always
allowlist.const AllowlistAllowlist Allowlist = "allowlist"
-
DomainSecrets []ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
Domain stringThe domain associated with the secret.
-
Name stringThe name of the secret to inject for the domain.
-
Value stringThe secret value to inject for the domain.
-
-
-
-
-
-
Type CodeInterpreterThe type of the code interpreter tool. Always
code_interpreter.const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"
-
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
Type ImageGenerationThe type of the image generation tool. Always
image_generation.const ImageGenerationImageGeneration ImageGeneration = "image_generation"
-
Action stringWhether to generate a new image or edit an existing image. Default:
auto.-
const ToolImageGenerationActionGenerate ToolImageGenerationAction = "generate" -
const ToolImageGenerationActionEdit ToolImageGenerationAction = "edit" -
const ToolImageGenerationActionAuto ToolImageGenerationAction = "auto"
-
-
Background stringAllows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
const ToolImageGenerationBackgroundTransparent ToolImageGenerationBackground = "transparent" -
const ToolImageGenerationBackgroundOpaque ToolImageGenerationBackground = "opaque" -
const ToolImageGenerationBackgroundAuto ToolImageGenerationBackground = "auto"
-
-
InputFidelity stringControl how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
const ToolImageGenerationInputFidelityHigh ToolImageGenerationInputFidelity = "high" -
const ToolImageGenerationInputFidelityLow ToolImageGenerationInputFidelity = "low"
-
-
InputImageMask ToolImageGenerationInputImageMaskOptional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
FileID stringFile ID for the mask image.
-
ImageURL stringBase64-encoded mask image.
-
-
Model stringThe image generation model to use. Default:
gpt-image-1.-
string -
string-
const ToolImageGenerationModelGPTImage1 ToolImageGenerationModel = "gpt-image-1" -
const ToolImageGenerationModelGPTImage1Mini ToolImageGenerationModel = "gpt-image-1-mini" -
const ToolImageGenerationModelGPTImage2 ToolImageGenerationModel = "gpt-image-2" -
const ToolImageGenerationModelGPTImage2_2026_04_21 ToolImageGenerationModel = "gpt-image-2-2026-04-21" -
const ToolImageGenerationModelGPTImage1_5 ToolImageGenerationModel = "gpt-image-1.5" -
const ToolImageGenerationModelChatgptImageLatest ToolImageGenerationModel = "chatgpt-image-latest"
-
-
-
Moderation stringModeration level for the generated image. Default:
auto.-
const ToolImageGenerationModerationAuto ToolImageGenerationModeration = "auto" -
const ToolImageGenerationModerationLow ToolImageGenerationModeration = "low"
-
-
OutputCompression int64Compression level for the output image. Default: 100.
-
OutputFormat stringThe output format of the generated image. One of
png,webp, orjpeg. Default:png.-
const ToolImageGenerationOutputFormatPNG ToolImageGenerationOutputFormat = "png" -
const ToolImageGenerationOutputFormatWebP ToolImageGenerationOutputFormat = "webp" -
const ToolImageGenerationOutputFormatJPEG ToolImageGenerationOutputFormat = "jpeg"
-
-
PartialImages int64Number of partial images to generate in streaming mode, from 0 (default value) to 3.
-
Quality stringThe quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
const ToolImageGenerationQualityLow ToolImageGenerationQuality = "low" -
const ToolImageGenerationQualityMedium ToolImageGenerationQuality = "medium" -
const ToolImageGenerationQualityHigh ToolImageGenerationQuality = "high" -
const ToolImageGenerationQualityAuto ToolImageGenerationQuality = "auto"
-
-
Size stringThe size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
string -
string-
const ToolImageGenerationSize1024x1024 ToolImageGenerationSize = "1024x1024" -
const ToolImageGenerationSize1024x1536 ToolImageGenerationSize = "1024x1536" -
const ToolImageGenerationSize1536x1024 ToolImageGenerationSize = "1536x1024" -
const ToolImageGenerationSizeAuto ToolImageGenerationSize = "auto"
-
-
-
-
type ToolLocalShell struct{…}A tool that allows the model to execute shell commands in a local environment.
-
Type LocalShellThe type of the local shell tool. Always
local_shell.const LocalShellLocalShell LocalShell = "local_shell"
-
-
type FunctionShellTool struct{…}A tool that allows the model to execute shell commands.
-
Type ShellThe type of the shell tool. Always
shell.const ShellShell Shell = "shell"
-
Environment FunctionShellToolEnvironmentUnion-
type ContainerAuto struct{…}-
Type ContainerAutoAutomatically creates a container for this request
const ContainerAutoContainerAuto ContainerAuto = "container_auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit ContainerAutoMemoryLimitThe memory limit for the container.
-
const ContainerAutoMemoryLimit1g ContainerAutoMemoryLimit = "1g" -
const ContainerAutoMemoryLimit4g ContainerAutoMemoryLimit = "4g" -
const ContainerAutoMemoryLimit16g ContainerAutoMemoryLimit = "16g" -
const ContainerAutoMemoryLimit64g ContainerAutoMemoryLimit = "64g"
-
-
NetworkPolicy ContainerAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…} -
type ContainerNetworkPolicyAllowlist struct{…}
-
-
Skills []ContainerAutoSkillUnionAn optional list of skills referenced by id or inline data.
-
type SkillReference struct{…}-
SkillID stringThe ID of the referenced skill.
-
Type SkillReferenceReferences a skill created with the /v1/skills endpoint.
const SkillReferenceSkillReference SkillReference = "skill_reference"
-
Version stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
type InlineSkill struct{…}-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Source InlineSkillSourceInline skill payload
-
Data stringBase64-encoded skill zip bundle.
-
MediaType ApplicationZipThe media type of the inline skill payload. Must be
application/zip.const ApplicationZipApplicationZip ApplicationZip = "application/zip"
-
Type Base64The type of the inline skill source. Must be
base64.const Base64Base64 Base64 = "base64"
-
-
Type InlineDefines an inline skill for this request.
const InlineInline Inline = "inline"
-
-
-
-
type LocalEnvironment struct{…}-
Type LocalUse a local computer environment.
const LocalLocal Local = "local"
-
Skills []LocalSkillAn optional list of skills.
-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Path stringThe path to the directory containing the skill.
-
-
-
type ContainerReference struct{…}-
ContainerID stringThe ID of the referenced container.
-
Type ContainerReferenceReferences a container created with the /v1/containers endpoint
const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
Name stringThe name of the custom tool, used to identify it in tool calls.
-
Type CustomThe type of the custom tool. Always
custom.const CustomCustom Custom = "custom"
-
DeferLoading boolWhether this tool should be deferred and discovered via tool search.
-
Description stringOptional description of the custom tool, used to provide more context.
-
Format CustomToolInputFormatUnionThe input format for the custom tool. Default is unconstrained text.
-
type CustomToolInputFormatText struct{…}Unconstrained free-form text.
-
Type TextUnconstrained text format. Always
text.const TextText Text = "text"
-
-
type CustomToolInputFormatGrammar struct{…}A grammar defined by the user.
-
Definition stringThe grammar definition.
-
Syntax stringThe syntax of the grammar definition. One of
larkorregex.-
const CustomToolInputFormatGrammarSyntaxLark CustomToolInputFormatGrammarSyntax = "lark" -
const CustomToolInputFormatGrammarSyntaxRegex CustomToolInputFormatGrammarSyntax = "regex"
-
-
Type GrammarGrammar format. Always
grammar.const GrammarGrammar Grammar = "grammar"
-
-
-
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
Description stringA description of the namespace shown to the model.
-
Name stringThe namespace name used in tool calls (for example,
crm). -
Tools []NamespaceToolToolUnionThe function/custom tools available inside this namespace.
-
type NamespaceToolToolFunction struct{…}-
Name string -
Type Functionconst FunctionFunction Function = "function"
-
DeferLoading boolWhether this function should be deferred and discovered via tool search.
-
Description string -
Parameters any -
Strict bool
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
-
Type NamespaceThe type of the tool. Always
namespace.const NamespaceNamespace Namespace = "namespace"
-
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
Type ToolSearchThe type of the tool. Always
tool_search.const ToolSearchToolSearch ToolSearch = "tool_search"
-
Description stringDescription shown to the model for a client-executed tool search tool.
-
Execution ToolSearchToolExecutionWhether tool search is executed by the server or by the client.
-
const ToolSearchToolExecutionServer ToolSearchToolExecution = "server" -
const ToolSearchToolExecutionClient ToolSearchToolExecution = "client"
-
-
Parameters anyParameter schema for a client-executed tool search tool.
-
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
Type WebSearchPreviewToolTypeThe type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
const WebSearchPreviewToolTypeWebSearchPreview WebSearchPreviewToolType = "web_search_preview" -
const WebSearchPreviewToolTypeWebSearchPreview2025_03_11 WebSearchPreviewToolType = "web_search_preview_2025_03_11"
-
-
SearchContentTypes []string-
const WebSearchPreviewToolSearchContentTypeText WebSearchPreviewToolSearchContentType = "text" -
const WebSearchPreviewToolSearchContentTypeImage WebSearchPreviewToolSearchContentType = "image"
-
-
SearchContextSize WebSearchPreviewToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchPreviewToolSearchContextSizeLow WebSearchPreviewToolSearchContextSize = "low" -
const WebSearchPreviewToolSearchContextSizeMedium WebSearchPreviewToolSearchContextSize = "medium" -
const WebSearchPreviewToolSearchContextSizeHigh WebSearchPreviewToolSearchContextSize = "high"
-
-
UserLocation WebSearchPreviewToolUserLocationThe user's location.
-
Type ApproximateThe type of location approximation. Always
approximate.const ApproximateApproximate Approximate = "approximate"
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
Type ApplyPatchThe type of the tool. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
-
Type ToolSearchOutputThe type of the item. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
Response Tool Search Output Item Param
-
type ResponseToolSearchOutputItemParamResp struct{…}-
Tools []ToolUnionThe loaded tool definitions returned by the tool search output.
-
type FunctionTool struct{…}Defines a function in your own code the model can choose to call. Learn more about function calling.
-
Name stringThe name of the function to call.
-
Parameters map[string, any]A JSON schema object describing the parameters of the function.
-
Strict boolWhether to enforce strict parameter validation. Default
true. -
Type FunctionThe type of the function tool. Always
function.const FunctionFunction Function = "function"
-
DeferLoading boolWhether this function is deferred and loaded via tool search.
-
Description stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
type FileSearchTool struct{…}A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
Type FileSearchThe type of the file search tool. Always
file_search.const FileSearchFileSearch FileSearch = "file_search"
-
VectorStoreIDs []stringThe IDs of the vector stores to search.
-
Filters FileSearchToolFiltersUnionA filter to apply.
-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
Key stringThe key to compare against the value.
-
Type ComparisonFilterTypeSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
const ComparisonFilterTypeEq ComparisonFilterType = "eq" -
const ComparisonFilterTypeNe ComparisonFilterType = "ne" -
const ComparisonFilterTypeGt ComparisonFilterType = "gt" -
const ComparisonFilterTypeGte ComparisonFilterType = "gte" -
const ComparisonFilterTypeLt ComparisonFilterType = "lt" -
const ComparisonFilterTypeLte ComparisonFilterType = "lte" -
const ComparisonFilterTypeIn ComparisonFilterType = "in" -
const ComparisonFilterTypeNin ComparisonFilterType = "nin"
-
-
Value ComparisonFilterValueUnionThe value to compare against the attribute key; supports string, number, or boolean types.
-
string -
float64 -
bool -
type ComparisonFilterValueArray []ComparisonFilterValueArrayItemUnion-
string -
float64
-
-
-
-
type CompoundFilter struct{…}Combine multiple filters using
andoror.-
Filters []ComparisonFilterArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
-
Type CompoundFilterTypeType of operation:
andoror.-
const CompoundFilterTypeAnd CompoundFilterType = "and" -
const CompoundFilterTypeOr CompoundFilterType = "or"
-
-
-
-
MaxNumResults int64The maximum number of results to return. This number should be between 1 and 50 inclusive.
-
RankingOptions FileSearchToolRankingOptionsRanking options for search.
-
HybridSearch FileSearchToolRankingOptionsHybridSearchWeights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
EmbeddingWeight float64The weight of the embedding in the reciprocal ranking fusion.
-
TextWeight float64The weight of the text in the reciprocal ranking fusion.
-
-
Ranker stringThe ranker to use for the file search.
-
const FileSearchToolRankingOptionsRankerAuto FileSearchToolRankingOptionsRanker = "auto" -
const FileSearchToolRankingOptionsRankerDefault2024_11_15 FileSearchToolRankingOptionsRanker = "default-2024-11-15"
-
-
ScoreThreshold float64The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
Type ComputerThe type of the computer tool. Always
computer.const ComputerComputer Computer = "computer"
-
-
type ComputerUsePreviewTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
DisplayHeight int64The height of the computer display.
-
DisplayWidth int64The width of the computer display.
-
Environment ComputerUsePreviewToolEnvironmentThe type of computer environment to control.
-
const ComputerUsePreviewToolEnvironmentWindows ComputerUsePreviewToolEnvironment = "windows" -
const ComputerUsePreviewToolEnvironmentMac ComputerUsePreviewToolEnvironment = "mac" -
const ComputerUsePreviewToolEnvironmentLinux ComputerUsePreviewToolEnvironment = "linux" -
const ComputerUsePreviewToolEnvironmentUbuntu ComputerUsePreviewToolEnvironment = "ubuntu" -
const ComputerUsePreviewToolEnvironmentBrowser ComputerUsePreviewToolEnvironment = "browser"
-
-
Type ComputerUsePreviewThe type of the computer use tool. Always
computer_use_preview.const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"
-
-
type WebSearchTool struct{…}Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
Type WebSearchToolTypeThe type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
const WebSearchToolTypeWebSearch WebSearchToolType = "web_search" -
const WebSearchToolTypeWebSearch2025_08_26 WebSearchToolType = "web_search_2025_08_26"
-
-
Filters WebSearchToolFiltersFilters for the search.
-
AllowedDomains []stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
SearchContextSize WebSearchToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchToolSearchContextSizeLow WebSearchToolSearchContextSize = "low" -
const WebSearchToolSearchContextSizeMedium WebSearchToolSearchContextSize = "medium" -
const WebSearchToolSearchContextSizeHigh WebSearchToolSearchContextSize = "high"
-
-
UserLocation WebSearchToolUserLocationThe approximate location of the user.
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
Type stringThe type of location approximation. Always
approximate.const WebSearchToolUserLocationTypeApproximate WebSearchToolUserLocationType = "approximate"
-
-
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
ServerLabel stringA label for this MCP server, used to identify it in tool calls.
-
Type McpThe type of the MCP tool. Always
mcp.const McpMcp Mcp = "mcp"
-
AllowedTools ToolMcpAllowedToolsUnionList of allowed tool names or a filter object.
-
type ToolMcpAllowedToolsMcpAllowedTools []stringA string array of allowed tool names
-
type ToolMcpAllowedToolsMcpToolFilter struct{…}A filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
Authorization stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
ConnectorID stringIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
const ToolMcpConnectorIDConnectorDropbox ToolMcpConnectorID = "connector_dropbox" -
const ToolMcpConnectorIDConnectorGmail ToolMcpConnectorID = "connector_gmail" -
const ToolMcpConnectorIDConnectorGooglecalendar ToolMcpConnectorID = "connector_googlecalendar" -
const ToolMcpConnectorIDConnectorGoogledrive ToolMcpConnectorID = "connector_googledrive" -
const ToolMcpConnectorIDConnectorMicrosoftteams ToolMcpConnectorID = "connector_microsoftteams" -
const ToolMcpConnectorIDConnectorOutlookcalendar ToolMcpConnectorID = "connector_outlookcalendar" -
const ToolMcpConnectorIDConnectorOutlookemail ToolMcpConnectorID = "connector_outlookemail" -
const ToolMcpConnectorIDConnectorSharepoint ToolMcpConnectorID = "connector_sharepoint"
-
-
DeferLoading boolWhether this MCP tool is deferred and discovered via tool search.
-
Headers map[string, string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
RequireApproval ToolMcpRequireApprovalUnionSpecify which of the MCP server's tools require approval.
-
type ToolMcpRequireApprovalMcpToolApprovalFilter 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.-
Always ToolMcpRequireApprovalMcpToolApprovalFilterAlwaysA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
Never ToolMcpRequireApprovalMcpToolApprovalFilterNeverA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
type ToolMcpRequireApprovalMcpToolApprovalSetting stringSpecify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
const ToolMcpRequireApprovalMcpToolApprovalSettingAlways ToolMcpRequireApprovalMcpToolApprovalSetting = "always" -
const ToolMcpRequireApprovalMcpToolApprovalSettingNever ToolMcpRequireApprovalMcpToolApprovalSetting = "never"
-
-
-
ServerDescription stringOptional description of the MCP server, used to provide more context.
-
ServerURL stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
TunnelID stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
Container ToolCodeInterpreterContainerUnionThe code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
string -
type ToolCodeInterpreterContainerCodeInterpreterContainerAuto struct{…}Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
Type AutoAlways
auto.const AutoAuto Auto = "auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit stringThe memory limit for the code interpreter container.
-
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"
-
-
NetworkPolicy ToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…}-
Type DisabledDisable outbound network access. Always
disabled.const DisabledDisabled Disabled = "disabled"
-
-
type ContainerNetworkPolicyAllowlist struct{…}-
AllowedDomains []stringA list of allowed domains when type is
allowlist. -
Type AllowlistAllow outbound network access only to specified domains. Always
allowlist.const AllowlistAllowlist Allowlist = "allowlist"
-
DomainSecrets []ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
Domain stringThe domain associated with the secret.
-
Name stringThe name of the secret to inject for the domain.
-
Value stringThe secret value to inject for the domain.
-
-
-
-
-
-
Type CodeInterpreterThe type of the code interpreter tool. Always
code_interpreter.const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"
-
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
Type ImageGenerationThe type of the image generation tool. Always
image_generation.const ImageGenerationImageGeneration ImageGeneration = "image_generation"
-
Action stringWhether to generate a new image or edit an existing image. Default:
auto.-
const ToolImageGenerationActionGenerate ToolImageGenerationAction = "generate" -
const ToolImageGenerationActionEdit ToolImageGenerationAction = "edit" -
const ToolImageGenerationActionAuto ToolImageGenerationAction = "auto"
-
-
Background stringAllows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
const ToolImageGenerationBackgroundTransparent ToolImageGenerationBackground = "transparent" -
const ToolImageGenerationBackgroundOpaque ToolImageGenerationBackground = "opaque" -
const ToolImageGenerationBackgroundAuto ToolImageGenerationBackground = "auto"
-
-
InputFidelity stringControl how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
const ToolImageGenerationInputFidelityHigh ToolImageGenerationInputFidelity = "high" -
const ToolImageGenerationInputFidelityLow ToolImageGenerationInputFidelity = "low"
-
-
InputImageMask ToolImageGenerationInputImageMaskOptional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
FileID stringFile ID for the mask image.
-
ImageURL stringBase64-encoded mask image.
-
-
Model stringThe image generation model to use. Default:
gpt-image-1.-
string -
string-
const ToolImageGenerationModelGPTImage1 ToolImageGenerationModel = "gpt-image-1" -
const ToolImageGenerationModelGPTImage1Mini ToolImageGenerationModel = "gpt-image-1-mini" -
const ToolImageGenerationModelGPTImage2 ToolImageGenerationModel = "gpt-image-2" -
const ToolImageGenerationModelGPTImage2_2026_04_21 ToolImageGenerationModel = "gpt-image-2-2026-04-21" -
const ToolImageGenerationModelGPTImage1_5 ToolImageGenerationModel = "gpt-image-1.5" -
const ToolImageGenerationModelChatgptImageLatest ToolImageGenerationModel = "chatgpt-image-latest"
-
-
-
Moderation stringModeration level for the generated image. Default:
auto.-
const ToolImageGenerationModerationAuto ToolImageGenerationModeration = "auto" -
const ToolImageGenerationModerationLow ToolImageGenerationModeration = "low"
-
-
OutputCompression int64Compression level for the output image. Default: 100.
-
OutputFormat stringThe output format of the generated image. One of
png,webp, orjpeg. Default:png.-
const ToolImageGenerationOutputFormatPNG ToolImageGenerationOutputFormat = "png" -
const ToolImageGenerationOutputFormatWebP ToolImageGenerationOutputFormat = "webp" -
const ToolImageGenerationOutputFormatJPEG ToolImageGenerationOutputFormat = "jpeg"
-
-
PartialImages int64Number of partial images to generate in streaming mode, from 0 (default value) to 3.
-
Quality stringThe quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
const ToolImageGenerationQualityLow ToolImageGenerationQuality = "low" -
const ToolImageGenerationQualityMedium ToolImageGenerationQuality = "medium" -
const ToolImageGenerationQualityHigh ToolImageGenerationQuality = "high" -
const ToolImageGenerationQualityAuto ToolImageGenerationQuality = "auto"
-
-
Size stringThe size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
string -
string-
const ToolImageGenerationSize1024x1024 ToolImageGenerationSize = "1024x1024" -
const ToolImageGenerationSize1024x1536 ToolImageGenerationSize = "1024x1536" -
const ToolImageGenerationSize1536x1024 ToolImageGenerationSize = "1536x1024" -
const ToolImageGenerationSizeAuto ToolImageGenerationSize = "auto"
-
-
-
-
type ToolLocalShell struct{…}A tool that allows the model to execute shell commands in a local environment.
-
Type LocalShellThe type of the local shell tool. Always
local_shell.const LocalShellLocalShell LocalShell = "local_shell"
-
-
type FunctionShellTool struct{…}A tool that allows the model to execute shell commands.
-
Type ShellThe type of the shell tool. Always
shell.const ShellShell Shell = "shell"
-
Environment FunctionShellToolEnvironmentUnion-
type ContainerAuto struct{…}-
Type ContainerAutoAutomatically creates a container for this request
const ContainerAutoContainerAuto ContainerAuto = "container_auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit ContainerAutoMemoryLimitThe memory limit for the container.
-
const ContainerAutoMemoryLimit1g ContainerAutoMemoryLimit = "1g" -
const ContainerAutoMemoryLimit4g ContainerAutoMemoryLimit = "4g" -
const ContainerAutoMemoryLimit16g ContainerAutoMemoryLimit = "16g" -
const ContainerAutoMemoryLimit64g ContainerAutoMemoryLimit = "64g"
-
-
NetworkPolicy ContainerAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…} -
type ContainerNetworkPolicyAllowlist struct{…}
-
-
Skills []ContainerAutoSkillUnionAn optional list of skills referenced by id or inline data.
-
type SkillReference struct{…}-
SkillID stringThe ID of the referenced skill.
-
Type SkillReferenceReferences a skill created with the /v1/skills endpoint.
const SkillReferenceSkillReference SkillReference = "skill_reference"
-
Version stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
type InlineSkill struct{…}-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Source InlineSkillSourceInline skill payload
-
Data stringBase64-encoded skill zip bundle.
-
MediaType ApplicationZipThe media type of the inline skill payload. Must be
application/zip.const ApplicationZipApplicationZip ApplicationZip = "application/zip"
-
Type Base64The type of the inline skill source. Must be
base64.const Base64Base64 Base64 = "base64"
-
-
Type InlineDefines an inline skill for this request.
const InlineInline Inline = "inline"
-
-
-
-
type LocalEnvironment struct{…}-
Type LocalUse a local computer environment.
const LocalLocal Local = "local"
-
Skills []LocalSkillAn optional list of skills.
-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Path stringThe path to the directory containing the skill.
-
-
-
type ContainerReference struct{…}-
ContainerID stringThe ID of the referenced container.
-
Type ContainerReferenceReferences a container created with the /v1/containers endpoint
const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
Name stringThe name of the custom tool, used to identify it in tool calls.
-
Type CustomThe type of the custom tool. Always
custom.const CustomCustom Custom = "custom"
-
DeferLoading boolWhether this tool should be deferred and discovered via tool search.
-
Description stringOptional description of the custom tool, used to provide more context.
-
Format CustomToolInputFormatUnionThe input format for the custom tool. Default is unconstrained text.
-
type CustomToolInputFormatText struct{…}Unconstrained free-form text.
-
Type TextUnconstrained text format. Always
text.const TextText Text = "text"
-
-
type CustomToolInputFormatGrammar struct{…}A grammar defined by the user.
-
Definition stringThe grammar definition.
-
Syntax stringThe syntax of the grammar definition. One of
larkorregex.-
const CustomToolInputFormatGrammarSyntaxLark CustomToolInputFormatGrammarSyntax = "lark" -
const CustomToolInputFormatGrammarSyntaxRegex CustomToolInputFormatGrammarSyntax = "regex"
-
-
Type GrammarGrammar format. Always
grammar.const GrammarGrammar Grammar = "grammar"
-
-
-
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
Description stringA description of the namespace shown to the model.
-
Name stringThe namespace name used in tool calls (for example,
crm). -
Tools []NamespaceToolToolUnionThe function/custom tools available inside this namespace.
-
type NamespaceToolToolFunction struct{…}-
Name string -
Type Functionconst FunctionFunction Function = "function"
-
DeferLoading boolWhether this function should be deferred and discovered via tool search.
-
Description string -
Parameters any -
Strict bool
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
-
Type NamespaceThe type of the tool. Always
namespace.const NamespaceNamespace Namespace = "namespace"
-
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
Type ToolSearchThe type of the tool. Always
tool_search.const ToolSearchToolSearch ToolSearch = "tool_search"
-
Description stringDescription shown to the model for a client-executed tool search tool.
-
Execution ToolSearchToolExecutionWhether tool search is executed by the server or by the client.
-
const ToolSearchToolExecutionServer ToolSearchToolExecution = "server" -
const ToolSearchToolExecutionClient ToolSearchToolExecution = "client"
-
-
Parameters anyParameter schema for a client-executed tool search tool.
-
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
Type WebSearchPreviewToolTypeThe type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
const WebSearchPreviewToolTypeWebSearchPreview WebSearchPreviewToolType = "web_search_preview" -
const WebSearchPreviewToolTypeWebSearchPreview2025_03_11 WebSearchPreviewToolType = "web_search_preview_2025_03_11"
-
-
SearchContentTypes []string-
const WebSearchPreviewToolSearchContentTypeText WebSearchPreviewToolSearchContentType = "text" -
const WebSearchPreviewToolSearchContentTypeImage WebSearchPreviewToolSearchContentType = "image"
-
-
SearchContextSize WebSearchPreviewToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchPreviewToolSearchContextSizeLow WebSearchPreviewToolSearchContextSize = "low" -
const WebSearchPreviewToolSearchContextSizeMedium WebSearchPreviewToolSearchContextSize = "medium" -
const WebSearchPreviewToolSearchContextSizeHigh WebSearchPreviewToolSearchContextSize = "high"
-
-
UserLocation WebSearchPreviewToolUserLocationThe user's location.
-
Type ApproximateThe type of location approximation. Always
approximate.const ApproximateApproximate Approximate = "approximate"
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
Type ApplyPatchThe type of the tool. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
-
Type ToolSearchOutputThe item type. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
ID stringThe unique ID of this tool search output.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemParamExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemParamExecutionServer ResponseToolSearchOutputItemParamExecution = "server" -
const ResponseToolSearchOutputItemParamExecutionClient ResponseToolSearchOutputItemParamExecution = "client"
-
-
Status ResponseToolSearchOutputItemParamStatusThe status of the tool search output.
-
const ResponseToolSearchOutputItemParamStatusInProgress ResponseToolSearchOutputItemParamStatus = "in_progress" -
const ResponseToolSearchOutputItemParamStatusCompleted ResponseToolSearchOutputItemParamStatus = "completed" -
const ResponseToolSearchOutputItemParamStatusIncomplete ResponseToolSearchOutputItemParamStatus = "incomplete"
-
-
Response Usage
-
type ResponseUsage struct{…}Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
-
InputTokens int64The number of input tokens.
-
InputTokensDetails ResponseUsageInputTokensDetailsA detailed breakdown of the input tokens.
-
CachedTokens int64The number of tokens that were retrieved from the cache. More on prompt caching.
-
-
OutputTokens int64The number of output tokens.
-
OutputTokensDetails ResponseUsageOutputTokensDetailsA detailed breakdown of the output tokens.
-
ReasoningTokens int64The number of reasoning tokens.
-
-
TotalTokens int64The total number of tokens used.
-
Response Web Search Call Completed Event
-
type ResponseWebSearchCallCompletedEvent struct{…}Emitted when a web search call is completed.
-
ItemID stringUnique ID for the output item associated with the web search call.
-
OutputIndex int64The index of the output item that the web search call is associated with.
-
SequenceNumber int64The sequence number of the web search call being processed.
-
Type ResponseWebSearchCallCompletedThe type of the event. Always
response.web_search_call.completed.const ResponseWebSearchCallCompletedResponseWebSearchCallCompleted ResponseWebSearchCallCompleted = "response.web_search_call.completed"
-
Response Web Search Call In Progress Event
-
type ResponseWebSearchCallInProgressEvent struct{…}Emitted when a web search call is initiated.
-
ItemID stringUnique ID for the output item associated with the web search call.
-
OutputIndex int64The index of the output item that the web search call is associated with.
-
SequenceNumber int64The sequence number of the web search call being processed.
-
Type ResponseWebSearchCallInProgressThe type of the event. Always
response.web_search_call.in_progress.const ResponseWebSearchCallInProgressResponseWebSearchCallInProgress ResponseWebSearchCallInProgress = "response.web_search_call.in_progress"
-
Response Web Search Call Searching Event
-
type ResponseWebSearchCallSearchingEvent struct{…}Emitted when a web search call is executing.
-
ItemID stringUnique ID for the output item associated with the web search call.
-
OutputIndex int64The index of the output item that the web search call is associated with.
-
SequenceNumber int64The sequence number of the web search call being processed.
-
Type ResponseWebSearchCallSearchingThe type of the event. Always
response.web_search_call.searching.const ResponseWebSearchCallSearchingResponseWebSearchCallSearching ResponseWebSearchCallSearching = "response.web_search_call.searching"
-
Responses Client Event
-
type ResponsesClientEvent struct{…}-
Type ResponseCreateThe type of the client event. Always
response.create.const ResponseCreateResponseCreate ResponseCreate = "response.create"
-
Background boolWhether to run the model response in the background. Learn more.
-
ContextManagement []ResponsesClientEventContextManagementContext management configuration for this request.
-
Type stringThe context management entry type. Currently only 'compaction' is supported.
-
CompactThreshold int64Token threshold at which compaction should be triggered for this entry.
-
-
Conversation ResponsesClientEventConversationUnionThe conversation that this response belongs to. Items from this conversation are prepended to
input_itemsfor this response request. Input items and output items from this response are automatically added to this conversation after this response completes.-
string -
type ResponseConversationParamResp struct{…}The conversation that this response belongs to.
-
ID stringThe unique ID of the conversation.
-
-
-
Include []ResponseIncludableSpecify additional output data to include in the model response. Currently supported values are:
-
web_search_call.action.sources: Include the sources of the web search tool call. -
code_interpreter_call.outputs: Includes the outputs of python code execution in code interpreter tool call items. -
computer_call_output.output.image_url: Include image urls from the computer call output. -
file_search_call.results: Include the search results of the file search tool call. -
message.input_image.image_url: Include image urls from the input message. -
message.output_text.logprobs: Include logprobs with assistant messages. -
reasoning.encrypted_content: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when thestoreparameter is set tofalse, or when an organization is enrolled in the zero data retention program). -
const ResponseIncludableFileSearchCallResults ResponseIncludable = "file_search_call.results" -
const ResponseIncludableWebSearchCallResults ResponseIncludable = "web_search_call.results" -
const ResponseIncludableWebSearchCallActionSources ResponseIncludable = "web_search_call.action.sources" -
const ResponseIncludableMessageInputImageImageURL ResponseIncludable = "message.input_image.image_url" -
const ResponseIncludableComputerCallOutputOutputImageURL ResponseIncludable = "computer_call_output.output.image_url" -
const ResponseIncludableCodeInterpreterCallOutputs ResponseIncludable = "code_interpreter_call.outputs" -
const ResponseIncludableReasoningEncryptedContent ResponseIncludable = "reasoning.encrypted_content" -
const ResponseIncludableMessageOutputTextLogprobs ResponseIncludable = "message.output_text.logprobs"
-
-
Input ResponsesClientEventInputUnionText, image, or file inputs to the model, used to generate a response.
Learn more:
-
string -
type ResponseInput []ResponseInputItemUnionA list of one or many input items to the model, containing different content types.
-
type EasyInputMessage struct{…}A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.-
Content EasyInputMessageContentUnionText, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
-
string -
type ResponseInputMessageContentList []ResponseInputContentUnionA list of one or many input items to the model, containing different content types.
-
type ResponseInputText struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
Detail ResponseInputImageDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageDetailLow ResponseInputImageDetail = "low" -
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high" -
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto" -
const ResponseInputImageDetailOriginal ResponseInputImageDetail = "original"
-
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFile struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileDetailLow ResponseInputFileDetail = "low" -
const ResponseInputFileDetailHigh ResponseInputFileDetail = "high"
-
-
FileData stringThe content of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Role EasyInputMessageRoleThe role of the message input. One of
user,assistant,system, ordeveloper.-
const EasyInputMessageRoleUser EasyInputMessageRole = "user" -
const EasyInputMessageRoleAssistant EasyInputMessageRole = "assistant" -
const EasyInputMessageRoleSystem EasyInputMessageRole = "system" -
const EasyInputMessageRoleDeveloper EasyInputMessageRole = "developer"
-
-
Phase EasyInputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const EasyInputMessagePhaseCommentary EasyInputMessagePhase = "commentary" -
const EasyInputMessagePhaseFinalAnswer EasyInputMessagePhase = "final_answer"
-
-
Type EasyInputMessageTypeThe type of the message input. Always
message.const EasyInputMessageTypeMessage EasyInputMessageType = "message"
-
-
type ResponseInputItemMessage struct{…}A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole.-
Content ResponseInputMessageContentListA list of one or many input items to the model, containing different content types.
-
Role stringThe role of the message input. One of
user,system, ordeveloper.-
const ResponseInputItemMessageRoleUser ResponseInputItemMessageRole = "user" -
const ResponseInputItemMessageRoleSystem ResponseInputItemMessageRole = "system" -
const ResponseInputItemMessageRoleDeveloper ResponseInputItemMessageRole = "developer"
-
-
Status stringThe status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputItemMessageStatusInProgress ResponseInputItemMessageStatus = "in_progress" -
const ResponseInputItemMessageStatusCompleted ResponseInputItemMessageStatus = "completed" -
const ResponseInputItemMessageStatusIncomplete ResponseInputItemMessageStatus = "incomplete"
-
-
Type stringThe type of the message input. Always set to
message.const ResponseInputItemMessageTypeMessage ResponseInputItemMessageType = "message"
-
-
type ResponseOutputMessage struct{…}An output message from the model.
-
ID stringThe unique ID of the output message.
-
Content []ResponseOutputMessageContentUnionThe content of the output message.
-
type ResponseOutputText struct{…}A text output from the model.
-
Annotations []ResponseOutputTextAnnotationUnionThe annotations of the text output.
-
type ResponseOutputTextAnnotationFileCitation struct{…}A citation to a file.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the file cited.
-
Index int64The index of the file in the list of files.
-
Type FileCitationThe type of the file citation. Always
file_citation.const FileCitationFileCitation FileCitation = "file_citation"
-
-
type ResponseOutputTextAnnotationURLCitation struct{…}A citation for a web resource used to generate a model response.
-
EndIndex int64The index of the last character of the URL citation in the message.
-
StartIndex int64The index of the first character of the URL citation in the message.
-
Title stringThe title of the web resource.
-
Type URLCitationThe type of the URL citation. Always
url_citation.const URLCitationURLCitation URLCitation = "url_citation"
-
URL stringThe URL of the web resource.
-
-
type ResponseOutputTextAnnotationContainerFileCitation struct{…}A citation for a container file used to generate a model response.
-
ContainerID stringThe ID of the container file.
-
EndIndex int64The index of the last character of the container file citation in the message.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the container file cited.
-
StartIndex int64The index of the first character of the container file citation in the message.
-
Type ContainerFileCitationThe type of the container file citation. Always
container_file_citation.const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"
-
-
type ResponseOutputTextAnnotationFilePath struct{…}A path to a file.
-
FileID stringThe ID of the file.
-
Index int64The index of the file in the list of files.
-
Type FilePathThe type of the file path. Always
file_path.const FilePathFilePath FilePath = "file_path"
-
-
-
Text stringThe text output from the model.
-
Type OutputTextThe type of the output text. Always
output_text.const OutputTextOutputText OutputText = "output_text"
-
Logprobs []ResponseOutputTextLogprob-
Token string -
Bytes []int64 -
Logprob float64 -
TopLogprobs []ResponseOutputTextLogprobTopLogprob-
Token string -
Bytes []int64 -
Logprob float64
-
-
-
-
type ResponseOutputRefusal struct{…}A refusal from the model.
-
Refusal stringThe refusal explanation from the model.
-
Type RefusalThe type of the refusal. Always
refusal.const RefusalRefusal Refusal = "refusal"
-
-
-
Role AssistantThe role of the output message. Always
assistant.const AssistantAssistant Assistant = "assistant"
-
Status ResponseOutputMessageStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseOutputMessageStatusInProgress ResponseOutputMessageStatus = "in_progress" -
const ResponseOutputMessageStatusCompleted ResponseOutputMessageStatus = "completed" -
const ResponseOutputMessageStatusIncomplete ResponseOutputMessageStatus = "incomplete"
-
-
Type MessageThe type of the output message. Always
message.const MessageMessage Message = "message"
-
Phase ResponseOutputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const ResponseOutputMessagePhaseCommentary ResponseOutputMessagePhase = "commentary" -
const ResponseOutputMessagePhaseFinalAnswer ResponseOutputMessagePhase = "final_answer"
-
-
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
ID stringThe unique ID of the file search tool call.
-
Queries []stringThe queries used to search for files.
-
Status ResponseFileSearchToolCallStatusThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
const ResponseFileSearchToolCallStatusInProgress ResponseFileSearchToolCallStatus = "in_progress" -
const ResponseFileSearchToolCallStatusSearching ResponseFileSearchToolCallStatus = "searching" -
const ResponseFileSearchToolCallStatusCompleted ResponseFileSearchToolCallStatus = "completed" -
const ResponseFileSearchToolCallStatusIncomplete ResponseFileSearchToolCallStatus = "incomplete" -
const ResponseFileSearchToolCallStatusFailed ResponseFileSearchToolCallStatus = "failed"
-
-
Type FileSearchCallThe type of the file search tool call. Always
file_search_call.const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"
-
Results []ResponseFileSearchToolCallResultThe results of the file search tool call.
-
Attributes map[string, ResponseFileSearchToolCallResultAttributeUnion]Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.
-
string -
float64 -
bool
-
-
FileID stringThe unique ID of the file.
-
Filename stringThe name of the file.
-
Score float64The relevance score of the file - a value between 0 and 1.
-
Text stringThe text that was retrieved from the file.
-
-
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
ID stringThe unique ID of the computer call.
-
CallID stringAn identifier used when responding to the tool call with output.
-
PendingSafetyChecks []ResponseComputerToolCallPendingSafetyCheckThe pending safety checks for the computer call.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status ResponseComputerToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseComputerToolCallStatusInProgress ResponseComputerToolCallStatus = "in_progress" -
const ResponseComputerToolCallStatusCompleted ResponseComputerToolCallStatus = "completed" -
const ResponseComputerToolCallStatusIncomplete ResponseComputerToolCallStatus = "incomplete"
-
-
Type ResponseComputerToolCallTypeThe type of the computer call. Always
computer_call.const ResponseComputerToolCallTypeComputerCall ResponseComputerToolCallType = "computer_call"
-
Action ResponseComputerToolCallActionUnionA click action.
-
type ResponseComputerToolCallActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ResponseComputerToolCallActionClickButtonLeft ResponseComputerToolCallActionClickButton = "left" -
const ResponseComputerToolCallActionClickButtonRight ResponseComputerToolCallActionClickButton = "right" -
const ResponseComputerToolCallActionClickButtonWheel ResponseComputerToolCallActionClickButton = "wheel" -
const ResponseComputerToolCallActionClickButtonBack ResponseComputerToolCallActionClickButton = "back" -
const ResponseComputerToolCallActionClickButtonForward ResponseComputerToolCallActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ResponseComputerToolCallActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ResponseComputerToolCallActionDrag struct{…}A drag action.
-
Path []ResponseComputerToolCallActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ResponseComputerToolCallActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ResponseComputerToolCallActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ResponseComputerToolCallActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ResponseComputerToolCallActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ResponseComputerToolCallActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ResponseComputerToolCallActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
Actions ComputerActionListFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
type ComputerActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ComputerActionClickButtonLeft ComputerActionClickButton = "left" -
const ComputerActionClickButtonRight ComputerActionClickButton = "right" -
const ComputerActionClickButtonWheel ComputerActionClickButton = "wheel" -
const ComputerActionClickButtonBack ComputerActionClickButton = "back" -
const ComputerActionClickButtonForward ComputerActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ComputerActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ComputerActionDrag struct{…}A drag action.
-
Path []ComputerActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ComputerActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ComputerActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ComputerActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ComputerActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ComputerActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ComputerActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
-
type ResponseInputItemComputerCallOutput struct{…}The output of a computer tool call.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Type ComputerScreenshotSpecifies the event type. For a computer screenshot, this property is always set to
computer_screenshot.const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"
-
FileID stringThe identifier of an uploaded file that contains the screenshot.
-
ImageURL stringThe URL of the screenshot image.
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
ID stringThe ID of the computer tool call output.
-
AcknowledgedSafetyChecks []ResponseInputItemComputerCallOutputAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status stringThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseInputItemComputerCallOutputStatusInProgress ResponseInputItemComputerCallOutputStatus = "in_progress" -
const ResponseInputItemComputerCallOutputStatusCompleted ResponseInputItemComputerCallOutputStatus = "completed" -
const ResponseInputItemComputerCallOutputStatusIncomplete ResponseInputItemComputerCallOutputStatus = "incomplete"
-
-
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
ID stringThe unique ID of the web search tool call.
-
Action ResponseFunctionWebSearchActionUnionAn object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
type ResponseFunctionWebSearchActionSearch struct{…}Action type "search" - Performs a web search query.
-
Type SearchThe action type.
const SearchSearch Search = "search"
-
Queries []stringThe search queries.
-
Query stringThe search query.
-
Sources []ResponseFunctionWebSearchActionSearchSourceThe sources used in the search.
-
Type URLThe type of source. Always
url.const URLURL URL = "url"
-
URL stringThe URL of the source.
-
-
-
type ResponseFunctionWebSearchActionOpenPage struct{…}Action type "open_page" - Opens a specific URL from search results.
-
Type OpenPageThe action type.
const OpenPageOpenPage OpenPage = "open_page"
-
URL stringThe URL opened by the model.
-
-
type ResponseFunctionWebSearchActionFindInPage struct{…}Action type "find_in_page": Searches for a pattern within a loaded page.
-
Pattern stringThe pattern or text to search for within the page.
-
Type FindInPageThe action type.
const FindInPageFindInPage FindInPage = "find_in_page"
-
URL stringThe URL of the page searched for the pattern.
-
-
-
Status ResponseFunctionWebSearchStatusThe status of the web search tool call.
-
const ResponseFunctionWebSearchStatusInProgress ResponseFunctionWebSearchStatus = "in_progress" -
const ResponseFunctionWebSearchStatusSearching ResponseFunctionWebSearchStatus = "searching" -
const ResponseFunctionWebSearchStatusCompleted ResponseFunctionWebSearchStatus = "completed" -
const ResponseFunctionWebSearchStatusFailed ResponseFunctionWebSearchStatus = "failed"
-
-
Type WebSearchCallThe type of the web search tool call. Always
web_search_call.const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"
-
-
type ResponseFunctionToolCall struct{…}A tool call to run a function. See the function calling guide for more information.
-
Arguments stringA JSON string of the arguments to pass to the function.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Name stringThe name of the function to run.
-
Type FunctionCallThe type of the function tool call. Always
function_call.const FunctionCallFunctionCall FunctionCall = "function_call"
-
ID stringThe unique ID of the function tool call.
-
Namespace stringThe namespace of the function to run.
-
Status ResponseFunctionToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallStatusInProgress ResponseFunctionToolCallStatus = "in_progress" -
const ResponseFunctionToolCallStatusCompleted ResponseFunctionToolCallStatus = "completed" -
const ResponseFunctionToolCallStatusIncomplete ResponseFunctionToolCallStatus = "incomplete"
-
-
-
type ResponseInputItemFunctionCallOutput struct{…}The output of a function tool call.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseInputItemFunctionCallOutputOutputUnionText, image, or file output of the function tool call.
-
string -
type ResponseFunctionCallOutputItemList []ResponseFunctionCallOutputItemUnionAn array of content outputs (text, image, file) for the function tool call.
-
type ResponseInputTextContent struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImageContent struct{…}An image input to the model. Learn about image inputs
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
Detail ResponseInputImageContentDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageContentDetailLow ResponseInputImageContentDetail = "low" -
const ResponseInputImageContentDetailHigh ResponseInputImageContentDetail = "high" -
const ResponseInputImageContentDetailAuto ResponseInputImageContentDetail = "auto" -
const ResponseInputImageContentDetailOriginal ResponseInputImageContentDetail = "original"
-
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFileContent struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileContentDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileContentDetailLow ResponseInputFileContentDetail = "low" -
const ResponseInputFileContentDetailHigh ResponseInputFileContentDetail = "high"
-
-
FileData stringThe base64-encoded data of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
ID stringThe unique ID of the function tool call output. Populated when this item is returned via API.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputItemFunctionCallOutputStatusInProgress ResponseInputItemFunctionCallOutputStatus = "in_progress" -
const ResponseInputItemFunctionCallOutputStatusCompleted ResponseInputItemFunctionCallOutputStatus = "completed" -
const ResponseInputItemFunctionCallOutputStatusIncomplete ResponseInputItemFunctionCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemToolSearchCall struct{…}-
Arguments anyThe arguments supplied to the tool search call.
-
Type ToolSearchCallThe item type. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
ID stringThe unique ID of this tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution stringWhether tool search was executed by the server or by the client.
-
const ResponseInputItemToolSearchCallExecutionServer ResponseInputItemToolSearchCallExecution = "server" -
const ResponseInputItemToolSearchCallExecutionClient ResponseInputItemToolSearchCallExecution = "client"
-
-
Status stringThe status of the tool search call.
-
const ResponseInputItemToolSearchCallStatusInProgress ResponseInputItemToolSearchCallStatus = "in_progress" -
const ResponseInputItemToolSearchCallStatusCompleted ResponseInputItemToolSearchCallStatus = "completed" -
const ResponseInputItemToolSearchCallStatusIncomplete ResponseInputItemToolSearchCallStatus = "incomplete"
-
-
-
type ResponseToolSearchOutputItemParamResp struct{…}-
Tools []ToolUnionThe loaded tool definitions returned by the tool search output.
-
type FunctionTool struct{…}Defines a function in your own code the model can choose to call. Learn more about function calling.
-
Name stringThe name of the function to call.
-
Parameters map[string, any]A JSON schema object describing the parameters of the function.
-
Strict boolWhether to enforce strict parameter validation. Default
true. -
Type FunctionThe type of the function tool. Always
function.const FunctionFunction Function = "function"
-
DeferLoading boolWhether this function is deferred and loaded via tool search.
-
Description stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
type FileSearchTool struct{…}A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
Type FileSearchThe type of the file search tool. Always
file_search.const FileSearchFileSearch FileSearch = "file_search"
-
VectorStoreIDs []stringThe IDs of the vector stores to search.
-
Filters FileSearchToolFiltersUnionA filter to apply.
-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
Key stringThe key to compare against the value.
-
Type ComparisonFilterTypeSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
const ComparisonFilterTypeEq ComparisonFilterType = "eq" -
const ComparisonFilterTypeNe ComparisonFilterType = "ne" -
const ComparisonFilterTypeGt ComparisonFilterType = "gt" -
const ComparisonFilterTypeGte ComparisonFilterType = "gte" -
const ComparisonFilterTypeLt ComparisonFilterType = "lt" -
const ComparisonFilterTypeLte ComparisonFilterType = "lte" -
const ComparisonFilterTypeIn ComparisonFilterType = "in" -
const ComparisonFilterTypeNin ComparisonFilterType = "nin"
-
-
Value ComparisonFilterValueUnionThe value to compare against the attribute key; supports string, number, or boolean types.
-
string -
float64 -
bool -
type ComparisonFilterValueArray []ComparisonFilterValueArrayItemUnion-
string -
float64
-
-
-
-
type CompoundFilter struct{…}Combine multiple filters using
andoror.-
Filters []ComparisonFilterArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
-
Type CompoundFilterTypeType of operation:
andoror.-
const CompoundFilterTypeAnd CompoundFilterType = "and" -
const CompoundFilterTypeOr CompoundFilterType = "or"
-
-
-
-
MaxNumResults int64The maximum number of results to return. This number should be between 1 and 50 inclusive.
-
RankingOptions FileSearchToolRankingOptionsRanking options for search.
-
HybridSearch FileSearchToolRankingOptionsHybridSearchWeights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
EmbeddingWeight float64The weight of the embedding in the reciprocal ranking fusion.
-
TextWeight float64The weight of the text in the reciprocal ranking fusion.
-
-
Ranker stringThe ranker to use for the file search.
-
const FileSearchToolRankingOptionsRankerAuto FileSearchToolRankingOptionsRanker = "auto" -
const FileSearchToolRankingOptionsRankerDefault2024_11_15 FileSearchToolRankingOptionsRanker = "default-2024-11-15"
-
-
ScoreThreshold float64The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
Type ComputerThe type of the computer tool. Always
computer.const ComputerComputer Computer = "computer"
-
-
type ComputerUsePreviewTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
DisplayHeight int64The height of the computer display.
-
DisplayWidth int64The width of the computer display.
-
Environment ComputerUsePreviewToolEnvironmentThe type of computer environment to control.
-
const ComputerUsePreviewToolEnvironmentWindows ComputerUsePreviewToolEnvironment = "windows" -
const ComputerUsePreviewToolEnvironmentMac ComputerUsePreviewToolEnvironment = "mac" -
const ComputerUsePreviewToolEnvironmentLinux ComputerUsePreviewToolEnvironment = "linux" -
const ComputerUsePreviewToolEnvironmentUbuntu ComputerUsePreviewToolEnvironment = "ubuntu" -
const ComputerUsePreviewToolEnvironmentBrowser ComputerUsePreviewToolEnvironment = "browser"
-
-
Type ComputerUsePreviewThe type of the computer use tool. Always
computer_use_preview.const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"
-
-
type WebSearchTool struct{…}Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
Type WebSearchToolTypeThe type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
const WebSearchToolTypeWebSearch WebSearchToolType = "web_search" -
const WebSearchToolTypeWebSearch2025_08_26 WebSearchToolType = "web_search_2025_08_26"
-
-
Filters WebSearchToolFiltersFilters for the search.
-
AllowedDomains []stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
SearchContextSize WebSearchToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchToolSearchContextSizeLow WebSearchToolSearchContextSize = "low" -
const WebSearchToolSearchContextSizeMedium WebSearchToolSearchContextSize = "medium" -
const WebSearchToolSearchContextSizeHigh WebSearchToolSearchContextSize = "high"
-
-
UserLocation WebSearchToolUserLocationThe approximate location of the user.
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
Type stringThe type of location approximation. Always
approximate.const WebSearchToolUserLocationTypeApproximate WebSearchToolUserLocationType = "approximate"
-
-
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
ServerLabel stringA label for this MCP server, used to identify it in tool calls.
-
Type McpThe type of the MCP tool. Always
mcp.const McpMcp Mcp = "mcp"
-
AllowedTools ToolMcpAllowedToolsUnionList of allowed tool names or a filter object.
-
type ToolMcpAllowedToolsMcpAllowedTools []stringA string array of allowed tool names
-
type ToolMcpAllowedToolsMcpToolFilter struct{…}A filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
Authorization stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
ConnectorID stringIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
const ToolMcpConnectorIDConnectorDropbox ToolMcpConnectorID = "connector_dropbox" -
const ToolMcpConnectorIDConnectorGmail ToolMcpConnectorID = "connector_gmail" -
const ToolMcpConnectorIDConnectorGooglecalendar ToolMcpConnectorID = "connector_googlecalendar" -
const ToolMcpConnectorIDConnectorGoogledrive ToolMcpConnectorID = "connector_googledrive" -
const ToolMcpConnectorIDConnectorMicrosoftteams ToolMcpConnectorID = "connector_microsoftteams" -
const ToolMcpConnectorIDConnectorOutlookcalendar ToolMcpConnectorID = "connector_outlookcalendar" -
const ToolMcpConnectorIDConnectorOutlookemail ToolMcpConnectorID = "connector_outlookemail" -
const ToolMcpConnectorIDConnectorSharepoint ToolMcpConnectorID = "connector_sharepoint"
-
-
DeferLoading boolWhether this MCP tool is deferred and discovered via tool search.
-
Headers map[string, string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
RequireApproval ToolMcpRequireApprovalUnionSpecify which of the MCP server's tools require approval.
-
type ToolMcpRequireApprovalMcpToolApprovalFilter 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.-
Always ToolMcpRequireApprovalMcpToolApprovalFilterAlwaysA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
Never ToolMcpRequireApprovalMcpToolApprovalFilterNeverA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
type ToolMcpRequireApprovalMcpToolApprovalSetting stringSpecify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
const ToolMcpRequireApprovalMcpToolApprovalSettingAlways ToolMcpRequireApprovalMcpToolApprovalSetting = "always" -
const ToolMcpRequireApprovalMcpToolApprovalSettingNever ToolMcpRequireApprovalMcpToolApprovalSetting = "never"
-
-
-
ServerDescription stringOptional description of the MCP server, used to provide more context.
-
ServerURL stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
TunnelID stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
Container ToolCodeInterpreterContainerUnionThe code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
string -
type ToolCodeInterpreterContainerCodeInterpreterContainerAuto struct{…}Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
Type AutoAlways
auto.const AutoAuto Auto = "auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit stringThe memory limit for the code interpreter container.
-
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"
-
-
NetworkPolicy ToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…}-
Type DisabledDisable outbound network access. Always
disabled.const DisabledDisabled Disabled = "disabled"
-
-
type ContainerNetworkPolicyAllowlist struct{…}-
AllowedDomains []stringA list of allowed domains when type is
allowlist. -
Type AllowlistAllow outbound network access only to specified domains. Always
allowlist.const AllowlistAllowlist Allowlist = "allowlist"
-
DomainSecrets []ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
Domain stringThe domain associated with the secret.
-
Name stringThe name of the secret to inject for the domain.
-
Value stringThe secret value to inject for the domain.
-
-
-
-
-
-
Type CodeInterpreterThe type of the code interpreter tool. Always
code_interpreter.const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"
-
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
Type ImageGenerationThe type of the image generation tool. Always
image_generation.const ImageGenerationImageGeneration ImageGeneration = "image_generation"
-
Action stringWhether to generate a new image or edit an existing image. Default:
auto.-
const ToolImageGenerationActionGenerate ToolImageGenerationAction = "generate" -
const ToolImageGenerationActionEdit ToolImageGenerationAction = "edit" -
const ToolImageGenerationActionAuto ToolImageGenerationAction = "auto"
-
-
Background stringAllows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
const ToolImageGenerationBackgroundTransparent ToolImageGenerationBackground = "transparent" -
const ToolImageGenerationBackgroundOpaque ToolImageGenerationBackground = "opaque" -
const ToolImageGenerationBackgroundAuto ToolImageGenerationBackground = "auto"
-
-
InputFidelity stringControl how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
const ToolImageGenerationInputFidelityHigh ToolImageGenerationInputFidelity = "high" -
const ToolImageGenerationInputFidelityLow ToolImageGenerationInputFidelity = "low"
-
-
InputImageMask ToolImageGenerationInputImageMaskOptional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
FileID stringFile ID for the mask image.
-
ImageURL stringBase64-encoded mask image.
-
-
Model stringThe image generation model to use. Default:
gpt-image-1.-
string -
string-
const ToolImageGenerationModelGPTImage1 ToolImageGenerationModel = "gpt-image-1" -
const ToolImageGenerationModelGPTImage1Mini ToolImageGenerationModel = "gpt-image-1-mini" -
const ToolImageGenerationModelGPTImage2 ToolImageGenerationModel = "gpt-image-2" -
const ToolImageGenerationModelGPTImage2_2026_04_21 ToolImageGenerationModel = "gpt-image-2-2026-04-21" -
const ToolImageGenerationModelGPTImage1_5 ToolImageGenerationModel = "gpt-image-1.5" -
const ToolImageGenerationModelChatgptImageLatest ToolImageGenerationModel = "chatgpt-image-latest"
-
-
-
Moderation stringModeration level for the generated image. Default:
auto.-
const ToolImageGenerationModerationAuto ToolImageGenerationModeration = "auto" -
const ToolImageGenerationModerationLow ToolImageGenerationModeration = "low"
-
-
OutputCompression int64Compression level for the output image. Default: 100.
-
OutputFormat stringThe output format of the generated image. One of
png,webp, orjpeg. Default:png.-
const ToolImageGenerationOutputFormatPNG ToolImageGenerationOutputFormat = "png" -
const ToolImageGenerationOutputFormatWebP ToolImageGenerationOutputFormat = "webp" -
const ToolImageGenerationOutputFormatJPEG ToolImageGenerationOutputFormat = "jpeg"
-
-
PartialImages int64Number of partial images to generate in streaming mode, from 0 (default value) to 3.
-
Quality stringThe quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
const ToolImageGenerationQualityLow ToolImageGenerationQuality = "low" -
const ToolImageGenerationQualityMedium ToolImageGenerationQuality = "medium" -
const ToolImageGenerationQualityHigh ToolImageGenerationQuality = "high" -
const ToolImageGenerationQualityAuto ToolImageGenerationQuality = "auto"
-
-
Size stringThe size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
string -
string-
const ToolImageGenerationSize1024x1024 ToolImageGenerationSize = "1024x1024" -
const ToolImageGenerationSize1024x1536 ToolImageGenerationSize = "1024x1536" -
const ToolImageGenerationSize1536x1024 ToolImageGenerationSize = "1536x1024" -
const ToolImageGenerationSizeAuto ToolImageGenerationSize = "auto"
-
-
-
-
type ToolLocalShell struct{…}A tool that allows the model to execute shell commands in a local environment.
-
Type LocalShellThe type of the local shell tool. Always
local_shell.const LocalShellLocalShell LocalShell = "local_shell"
-
-
type FunctionShellTool struct{…}A tool that allows the model to execute shell commands.
-
Type ShellThe type of the shell tool. Always
shell.const ShellShell Shell = "shell"
-
Environment FunctionShellToolEnvironmentUnion-
type ContainerAuto struct{…}-
Type ContainerAutoAutomatically creates a container for this request
const ContainerAutoContainerAuto ContainerAuto = "container_auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit ContainerAutoMemoryLimitThe memory limit for the container.
-
const ContainerAutoMemoryLimit1g ContainerAutoMemoryLimit = "1g" -
const ContainerAutoMemoryLimit4g ContainerAutoMemoryLimit = "4g" -
const ContainerAutoMemoryLimit16g ContainerAutoMemoryLimit = "16g" -
const ContainerAutoMemoryLimit64g ContainerAutoMemoryLimit = "64g"
-
-
NetworkPolicy ContainerAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…} -
type ContainerNetworkPolicyAllowlist struct{…}
-
-
Skills []ContainerAutoSkillUnionAn optional list of skills referenced by id or inline data.
-
type SkillReference struct{…}-
SkillID stringThe ID of the referenced skill.
-
Type SkillReferenceReferences a skill created with the /v1/skills endpoint.
const SkillReferenceSkillReference SkillReference = "skill_reference"
-
Version stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
type InlineSkill struct{…}-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Source InlineSkillSourceInline skill payload
-
Data stringBase64-encoded skill zip bundle.
-
MediaType ApplicationZipThe media type of the inline skill payload. Must be
application/zip.const ApplicationZipApplicationZip ApplicationZip = "application/zip"
-
Type Base64The type of the inline skill source. Must be
base64.const Base64Base64 Base64 = "base64"
-
-
Type InlineDefines an inline skill for this request.
const InlineInline Inline = "inline"
-
-
-
-
type LocalEnvironment struct{…}-
Type LocalUse a local computer environment.
const LocalLocal Local = "local"
-
Skills []LocalSkillAn optional list of skills.
-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Path stringThe path to the directory containing the skill.
-
-
-
type ContainerReference struct{…}-
ContainerID stringThe ID of the referenced container.
-
Type ContainerReferenceReferences a container created with the /v1/containers endpoint
const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
Name stringThe name of the custom tool, used to identify it in tool calls.
-
Type CustomThe type of the custom tool. Always
custom.const CustomCustom Custom = "custom"
-
DeferLoading boolWhether this tool should be deferred and discovered via tool search.
-
Description stringOptional description of the custom tool, used to provide more context.
-
Format CustomToolInputFormatUnionThe input format for the custom tool. Default is unconstrained text.
-
type CustomToolInputFormatText struct{…}Unconstrained free-form text.
-
Type TextUnconstrained text format. Always
text.const TextText Text = "text"
-
-
type CustomToolInputFormatGrammar struct{…}A grammar defined by the user.
-
Definition stringThe grammar definition.
-
Syntax stringThe syntax of the grammar definition. One of
larkorregex.-
const CustomToolInputFormatGrammarSyntaxLark CustomToolInputFormatGrammarSyntax = "lark" -
const CustomToolInputFormatGrammarSyntaxRegex CustomToolInputFormatGrammarSyntax = "regex"
-
-
Type GrammarGrammar format. Always
grammar.const GrammarGrammar Grammar = "grammar"
-
-
-
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
Description stringA description of the namespace shown to the model.
-
Name stringThe namespace name used in tool calls (for example,
crm). -
Tools []NamespaceToolToolUnionThe function/custom tools available inside this namespace.
-
type NamespaceToolToolFunction struct{…}-
Name string -
Type Functionconst FunctionFunction Function = "function"
-
DeferLoading boolWhether this function should be deferred and discovered via tool search.
-
Description string -
Parameters any -
Strict bool
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
-
Type NamespaceThe type of the tool. Always
namespace.const NamespaceNamespace Namespace = "namespace"
-
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
Type ToolSearchThe type of the tool. Always
tool_search.const ToolSearchToolSearch ToolSearch = "tool_search"
-
Description stringDescription shown to the model for a client-executed tool search tool.
-
Execution ToolSearchToolExecutionWhether tool search is executed by the server or by the client.
-
const ToolSearchToolExecutionServer ToolSearchToolExecution = "server" -
const ToolSearchToolExecutionClient ToolSearchToolExecution = "client"
-
-
Parameters anyParameter schema for a client-executed tool search tool.
-
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
Type WebSearchPreviewToolTypeThe type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
const WebSearchPreviewToolTypeWebSearchPreview WebSearchPreviewToolType = "web_search_preview" -
const WebSearchPreviewToolTypeWebSearchPreview2025_03_11 WebSearchPreviewToolType = "web_search_preview_2025_03_11"
-
-
SearchContentTypes []string-
const WebSearchPreviewToolSearchContentTypeText WebSearchPreviewToolSearchContentType = "text" -
const WebSearchPreviewToolSearchContentTypeImage WebSearchPreviewToolSearchContentType = "image"
-
-
SearchContextSize WebSearchPreviewToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchPreviewToolSearchContextSizeLow WebSearchPreviewToolSearchContextSize = "low" -
const WebSearchPreviewToolSearchContextSizeMedium WebSearchPreviewToolSearchContextSize = "medium" -
const WebSearchPreviewToolSearchContextSizeHigh WebSearchPreviewToolSearchContextSize = "high"
-
-
UserLocation WebSearchPreviewToolUserLocationThe user's location.
-
Type ApproximateThe type of location approximation. Always
approximate.const ApproximateApproximate Approximate = "approximate"
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
Type ApplyPatchThe type of the tool. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
-
Type ToolSearchOutputThe item type. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
ID stringThe unique ID of this tool search output.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemParamExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemParamExecutionServer ResponseToolSearchOutputItemParamExecution = "server" -
const ResponseToolSearchOutputItemParamExecutionClient ResponseToolSearchOutputItemParamExecution = "client"
-
-
Status ResponseToolSearchOutputItemParamStatusThe status of the tool search output.
-
const ResponseToolSearchOutputItemParamStatusInProgress ResponseToolSearchOutputItemParamStatus = "in_progress" -
const ResponseToolSearchOutputItemParamStatusCompleted ResponseToolSearchOutputItemParamStatus = "completed" -
const ResponseToolSearchOutputItemParamStatusIncomplete ResponseToolSearchOutputItemParamStatus = "incomplete"
-
-
-
type ResponseInputItemAdditionalTools struct{…}-
Role DeveloperThe role that provided the additional tools. Only
developeris supported.const DeveloperDeveloper Developer = "developer"
-
Tools []ToolUnionA list of additional tools made available at this item.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type AdditionalToolsThe item type. Always
additional_tools.const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"
-
ID stringThe unique ID of this additional tools item.
-
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
ID stringThe unique identifier of the reasoning content.
-
Summary []ResponseReasoningItemSummaryReasoning summary content.
-
Text stringA summary of the reasoning output from the model so far.
-
Type SummaryTextThe type of the object. Always
summary_text.const SummaryTextSummaryText SummaryText = "summary_text"
-
-
Type ReasoningThe type of the object. Always
reasoning.const ReasoningReasoning Reasoning = "reasoning"
-
Content []ResponseReasoningItemContentReasoning text content.
-
Text stringThe reasoning text from the model.
-
Type ReasoningTextThe type of the reasoning text. Always
reasoning_text.const ReasoningTextReasoningText ReasoningText = "reasoning_text"
-
-
EncryptedContent stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
Status ResponseReasoningItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseReasoningItemStatusInProgress ResponseReasoningItemStatus = "in_progress" -
const ResponseReasoningItemStatusCompleted ResponseReasoningItemStatus = "completed" -
const ResponseReasoningItemStatusIncomplete ResponseReasoningItemStatus = "incomplete"
-
-
-
type ResponseCompactionItemParamResp struct{…}A compaction item generated by the
v1/responses/compactAPI.-
EncryptedContent stringThe encrypted content of the compaction summary.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
ID stringThe ID of the compaction item.
-
-
type ResponseInputItemImageGenerationCall struct{…}An image generation request made by the model.
-
ID stringThe unique ID of the image generation call.
-
Result stringThe generated image encoded in base64.
-
Status stringThe status of the image generation call.
-
const ResponseInputItemImageGenerationCallStatusInProgress ResponseInputItemImageGenerationCallStatus = "in_progress" -
const ResponseInputItemImageGenerationCallStatusCompleted ResponseInputItemImageGenerationCallStatus = "completed" -
const ResponseInputItemImageGenerationCallStatusGenerating ResponseInputItemImageGenerationCallStatus = "generating" -
const ResponseInputItemImageGenerationCallStatusFailed ResponseInputItemImageGenerationCallStatus = "failed"
-
-
Type ImageGenerationCallThe type of the image generation call. Always
image_generation_call.const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"
-
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
ID stringThe unique ID of the code interpreter tool call.
-
Code stringThe code to run, or null if not available.
-
ContainerID stringThe ID of the container used to run the code.
-
Outputs []ResponseCodeInterpreterToolCallOutputUnionThe outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
type ResponseCodeInterpreterToolCallOutputLogs struct{…}The logs output from the code interpreter.
-
Logs stringThe logs output from the code interpreter.
-
Type LogsThe type of the output. Always
logs.const LogsLogs Logs = "logs"
-
-
type ResponseCodeInterpreterToolCallOutputImage struct{…}The image output from the code interpreter.
-
Type ImageThe type of the output. Always
image.const ImageImage Image = "image"
-
URL stringThe URL of the image output from the code interpreter.
-
-
-
Status ResponseCodeInterpreterToolCallStatusThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
const ResponseCodeInterpreterToolCallStatusInProgress ResponseCodeInterpreterToolCallStatus = "in_progress" -
const ResponseCodeInterpreterToolCallStatusCompleted ResponseCodeInterpreterToolCallStatus = "completed" -
const ResponseCodeInterpreterToolCallStatusIncomplete ResponseCodeInterpreterToolCallStatus = "incomplete" -
const ResponseCodeInterpreterToolCallStatusInterpreting ResponseCodeInterpreterToolCallStatus = "interpreting" -
const ResponseCodeInterpreterToolCallStatusFailed ResponseCodeInterpreterToolCallStatus = "failed"
-
-
Type CodeInterpreterCallThe type of the code interpreter tool call. Always
code_interpreter_call.const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"
-
-
type ResponseInputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
ID stringThe unique ID of the local shell call.
-
Action ResponseInputItemLocalShellCallActionExecute a shell command on the server.
-
Command []stringThe command to run.
-
Env map[string, string]Environment variables to set for the command.
-
Type ExecThe type of the local shell action. Always
exec.const ExecExec Exec = "exec"
-
TimeoutMs int64Optional timeout in milliseconds for the command.
-
User stringOptional user to run the command as.
-
WorkingDirectory stringOptional working directory to run the command in.
-
-
CallID stringThe unique ID of the local shell tool call generated by the model.
-
Status stringThe status of the local shell call.
-
const ResponseInputItemLocalShellCallStatusInProgress ResponseInputItemLocalShellCallStatus = "in_progress" -
const ResponseInputItemLocalShellCallStatusCompleted ResponseInputItemLocalShellCallStatus = "completed" -
const ResponseInputItemLocalShellCallStatusIncomplete ResponseInputItemLocalShellCallStatus = "incomplete"
-
-
Type LocalShellCallThe type of the local shell call. Always
local_shell_call.const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"
-
-
type ResponseInputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
ID stringThe unique ID of the local shell tool call generated by the model.
-
Output stringA JSON string of the output of the local shell tool call.
-
Type LocalShellCallOutputThe type of the local shell tool call output. Always
local_shell_call_output.const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete.-
const ResponseInputItemLocalShellCallOutputStatusInProgress ResponseInputItemLocalShellCallOutputStatus = "in_progress" -
const ResponseInputItemLocalShellCallOutputStatusCompleted ResponseInputItemLocalShellCallOutputStatus = "completed" -
const ResponseInputItemLocalShellCallOutputStatusIncomplete ResponseInputItemLocalShellCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemShellCall struct{…}A tool representing a request to execute one or more shell commands.
-
Action ResponseInputItemShellCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []stringOrdered shell commands for the execution environment to run.
-
MaxOutputLength int64Maximum number of UTF-8 characters to capture from combined stdout and stderr output.
-
TimeoutMs int64Maximum wall-clock time in milliseconds to allow the shell commands to run.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Environment ResponseInputItemShellCallEnvironmentUnionThe environment to execute the shell commands in.
-
type LocalEnvironment struct{…} -
type ContainerReference struct{…}
-
-
Status stringThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseInputItemShellCallStatusInProgress ResponseInputItemShellCallStatus = "in_progress" -
const ResponseInputItemShellCallStatusCompleted ResponseInputItemShellCallStatus = "completed" -
const ResponseInputItemShellCallStatusIncomplete ResponseInputItemShellCallStatus = "incomplete"
-
-
-
type ResponseInputItemShellCallOutput struct{…}The streamed output items emitted by a shell tool call.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Output []ResponseFunctionShellCallOutputContentCaptured chunks of stdout and stderr output, along with their associated outcomes.
-
Outcome ResponseFunctionShellCallOutputContentOutcomeUnionThe exit or timeout outcome associated with this shell call.
-
type ResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellCallOutputContentOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64The exit code returned by the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringCaptured stderr output for the shell call.
-
Stdout stringCaptured stdout output for the shell call.
-
-
Type ShellCallOutputThe type of the item. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
ID stringThe unique ID of the shell tool call output. Populated when this item is returned via API.
-
MaxOutputLength int64The maximum number of UTF-8 characters captured for this shell call's combined output.
-
Status stringThe status of the shell call output.
-
const ResponseInputItemShellCallOutputStatusInProgress ResponseInputItemShellCallOutputStatus = "in_progress" -
const ResponseInputItemShellCallOutputStatusCompleted ResponseInputItemShellCallOutputStatus = "completed" -
const ResponseInputItemShellCallOutputStatusIncomplete ResponseInputItemShellCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemApplyPatchCall struct{…}A tool call representing a request to create, delete, or update files using diff patches.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseInputItemApplyPatchCallOperationUnionThe specific create, delete, or update instruction for the apply_patch tool call.
-
type ResponseInputItemApplyPatchCallOperationCreateFile struct{…}Instruction for creating a new file via the apply_patch tool.
-
Diff stringUnified diff content to apply when creating the file.
-
Path stringPath of the file to create relative to the workspace root.
-
Type CreateFileThe operation type. Always
create_file.const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseInputItemApplyPatchCallOperationDeleteFile struct{…}Instruction for deleting an existing file via the apply_patch tool.
-
Path stringPath of the file to delete relative to the workspace root.
-
Type DeleteFileThe operation type. Always
delete_file.const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseInputItemApplyPatchCallOperationUpdateFile struct{…}Instruction for updating an existing file via the apply_patch tool.
-
Diff stringUnified diff content to apply to the existing file.
-
Path stringPath of the file to update relative to the workspace root.
-
Type UpdateFileThe operation type. Always
update_file.const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status stringThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseInputItemApplyPatchCallStatusInProgress ResponseInputItemApplyPatchCallStatus = "in_progress" -
const ResponseInputItemApplyPatchCallStatusCompleted ResponseInputItemApplyPatchCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
-
type ResponseInputItemApplyPatchCallOutput struct{…}The streamed output emitted by an apply patch tool call.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status stringThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseInputItemApplyPatchCallOutputStatusCompleted ResponseInputItemApplyPatchCallOutputStatus = "completed" -
const ResponseInputItemApplyPatchCallOutputStatusFailed ResponseInputItemApplyPatchCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
Output stringOptional human-readable log text from the apply patch tool (e.g., patch results or errors).
-
-
type ResponseInputItemMcpListTools struct{…}A list of tools available on an MCP server.
-
ID stringThe unique ID of the list.
-
ServerLabel stringThe label of the MCP server.
-
Tools []ResponseInputItemMcpListToolsToolThe tools available on the server.
-
InputSchema anyThe JSON schema describing the tool's input.
-
Name stringThe name of the tool.
-
Annotations anyAdditional annotations about the tool.
-
Description stringThe description of the tool.
-
-
Type McpListToolsThe type of the item. Always
mcp_list_tools.const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
-
Error stringError message if the server could not list tools.
-
-
type ResponseInputItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
ID stringThe unique ID of the approval request.
-
Arguments stringA JSON string of arguments for the tool.
-
Name stringThe name of the tool to run.
-
ServerLabel stringThe label of the MCP server making the request.
-
Type McpApprovalRequestThe type of the item. Always
mcp_approval_request.const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"
-
-
type ResponseInputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
ApprovalRequestID stringThe ID of the approval request being answered.
-
Approve boolWhether the request was approved.
-
Type McpApprovalResponseThe type of the item. Always
mcp_approval_response.const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
-
ID stringThe unique ID of the approval response
-
Reason stringOptional reason for the decision.
-
-
type ResponseInputItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
ID stringThe unique ID of the tool call.
-
Arguments stringA JSON string of the arguments passed to the tool.
-
Name stringThe name of the tool that was run.
-
ServerLabel stringThe label of the MCP server running the tool.
-
Type McpCallThe type of the item. Always
mcp_call.const McpCallMcpCall McpCall = "mcp_call"
-
ApprovalRequestID stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
Error stringThe error from the tool call, if any.
-
Output stringThe output from the tool call.
-
Status stringThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
const ResponseInputItemMcpCallStatusInProgress ResponseInputItemMcpCallStatus = "in_progress" -
const ResponseInputItemMcpCallStatusCompleted ResponseInputItemMcpCallStatus = "completed" -
const ResponseInputItemMcpCallStatusIncomplete ResponseInputItemMcpCallStatus = "incomplete" -
const ResponseInputItemMcpCallStatusCalling ResponseInputItemMcpCallStatus = "calling" -
const ResponseInputItemMcpCallStatusFailed ResponseInputItemMcpCallStatus = "failed"
-
-
-
type ResponseCustomToolCallOutput struct{…}The output of a custom tool call from your code, being sent back to the model.
-
CallID stringThe call ID, used to map this custom tool call output to a custom tool call.
-
Output ResponseCustomToolCallOutputOutputUnionThe output from the custom tool call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseCustomToolCallOutputOutputOutputContentList []ResponseCustomToolCallOutputOutputOutputContentListItemUnionText, image, or file output of the custom tool call.
-
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
-
Type CustomToolCallOutputThe type of the custom tool call output. Always
custom_tool_call_output.const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"
-
ID stringThe unique ID of the custom tool call output in the OpenAI platform.
-
-
type ResponseCustomToolCall struct{…}A call to a custom tool created by the model.
-
CallID stringAn identifier used to map this custom tool call to a tool call output.
-
Input stringThe input for the custom tool call generated by the model.
-
Name stringThe name of the custom tool being called.
-
Type CustomToolCallThe type of the custom tool call. Always
custom_tool_call.const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"
-
ID stringThe unique ID of the custom tool call in the OpenAI platform.
-
Namespace stringThe namespace of the custom tool being called.
-
-
type ResponseInputItemCompactionTrigger struct{…}Compacts the current context. Must be the final input item.
-
Type CompactionTriggerThe type of the item. Always
compaction_trigger.const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"
-
-
type ResponseInputItemItemReference struct{…}An internal identifier for an item to reference.
-
ID stringThe ID of the item to reference.
-
Type stringThe type of item to reference. Always
item_reference.const ResponseInputItemItemReferenceTypeItemReference ResponseInputItemItemReferenceType = "item_reference"
-
-
-
Instructions stringA system (or developer) message inserted into the model's context.
When using along with
previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses. -
MaxOutputTokens int64An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
MaxToolCalls int64The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored.
-
Metadata MetadataSet of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
-
Model ResponsesModelModel ID used to generate the response, like
gpt-4ooro3. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models.-
string -
type ChatModel string-
const ChatModelGPT5_4 ChatModel = "gpt-5.4" -
const ChatModelGPT5_4Mini ChatModel = "gpt-5.4-mini" -
const ChatModelGPT5_4Nano ChatModel = "gpt-5.4-nano" -
const ChatModelGPT5_4Mini2026_03_17 ChatModel = "gpt-5.4-mini-2026-03-17" -
const ChatModelGPT5_4Nano2026_03_17 ChatModel = "gpt-5.4-nano-2026-03-17" -
const ChatModelGPT5_3ChatLatest ChatModel = "gpt-5.3-chat-latest" -
const ChatModelGPT5_2 ChatModel = "gpt-5.2" -
const ChatModelGPT5_2_2025_12_11 ChatModel = "gpt-5.2-2025-12-11" -
const ChatModelGPT5_2ChatLatest ChatModel = "gpt-5.2-chat-latest" -
const ChatModelGPT5_2Pro ChatModel = "gpt-5.2-pro" -
const ChatModelGPT5_2Pro2025_12_11 ChatModel = "gpt-5.2-pro-2025-12-11" -
const ChatModelGPT5_1 ChatModel = "gpt-5.1" -
const ChatModelGPT5_1_2025_11_13 ChatModel = "gpt-5.1-2025-11-13" -
const ChatModelGPT5_1Codex ChatModel = "gpt-5.1-codex" -
const ChatModelGPT5_1Mini ChatModel = "gpt-5.1-mini" -
const ChatModelGPT5_1ChatLatest ChatModel = "gpt-5.1-chat-latest" -
const ChatModelGPT5 ChatModel = "gpt-5" -
const ChatModelGPT5Mini ChatModel = "gpt-5-mini" -
const ChatModelGPT5Nano ChatModel = "gpt-5-nano" -
const ChatModelGPT5_2025_08_07 ChatModel = "gpt-5-2025-08-07" -
const ChatModelGPT5Mini2025_08_07 ChatModel = "gpt-5-mini-2025-08-07" -
const ChatModelGPT5Nano2025_08_07 ChatModel = "gpt-5-nano-2025-08-07" -
const ChatModelGPT5ChatLatest ChatModel = "gpt-5-chat-latest" -
const ChatModelGPT4_1 ChatModel = "gpt-4.1" -
const ChatModelGPT4_1Mini ChatModel = "gpt-4.1-mini" -
const ChatModelGPT4_1Nano ChatModel = "gpt-4.1-nano" -
const ChatModelGPT4_1_2025_04_14 ChatModel = "gpt-4.1-2025-04-14" -
const ChatModelGPT4_1Mini2025_04_14 ChatModel = "gpt-4.1-mini-2025-04-14" -
const ChatModelGPT4_1Nano2025_04_14 ChatModel = "gpt-4.1-nano-2025-04-14" -
const ChatModelO4Mini ChatModel = "o4-mini" -
const ChatModelO4Mini2025_04_16 ChatModel = "o4-mini-2025-04-16" -
const ChatModelO3 ChatModel = "o3" -
const ChatModelO3_2025_04_16 ChatModel = "o3-2025-04-16" -
const ChatModelO3Mini ChatModel = "o3-mini" -
const ChatModelO3Mini2025_01_31 ChatModel = "o3-mini-2025-01-31" -
const ChatModelO1 ChatModel = "o1" -
const ChatModelO1_2024_12_17 ChatModel = "o1-2024-12-17" -
const ChatModelO1Preview ChatModel = "o1-preview" -
const ChatModelO1Preview2024_09_12 ChatModel = "o1-preview-2024-09-12" -
const ChatModelO1Mini ChatModel = "o1-mini" -
const ChatModelO1Mini2024_09_12 ChatModel = "o1-mini-2024-09-12" -
const ChatModelGPT4o ChatModel = "gpt-4o" -
const ChatModelGPT4o2024_11_20 ChatModel = "gpt-4o-2024-11-20" -
const ChatModelGPT4o2024_08_06 ChatModel = "gpt-4o-2024-08-06" -
const ChatModelGPT4o2024_05_13 ChatModel = "gpt-4o-2024-05-13" -
const ChatModelGPT4oAudioPreview ChatModel = "gpt-4o-audio-preview" -
const ChatModelGPT4oAudioPreview2024_10_01 ChatModel = "gpt-4o-audio-preview-2024-10-01" -
const ChatModelGPT4oAudioPreview2024_12_17 ChatModel = "gpt-4o-audio-preview-2024-12-17" -
const ChatModelGPT4oAudioPreview2025_06_03 ChatModel = "gpt-4o-audio-preview-2025-06-03" -
const ChatModelGPT4oMiniAudioPreview ChatModel = "gpt-4o-mini-audio-preview" -
const ChatModelGPT4oMiniAudioPreview2024_12_17 ChatModel = "gpt-4o-mini-audio-preview-2024-12-17" -
const ChatModelGPT4oSearchPreview ChatModel = "gpt-4o-search-preview" -
const ChatModelGPT4oMiniSearchPreview ChatModel = "gpt-4o-mini-search-preview" -
const ChatModelGPT4oSearchPreview2025_03_11 ChatModel = "gpt-4o-search-preview-2025-03-11" -
const ChatModelGPT4oMiniSearchPreview2025_03_11 ChatModel = "gpt-4o-mini-search-preview-2025-03-11" -
const ChatModelChatgpt4oLatest ChatModel = "chatgpt-4o-latest" -
const ChatModelCodexMiniLatest ChatModel = "codex-mini-latest" -
const ChatModelGPT4oMini ChatModel = "gpt-4o-mini" -
const ChatModelGPT4oMini2024_07_18 ChatModel = "gpt-4o-mini-2024-07-18" -
const ChatModelGPT4Turbo ChatModel = "gpt-4-turbo" -
const ChatModelGPT4Turbo2024_04_09 ChatModel = "gpt-4-turbo-2024-04-09" -
const ChatModelGPT4_0125Preview ChatModel = "gpt-4-0125-preview" -
const ChatModelGPT4TurboPreview ChatModel = "gpt-4-turbo-preview" -
const ChatModelGPT4_1106Preview ChatModel = "gpt-4-1106-preview" -
const ChatModelGPT4VisionPreview ChatModel = "gpt-4-vision-preview" -
const ChatModelGPT4 ChatModel = "gpt-4" -
const ChatModelGPT4_0314 ChatModel = "gpt-4-0314" -
const ChatModelGPT4_0613 ChatModel = "gpt-4-0613" -
const ChatModelGPT4_32k ChatModel = "gpt-4-32k" -
const ChatModelGPT4_32k0314 ChatModel = "gpt-4-32k-0314" -
const ChatModelGPT4_32k0613 ChatModel = "gpt-4-32k-0613" -
const ChatModelGPT3_5Turbo ChatModel = "gpt-3.5-turbo" -
const ChatModelGPT3_5Turbo16k ChatModel = "gpt-3.5-turbo-16k" -
const ChatModelGPT3_5Turbo0301 ChatModel = "gpt-3.5-turbo-0301" -
const ChatModelGPT3_5Turbo0613 ChatModel = "gpt-3.5-turbo-0613" -
const ChatModelGPT3_5Turbo1106 ChatModel = "gpt-3.5-turbo-1106" -
const ChatModelGPT3_5Turbo0125 ChatModel = "gpt-3.5-turbo-0125" -
const ChatModelGPT3_5Turbo16k0613 ChatModel = "gpt-3.5-turbo-16k-0613"
-
-
type ResponsesModel string-
const ResponsesModelO1Pro ResponsesModel = "o1-pro" -
const ResponsesModelO1Pro2025_03_19 ResponsesModel = "o1-pro-2025-03-19" -
const ResponsesModelO3Pro ResponsesModel = "o3-pro" -
const ResponsesModelO3Pro2025_06_10 ResponsesModel = "o3-pro-2025-06-10" -
const ResponsesModelO3DeepResearch ResponsesModel = "o3-deep-research" -
const ResponsesModelO3DeepResearch2025_06_26 ResponsesModel = "o3-deep-research-2025-06-26" -
const ResponsesModelO4MiniDeepResearch ResponsesModel = "o4-mini-deep-research" -
const ResponsesModelO4MiniDeepResearch2025_06_26 ResponsesModel = "o4-mini-deep-research-2025-06-26" -
const ResponsesModelComputerUsePreview ResponsesModel = "computer-use-preview" -
const ResponsesModelComputerUsePreview2025_03_11 ResponsesModel = "computer-use-preview-2025-03-11" -
const ResponsesModelGPT5Codex ResponsesModel = "gpt-5-codex" -
const ResponsesModelGPT5Pro ResponsesModel = "gpt-5-pro" -
const ResponsesModelGPT5Pro2025_10_06 ResponsesModel = "gpt-5-pro-2025-10-06" -
const ResponsesModelGPT5_1CodexMax ResponsesModel = "gpt-5.1-codex-max"
-
-
-
Moderation ResponsesClientEventModerationConfiguration for running moderation on the input and output of this response.
-
Model stringThe moderation model to use for moderated completions, e.g. 'omni-moderation-latest'.
-
-
ParallelToolCalls boolWhether to allow the model to run tool calls in parallel.
-
PreviousResponseID stringThe unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about conversation state. Cannot be used in conjunction with
conversation. -
Prompt ResponsePromptReference to a prompt template and its variables. Learn more.
-
ID stringThe unique identifier of the prompt template to use.
-
Variables map[string, ResponsePromptVariableUnion]Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files.
-
string -
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
Version stringOptional version of the prompt template.
-
-
PromptCacheKey stringUsed by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more. -
PromptCacheRetention ResponsesClientEventPromptCacheRetentionThe retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. Forgpt-5.5,gpt-5.5-pro, and future models, only24his supported.For older models that support both
in_memoryand24h, the default depends on your organization's data retention policy:-
Organizations without ZDR enabled default to
24h. -
Organizations with ZDR enabled default to
in_memorywhenprompt_cache_retentionis not specified. -
const ResponsesClientEventPromptCacheRetentionInMemory ResponsesClientEventPromptCacheRetention = "in_memory" -
const ResponsesClientEventPromptCacheRetention24h ResponsesClientEventPromptCacheRetention = "24h"
-
-
Reasoning Reasoninggpt-5 and o-series models only
Configuration options for reasoning models.
-
Context ReasoningContextControls which reasoning items are rendered back to the model on later turns. When returned on a response, this is the effective reasoning context mode used for the response.
-
const ReasoningContextAuto ReasoningContext = "auto" -
const ReasoningContextCurrentTurn ReasoningContext = "current_turn" -
const ReasoningContextAllTurns ReasoningContext = "all_turns"
-
-
Effort ReasoningEffortConstrains effort on reasoning for reasoning models. Currently supported values are
none,minimal,low,medium,high, andxhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.-
gpt-5.1defaults tonone, which does not perform reasoning. The supported reasoning values forgpt-5.1arenone,low,medium, andhigh. Tool calls are supported for all reasoning values in gpt-5.1. -
All models before
gpt-5.1default tomediumreasoning effort, and do not supportnone. -
The
gpt-5-promodel defaults to (and only supports)highreasoning effort. -
xhighis supported for all models aftergpt-5.1-codex-max. -
const ReasoningEffortNone ReasoningEffort = "none" -
const ReasoningEffortMinimal ReasoningEffort = "minimal" -
const ReasoningEffortLow ReasoningEffort = "low" -
const ReasoningEffortMedium ReasoningEffort = "medium" -
const ReasoningEffortHigh ReasoningEffort = "high" -
const ReasoningEffortXhigh ReasoningEffort = "xhigh"
-
-
GenerateSummary ReasoningGenerateSummaryDeprecated: use
summaryinstead.A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.-
const ReasoningGenerateSummaryAuto ReasoningGenerateSummary = "auto" -
const ReasoningGenerateSummaryConcise ReasoningGenerateSummary = "concise" -
const ReasoningGenerateSummaryDetailed ReasoningGenerateSummary = "detailed"
-
-
Summary ReasoningSummaryA summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.conciseis supported forcomputer-use-previewmodels and all reasoning models aftergpt-5.-
const ReasoningSummaryAuto ReasoningSummary = "auto" -
const ReasoningSummaryConcise ReasoningSummary = "concise" -
const ReasoningSummaryDetailed ReasoningSummary = "detailed"
-
-
-
SafetyIdentifier stringA stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
ServiceTier ResponsesClientEventServiceTierSpecifies the processing type used for serving the request.
- If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'.
- If set to 'default', then the request will be processed with the standard pricing and performance for the selected model.
- If set to 'flex' or 'priority', then the request will be processed with the corresponding service tier.
- When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.-
const ResponsesClientEventServiceTierAuto ResponsesClientEventServiceTier = "auto" -
const ResponsesClientEventServiceTierDefault ResponsesClientEventServiceTier = "default" -
const ResponsesClientEventServiceTierFlex ResponsesClientEventServiceTier = "flex" -
const ResponsesClientEventServiceTierScale ResponsesClientEventServiceTier = "scale" -
const ResponsesClientEventServiceTierPriority ResponsesClientEventServiceTier = "priority"
-
Store boolWhether to store the generated model response for later retrieval via API.
-
Stream boolIf set to true, the model response data will be streamed to the client as it is generated using server-sent events. See the Streaming section below for more information.
-
StreamOptions ResponsesClientEventStreamOptionsOptions for streaming responses. Only set this when you set
stream: true.-
IncludeObfuscation boolWhen true, stream obfuscation will be enabled. Stream obfuscation adds random characters to an
obfuscationfield on streaming delta events to normalize payload sizes as a mitigation to certain side-channel attacks. These obfuscation fields are included by default, but add a small amount of overhead to the data stream. You can setinclude_obfuscationto false to optimize for bandwidth if you trust the network links between your application and the OpenAI API.
-
-
Temperature float64What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or
top_pbut not both. -
Text ResponseTextConfigConfiguration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
Format ResponseFormatTextConfigUnionAn object specifying the format that the model must output.
Configuring
{ "type": "json_schema" }enables Structured Outputs, which ensures the model will match your supplied JSON schema. Learn more in the Structured Outputs guide.The default format is
{ "type": "text" }with no additional options.Not recommended for gpt-4o and newer models:
Setting to
{ "type": "json_object" }enables the older JSON mode, which ensures the message the model generates is valid JSON. Usingjson_schemais preferred for models that support it.-
type ResponseFormatText struct{…}Default response format. Used to generate text responses.
-
Type TextThe type of response format being defined. Always
text.const TextText Text = "text"
-
-
type ResponseFormatTextJSONSchemaConfig struct{…}JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
Name stringThe name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
-
Schema map[string, any]The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
-
Type JSONSchemaThe type of response format being defined. Always
json_schema.const JSONSchemaJSONSchema JSONSchema = "json_schema"
-
Description stringA description of what the response format is for, used by the model to determine how to respond in the format.
-
Strict boolWhether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the
schemafield. Only a subset of JSON Schema is supported whenstrictistrue. To learn more, read the Structured Outputs guide.
-
-
type ResponseFormatJSONObject struct{…}JSON object response format. An older method of generating JSON responses. Using
json_schemais 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 JSONObjectThe type of response format being defined. Always
json_object.const JSONObjectJSONObject JSONObject = "json_object"
-
-
-
Verbosity ResponseTextConfigVerbosityConstrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses. Currently supported values are
low,medium, andhigh.-
const ResponseTextConfigVerbosityLow ResponseTextConfigVerbosity = "low" -
const ResponseTextConfigVerbosityMedium ResponseTextConfigVerbosity = "medium" -
const ResponseTextConfigVerbosityHigh ResponseTextConfigVerbosity = "high"
-
-
ToolChoice ResponsesClientEventToolChoiceUnionHow the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call.-
type ToolChoiceOptions stringControls which (if any) tool is called by the model.
nonemeans the model will not call any tool and instead generates a message.automeans the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools.-
const ToolChoiceOptionsNone ToolChoiceOptions = "none" -
const ToolChoiceOptionsAuto ToolChoiceOptions = "auto" -
const ToolChoiceOptionsRequired ToolChoiceOptions = "required"
-
-
type ToolChoiceAllowed struct{…}Constrains the tools available to the model to a pre-defined set.
-
Mode ToolChoiceAllowedModeConstrains the tools available to the model to a pre-defined set.
autoallows the model to pick from among the allowed tools and generate a message.requiredrequires the model to call one or more of the allowed tools.-
const ToolChoiceAllowedModeAuto ToolChoiceAllowedMode = "auto" -
const ToolChoiceAllowedModeRequired ToolChoiceAllowedMode = "required"
-
-
Tools []map[string, any]A list of tool definitions that the model should be allowed to call.
For the Responses API, the list of tool definitions might look like:
[ { "type": "function", "name": "get_weather" }, { "type": "mcp", "server_label": "deepwiki" }, { "type": "image_generation" } ] -
Type AllowedToolsAllowed tool configuration type. Always
allowed_tools.const AllowedToolsAllowedTools AllowedTools = "allowed_tools"
-
-
type ToolChoiceTypes struct{…}Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
-
Type ToolChoiceTypesTypeThe type of hosted tool the model should to use. Learn more about built-in tools.
Allowed values are:
-
file_search -
web_search_preview -
computer -
computer_use_preview -
computer_use -
code_interpreter -
image_generation -
const ToolChoiceTypesTypeFileSearch ToolChoiceTypesType = "file_search" -
const ToolChoiceTypesTypeWebSearchPreview ToolChoiceTypesType = "web_search_preview" -
const ToolChoiceTypesTypeComputer ToolChoiceTypesType = "computer" -
const ToolChoiceTypesTypeComputerUsePreview ToolChoiceTypesType = "computer_use_preview" -
const ToolChoiceTypesTypeComputerUse ToolChoiceTypesType = "computer_use" -
const ToolChoiceTypesTypeWebSearchPreview2025_03_11 ToolChoiceTypesType = "web_search_preview_2025_03_11" -
const ToolChoiceTypesTypeImageGeneration ToolChoiceTypesType = "image_generation" -
const ToolChoiceTypesTypeCodeInterpreter ToolChoiceTypesType = "code_interpreter"
-
-
-
type ToolChoiceFunction struct{…}Use this option to force the model to call a specific function.
-
Name stringThe name of the function to call.
-
Type FunctionFor function calling, the type is always
function.const FunctionFunction Function = "function"
-
-
type ToolChoiceMcp struct{…}Use this option to force the model to call a specific tool on a remote MCP server.
-
ServerLabel stringThe label of the MCP server to use.
-
Type McpFor MCP tools, the type is always
mcp.const McpMcp Mcp = "mcp"
-
Name stringThe name of the tool to call on the server.
-
-
type ToolChoiceCustom struct{…}Use this option to force the model to call a specific custom tool.
-
Name stringThe name of the custom tool to call.
-
Type CustomFor custom tool calling, the type is always
custom.const CustomCustom Custom = "custom"
-
-
type ToolChoiceApplyPatch struct{…}Forces the model to call the apply_patch tool when executing a tool call.
-
Type ApplyPatchThe tool to call. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
type ToolChoiceShell struct{…}Forces the model to call the shell tool when a tool call is required.
-
Type ShellThe tool to call. Always
shell.const ShellShell Shell = "shell"
-
-
-
Tools []ToolUnionAn array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.We support the following categories of tools:
-
Built-in tools: Tools that are provided by OpenAI that extend the model's capabilities, like web search or file search. Learn more about built-in tools.
-
MCP Tools: Integrations with third-party systems via custom MCP servers or predefined connectors such as Google Drive and SharePoint. Learn more about MCP Tools.
-
Function calls (custom tools): Functions that are defined by you, enabling the model to call your own code with strongly typed arguments and outputs. Learn more about function calling. You can also use custom tools to call your own code.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
TopLogprobs int64An integer between 0 and 20 specifying the maximum number of most likely tokens to return at each token position, each with an associated log probability. In some cases, the number of returned tokens may be fewer than requested.
-
TopP float64An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
We generally recommend altering this or
temperaturebut not both. -
Truncation ResponsesClientEventTruncationThe truncation strategy to use for the model response.
-
auto: If the input to this Response exceeds the model's context window size, the model will truncate the response to fit the context window by dropping items from the beginning of the conversation. -
disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error. -
const ResponsesClientEventTruncationAuto ResponsesClientEventTruncation = "auto" -
const ResponsesClientEventTruncationDisabled ResponsesClientEventTruncation = "disabled"
-
-
User stringThis field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead to maintain caching optimizations. A stable identifier for your end-users. Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. Learn more.
-
Responses Server Event
-
type ResponsesServerEventUnion interface{…}Server events emitted by the Responses WebSocket server.
-
type ResponseAudioDeltaEvent struct{…}Emitted when there is a partial audio response.
-
Delta stringA chunk of Base64 encoded response audio bytes.
-
SequenceNumber int64A sequence number for this chunk of the stream response.
-
Type ResponseAudioDeltaThe type of the event. Always
response.audio.delta.const ResponseAudioDeltaResponseAudioDelta ResponseAudioDelta = "response.audio.delta"
-
-
type ResponseAudioDoneEvent struct{…}Emitted when the audio response is complete.
-
SequenceNumber int64The sequence number of the delta.
-
Type ResponseAudioDoneThe type of the event. Always
response.audio.done.const ResponseAudioDoneResponseAudioDone ResponseAudioDone = "response.audio.done"
-
-
type ResponseAudioTranscriptDeltaEvent struct{…}Emitted when there is a partial transcript of audio.
-
Delta stringThe partial transcript of the audio response.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseAudioTranscriptDeltaThe type of the event. Always
response.audio.transcript.delta.const ResponseAudioTranscriptDeltaResponseAudioTranscriptDelta ResponseAudioTranscriptDelta = "response.audio.transcript.delta"
-
-
type ResponseAudioTranscriptDoneEvent struct{…}Emitted when the full audio transcript is completed.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseAudioTranscriptDoneThe type of the event. Always
response.audio.transcript.done.const ResponseAudioTranscriptDoneResponseAudioTranscriptDone ResponseAudioTranscriptDone = "response.audio.transcript.done"
-
-
type ResponseCodeInterpreterCallCodeDeltaEvent struct{…}Emitted when a partial code snippet is streamed by the code interpreter.
-
Delta stringThe partial code snippet being streamed by the code interpreter.
-
ItemID stringThe unique identifier of the code interpreter tool call item.
-
OutputIndex int64The index of the output item in the response for which the code is being streamed.
-
SequenceNumber int64The sequence number of this event, used to order streaming events.
-
Type ResponseCodeInterpreterCallCodeDeltaThe type of the event. Always
response.code_interpreter_call_code.delta.const ResponseCodeInterpreterCallCodeDeltaResponseCodeInterpreterCallCodeDelta ResponseCodeInterpreterCallCodeDelta = "response.code_interpreter_call_code.delta"
-
-
type ResponseCodeInterpreterCallCodeDoneEvent struct{…}Emitted when the code snippet is finalized by the code interpreter.
-
Code stringThe final code snippet output by the code interpreter.
-
ItemID stringThe unique identifier of the code interpreter tool call item.
-
OutputIndex int64The index of the output item in the response for which the code is finalized.
-
SequenceNumber int64The sequence number of this event, used to order streaming events.
-
Type ResponseCodeInterpreterCallCodeDoneThe type of the event. Always
response.code_interpreter_call_code.done.const ResponseCodeInterpreterCallCodeDoneResponseCodeInterpreterCallCodeDone ResponseCodeInterpreterCallCodeDone = "response.code_interpreter_call_code.done"
-
-
type ResponseCodeInterpreterCallCompletedEvent struct{…}Emitted when the code interpreter call is completed.
-
ItemID stringThe unique identifier of the code interpreter tool call item.
-
OutputIndex int64The index of the output item in the response for which the code interpreter call is completed.
-
SequenceNumber int64The sequence number of this event, used to order streaming events.
-
Type ResponseCodeInterpreterCallCompletedThe type of the event. Always
response.code_interpreter_call.completed.const ResponseCodeInterpreterCallCompletedResponseCodeInterpreterCallCompleted ResponseCodeInterpreterCallCompleted = "response.code_interpreter_call.completed"
-
-
type ResponseCodeInterpreterCallInProgressEvent struct{…}Emitted when a code interpreter call is in progress.
-
ItemID stringThe unique identifier of the code interpreter tool call item.
-
OutputIndex int64The index of the output item in the response for which the code interpreter call is in progress.
-
SequenceNumber int64The sequence number of this event, used to order streaming events.
-
Type ResponseCodeInterpreterCallInProgressThe type of the event. Always
response.code_interpreter_call.in_progress.const ResponseCodeInterpreterCallInProgressResponseCodeInterpreterCallInProgress ResponseCodeInterpreterCallInProgress = "response.code_interpreter_call.in_progress"
-
-
type ResponseCodeInterpreterCallInterpretingEvent struct{…}Emitted when the code interpreter is actively interpreting the code snippet.
-
ItemID stringThe unique identifier of the code interpreter tool call item.
-
OutputIndex int64The index of the output item in the response for which the code interpreter is interpreting code.
-
SequenceNumber int64The sequence number of this event, used to order streaming events.
-
Type ResponseCodeInterpreterCallInterpretingThe type of the event. Always
response.code_interpreter_call.interpreting.const ResponseCodeInterpreterCallInterpretingResponseCodeInterpreterCallInterpreting ResponseCodeInterpreterCallInterpreting = "response.code_interpreter_call.interpreting"
-
-
type ResponseCompletedEvent struct{…}Emitted when the model response is complete.
-
Response ResponseProperties of the completed response.
-
ID stringUnique identifier for this Response.
-
CreatedAt float64Unix timestamp (in seconds) of when this Response was created.
-
Error ResponseErrorAn error object returned when the model fails to generate a Response.
-
Code ResponseErrorCodeThe error code for the response.
-
const ResponseErrorCodeServerError ResponseErrorCode = "server_error" -
const ResponseErrorCodeRateLimitExceeded ResponseErrorCode = "rate_limit_exceeded" -
const ResponseErrorCodeInvalidPrompt ResponseErrorCode = "invalid_prompt" -
const ResponseErrorCodeVectorStoreTimeout ResponseErrorCode = "vector_store_timeout" -
const ResponseErrorCodeInvalidImage ResponseErrorCode = "invalid_image" -
const ResponseErrorCodeInvalidImageFormat ResponseErrorCode = "invalid_image_format" -
const ResponseErrorCodeInvalidBase64Image ResponseErrorCode = "invalid_base64_image" -
const ResponseErrorCodeInvalidImageURL ResponseErrorCode = "invalid_image_url" -
const ResponseErrorCodeImageTooLarge ResponseErrorCode = "image_too_large" -
const ResponseErrorCodeImageTooSmall ResponseErrorCode = "image_too_small" -
const ResponseErrorCodeImageParseError ResponseErrorCode = "image_parse_error" -
const ResponseErrorCodeImageContentPolicyViolation ResponseErrorCode = "image_content_policy_violation" -
const ResponseErrorCodeInvalidImageMode ResponseErrorCode = "invalid_image_mode" -
const ResponseErrorCodeImageFileTooLarge ResponseErrorCode = "image_file_too_large" -
const ResponseErrorCodeUnsupportedImageMediaType ResponseErrorCode = "unsupported_image_media_type" -
const ResponseErrorCodeEmptyImageFile ResponseErrorCode = "empty_image_file" -
const ResponseErrorCodeFailedToDownloadImage ResponseErrorCode = "failed_to_download_image" -
const ResponseErrorCodeImageFileNotFound ResponseErrorCode = "image_file_not_found"
-
-
Message stringA human-readable description of the error.
-
-
IncompleteDetails ResponseIncompleteDetailsDetails about why the response is incomplete.
-
Reason stringThe reason why the response is incomplete.
-
const ResponseIncompleteDetailsReasonMaxOutputTokens ResponseIncompleteDetailsReason = "max_output_tokens" -
const ResponseIncompleteDetailsReasonContentFilter ResponseIncompleteDetailsReason = "content_filter"
-
-
-
Instructions ResponseInstructionsUnionA system (or developer) message inserted into the model's context.
When using along with
previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses.-
string -
type ResponseInstructionsInputItemList []ResponseInputItemUnionA list of one or many input items to the model, containing different content types.
-
type EasyInputMessage struct{…}A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.-
Content EasyInputMessageContentUnionText, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
-
string -
type ResponseInputMessageContentList []ResponseInputContentUnionA list of one or many input items to the model, containing different content types.
-
type ResponseInputText struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
Detail ResponseInputImageDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageDetailLow ResponseInputImageDetail = "low" -
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high" -
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto" -
const ResponseInputImageDetailOriginal ResponseInputImageDetail = "original"
-
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFile struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileDetailLow ResponseInputFileDetail = "low" -
const ResponseInputFileDetailHigh ResponseInputFileDetail = "high"
-
-
FileData stringThe content of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Role EasyInputMessageRoleThe role of the message input. One of
user,assistant,system, ordeveloper.-
const EasyInputMessageRoleUser EasyInputMessageRole = "user" -
const EasyInputMessageRoleAssistant EasyInputMessageRole = "assistant" -
const EasyInputMessageRoleSystem EasyInputMessageRole = "system" -
const EasyInputMessageRoleDeveloper EasyInputMessageRole = "developer"
-
-
Phase EasyInputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const EasyInputMessagePhaseCommentary EasyInputMessagePhase = "commentary" -
const EasyInputMessagePhaseFinalAnswer EasyInputMessagePhase = "final_answer"
-
-
Type EasyInputMessageTypeThe type of the message input. Always
message.const EasyInputMessageTypeMessage EasyInputMessageType = "message"
-
-
type ResponseInputItemMessage struct{…}A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole.-
Content ResponseInputMessageContentListA list of one or many input items to the model, containing different content types.
-
Role stringThe role of the message input. One of
user,system, ordeveloper.-
const ResponseInputItemMessageRoleUser ResponseInputItemMessageRole = "user" -
const ResponseInputItemMessageRoleSystem ResponseInputItemMessageRole = "system" -
const ResponseInputItemMessageRoleDeveloper ResponseInputItemMessageRole = "developer"
-
-
Status stringThe status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputItemMessageStatusInProgress ResponseInputItemMessageStatus = "in_progress" -
const ResponseInputItemMessageStatusCompleted ResponseInputItemMessageStatus = "completed" -
const ResponseInputItemMessageStatusIncomplete ResponseInputItemMessageStatus = "incomplete"
-
-
Type stringThe type of the message input. Always set to
message.const ResponseInputItemMessageTypeMessage ResponseInputItemMessageType = "message"
-
-
type ResponseOutputMessage struct{…}An output message from the model.
-
ID stringThe unique ID of the output message.
-
Content []ResponseOutputMessageContentUnionThe content of the output message.
-
type ResponseOutputText struct{…}A text output from the model.
-
Annotations []ResponseOutputTextAnnotationUnionThe annotations of the text output.
-
type ResponseOutputTextAnnotationFileCitation struct{…}A citation to a file.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the file cited.
-
Index int64The index of the file in the list of files.
-
Type FileCitationThe type of the file citation. Always
file_citation.const FileCitationFileCitation FileCitation = "file_citation"
-
-
type ResponseOutputTextAnnotationURLCitation struct{…}A citation for a web resource used to generate a model response.
-
EndIndex int64The index of the last character of the URL citation in the message.
-
StartIndex int64The index of the first character of the URL citation in the message.
-
Title stringThe title of the web resource.
-
Type URLCitationThe type of the URL citation. Always
url_citation.const URLCitationURLCitation URLCitation = "url_citation"
-
URL stringThe URL of the web resource.
-
-
type ResponseOutputTextAnnotationContainerFileCitation struct{…}A citation for a container file used to generate a model response.
-
ContainerID stringThe ID of the container file.
-
EndIndex int64The index of the last character of the container file citation in the message.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the container file cited.
-
StartIndex int64The index of the first character of the container file citation in the message.
-
Type ContainerFileCitationThe type of the container file citation. Always
container_file_citation.const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"
-
-
type ResponseOutputTextAnnotationFilePath struct{…}A path to a file.
-
FileID stringThe ID of the file.
-
Index int64The index of the file in the list of files.
-
Type FilePathThe type of the file path. Always
file_path.const FilePathFilePath FilePath = "file_path"
-
-
-
Text stringThe text output from the model.
-
Type OutputTextThe type of the output text. Always
output_text.const OutputTextOutputText OutputText = "output_text"
-
Logprobs []ResponseOutputTextLogprob-
Token string -
Bytes []int64 -
Logprob float64 -
TopLogprobs []ResponseOutputTextLogprobTopLogprob-
Token string -
Bytes []int64 -
Logprob float64
-
-
-
-
type ResponseOutputRefusal struct{…}A refusal from the model.
-
Refusal stringThe refusal explanation from the model.
-
Type RefusalThe type of the refusal. Always
refusal.const RefusalRefusal Refusal = "refusal"
-
-
-
Role AssistantThe role of the output message. Always
assistant.const AssistantAssistant Assistant = "assistant"
-
Status ResponseOutputMessageStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseOutputMessageStatusInProgress ResponseOutputMessageStatus = "in_progress" -
const ResponseOutputMessageStatusCompleted ResponseOutputMessageStatus = "completed" -
const ResponseOutputMessageStatusIncomplete ResponseOutputMessageStatus = "incomplete"
-
-
Type MessageThe type of the output message. Always
message.const MessageMessage Message = "message"
-
Phase ResponseOutputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const ResponseOutputMessagePhaseCommentary ResponseOutputMessagePhase = "commentary" -
const ResponseOutputMessagePhaseFinalAnswer ResponseOutputMessagePhase = "final_answer"
-
-
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
ID stringThe unique ID of the file search tool call.
-
Queries []stringThe queries used to search for files.
-
Status ResponseFileSearchToolCallStatusThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
const ResponseFileSearchToolCallStatusInProgress ResponseFileSearchToolCallStatus = "in_progress" -
const ResponseFileSearchToolCallStatusSearching ResponseFileSearchToolCallStatus = "searching" -
const ResponseFileSearchToolCallStatusCompleted ResponseFileSearchToolCallStatus = "completed" -
const ResponseFileSearchToolCallStatusIncomplete ResponseFileSearchToolCallStatus = "incomplete" -
const ResponseFileSearchToolCallStatusFailed ResponseFileSearchToolCallStatus = "failed"
-
-
Type FileSearchCallThe type of the file search tool call. Always
file_search_call.const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"
-
Results []ResponseFileSearchToolCallResultThe results of the file search tool call.
-
Attributes map[string, ResponseFileSearchToolCallResultAttributeUnion]Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.
-
string -
float64 -
bool
-
-
FileID stringThe unique ID of the file.
-
Filename stringThe name of the file.
-
Score float64The relevance score of the file - a value between 0 and 1.
-
Text stringThe text that was retrieved from the file.
-
-
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
ID stringThe unique ID of the computer call.
-
CallID stringAn identifier used when responding to the tool call with output.
-
PendingSafetyChecks []ResponseComputerToolCallPendingSafetyCheckThe pending safety checks for the computer call.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status ResponseComputerToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseComputerToolCallStatusInProgress ResponseComputerToolCallStatus = "in_progress" -
const ResponseComputerToolCallStatusCompleted ResponseComputerToolCallStatus = "completed" -
const ResponseComputerToolCallStatusIncomplete ResponseComputerToolCallStatus = "incomplete"
-
-
Type ResponseComputerToolCallTypeThe type of the computer call. Always
computer_call.const ResponseComputerToolCallTypeComputerCall ResponseComputerToolCallType = "computer_call"
-
Action ResponseComputerToolCallActionUnionA click action.
-
type ResponseComputerToolCallActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ResponseComputerToolCallActionClickButtonLeft ResponseComputerToolCallActionClickButton = "left" -
const ResponseComputerToolCallActionClickButtonRight ResponseComputerToolCallActionClickButton = "right" -
const ResponseComputerToolCallActionClickButtonWheel ResponseComputerToolCallActionClickButton = "wheel" -
const ResponseComputerToolCallActionClickButtonBack ResponseComputerToolCallActionClickButton = "back" -
const ResponseComputerToolCallActionClickButtonForward ResponseComputerToolCallActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ResponseComputerToolCallActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ResponseComputerToolCallActionDrag struct{…}A drag action.
-
Path []ResponseComputerToolCallActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ResponseComputerToolCallActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ResponseComputerToolCallActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ResponseComputerToolCallActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ResponseComputerToolCallActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ResponseComputerToolCallActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ResponseComputerToolCallActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
Actions ComputerActionListFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
type ComputerActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ComputerActionClickButtonLeft ComputerActionClickButton = "left" -
const ComputerActionClickButtonRight ComputerActionClickButton = "right" -
const ComputerActionClickButtonWheel ComputerActionClickButton = "wheel" -
const ComputerActionClickButtonBack ComputerActionClickButton = "back" -
const ComputerActionClickButtonForward ComputerActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ComputerActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ComputerActionDrag struct{…}A drag action.
-
Path []ComputerActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ComputerActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ComputerActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ComputerActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ComputerActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ComputerActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ComputerActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
-
type ResponseInputItemComputerCallOutput struct{…}The output of a computer tool call.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Type ComputerScreenshotSpecifies the event type. For a computer screenshot, this property is always set to
computer_screenshot.const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"
-
FileID stringThe identifier of an uploaded file that contains the screenshot.
-
ImageURL stringThe URL of the screenshot image.
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
ID stringThe ID of the computer tool call output.
-
AcknowledgedSafetyChecks []ResponseInputItemComputerCallOutputAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status stringThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseInputItemComputerCallOutputStatusInProgress ResponseInputItemComputerCallOutputStatus = "in_progress" -
const ResponseInputItemComputerCallOutputStatusCompleted ResponseInputItemComputerCallOutputStatus = "completed" -
const ResponseInputItemComputerCallOutputStatusIncomplete ResponseInputItemComputerCallOutputStatus = "incomplete"
-
-
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
ID stringThe unique ID of the web search tool call.
-
Action ResponseFunctionWebSearchActionUnionAn object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
type ResponseFunctionWebSearchActionSearch struct{…}Action type "search" - Performs a web search query.
-
Type SearchThe action type.
const SearchSearch Search = "search"
-
Queries []stringThe search queries.
-
Query stringThe search query.
-
Sources []ResponseFunctionWebSearchActionSearchSourceThe sources used in the search.
-
Type URLThe type of source. Always
url.const URLURL URL = "url"
-
URL stringThe URL of the source.
-
-
-
type ResponseFunctionWebSearchActionOpenPage struct{…}Action type "open_page" - Opens a specific URL from search results.
-
Type OpenPageThe action type.
const OpenPageOpenPage OpenPage = "open_page"
-
URL stringThe URL opened by the model.
-
-
type ResponseFunctionWebSearchActionFindInPage struct{…}Action type "find_in_page": Searches for a pattern within a loaded page.
-
Pattern stringThe pattern or text to search for within the page.
-
Type FindInPageThe action type.
const FindInPageFindInPage FindInPage = "find_in_page"
-
URL stringThe URL of the page searched for the pattern.
-
-
-
Status ResponseFunctionWebSearchStatusThe status of the web search tool call.
-
const ResponseFunctionWebSearchStatusInProgress ResponseFunctionWebSearchStatus = "in_progress" -
const ResponseFunctionWebSearchStatusSearching ResponseFunctionWebSearchStatus = "searching" -
const ResponseFunctionWebSearchStatusCompleted ResponseFunctionWebSearchStatus = "completed" -
const ResponseFunctionWebSearchStatusFailed ResponseFunctionWebSearchStatus = "failed"
-
-
Type WebSearchCallThe type of the web search tool call. Always
web_search_call.const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"
-
-
type ResponseFunctionToolCall struct{…}A tool call to run a function. See the function calling guide for more information.
-
Arguments stringA JSON string of the arguments to pass to the function.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Name stringThe name of the function to run.
-
Type FunctionCallThe type of the function tool call. Always
function_call.const FunctionCallFunctionCall FunctionCall = "function_call"
-
ID stringThe unique ID of the function tool call.
-
Namespace stringThe namespace of the function to run.
-
Status ResponseFunctionToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallStatusInProgress ResponseFunctionToolCallStatus = "in_progress" -
const ResponseFunctionToolCallStatusCompleted ResponseFunctionToolCallStatus = "completed" -
const ResponseFunctionToolCallStatusIncomplete ResponseFunctionToolCallStatus = "incomplete"
-
-
-
type ResponseInputItemFunctionCallOutput struct{…}The output of a function tool call.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseInputItemFunctionCallOutputOutputUnionText, image, or file output of the function tool call.
-
string -
type ResponseFunctionCallOutputItemList []ResponseFunctionCallOutputItemUnionAn array of content outputs (text, image, file) for the function tool call.
-
type ResponseInputTextContent struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImageContent struct{…}An image input to the model. Learn about image inputs
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
Detail ResponseInputImageContentDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageContentDetailLow ResponseInputImageContentDetail = "low" -
const ResponseInputImageContentDetailHigh ResponseInputImageContentDetail = "high" -
const ResponseInputImageContentDetailAuto ResponseInputImageContentDetail = "auto" -
const ResponseInputImageContentDetailOriginal ResponseInputImageContentDetail = "original"
-
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFileContent struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileContentDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileContentDetailLow ResponseInputFileContentDetail = "low" -
const ResponseInputFileContentDetailHigh ResponseInputFileContentDetail = "high"
-
-
FileData stringThe base64-encoded data of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
ID stringThe unique ID of the function tool call output. Populated when this item is returned via API.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputItemFunctionCallOutputStatusInProgress ResponseInputItemFunctionCallOutputStatus = "in_progress" -
const ResponseInputItemFunctionCallOutputStatusCompleted ResponseInputItemFunctionCallOutputStatus = "completed" -
const ResponseInputItemFunctionCallOutputStatusIncomplete ResponseInputItemFunctionCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemToolSearchCall struct{…}-
Arguments anyThe arguments supplied to the tool search call.
-
Type ToolSearchCallThe item type. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
ID stringThe unique ID of this tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution stringWhether tool search was executed by the server or by the client.
-
const ResponseInputItemToolSearchCallExecutionServer ResponseInputItemToolSearchCallExecution = "server" -
const ResponseInputItemToolSearchCallExecutionClient ResponseInputItemToolSearchCallExecution = "client"
-
-
Status stringThe status of the tool search call.
-
const ResponseInputItemToolSearchCallStatusInProgress ResponseInputItemToolSearchCallStatus = "in_progress" -
const ResponseInputItemToolSearchCallStatusCompleted ResponseInputItemToolSearchCallStatus = "completed" -
const ResponseInputItemToolSearchCallStatusIncomplete ResponseInputItemToolSearchCallStatus = "incomplete"
-
-
-
type ResponseToolSearchOutputItemParamResp struct{…}-
Tools []ToolUnionThe loaded tool definitions returned by the tool search output.
-
type FunctionTool struct{…}Defines a function in your own code the model can choose to call. Learn more about function calling.
-
Name stringThe name of the function to call.
-
Parameters map[string, any]A JSON schema object describing the parameters of the function.
-
Strict boolWhether to enforce strict parameter validation. Default
true. -
Type FunctionThe type of the function tool. Always
function.const FunctionFunction Function = "function"
-
DeferLoading boolWhether this function is deferred and loaded via tool search.
-
Description stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
type FileSearchTool struct{…}A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
Type FileSearchThe type of the file search tool. Always
file_search.const FileSearchFileSearch FileSearch = "file_search"
-
VectorStoreIDs []stringThe IDs of the vector stores to search.
-
Filters FileSearchToolFiltersUnionA filter to apply.
-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
Key stringThe key to compare against the value.
-
Type ComparisonFilterTypeSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
const ComparisonFilterTypeEq ComparisonFilterType = "eq" -
const ComparisonFilterTypeNe ComparisonFilterType = "ne" -
const ComparisonFilterTypeGt ComparisonFilterType = "gt" -
const ComparisonFilterTypeGte ComparisonFilterType = "gte" -
const ComparisonFilterTypeLt ComparisonFilterType = "lt" -
const ComparisonFilterTypeLte ComparisonFilterType = "lte" -
const ComparisonFilterTypeIn ComparisonFilterType = "in" -
const ComparisonFilterTypeNin ComparisonFilterType = "nin"
-
-
Value ComparisonFilterValueUnionThe value to compare against the attribute key; supports string, number, or boolean types.
-
string -
float64 -
bool -
type ComparisonFilterValueArray []ComparisonFilterValueArrayItemUnion-
string -
float64
-
-
-
-
type CompoundFilter struct{…}Combine multiple filters using
andoror.-
Filters []ComparisonFilterArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
-
Type CompoundFilterTypeType of operation:
andoror.-
const CompoundFilterTypeAnd CompoundFilterType = "and" -
const CompoundFilterTypeOr CompoundFilterType = "or"
-
-
-
-
MaxNumResults int64The maximum number of results to return. This number should be between 1 and 50 inclusive.
-
RankingOptions FileSearchToolRankingOptionsRanking options for search.
-
HybridSearch FileSearchToolRankingOptionsHybridSearchWeights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
EmbeddingWeight float64The weight of the embedding in the reciprocal ranking fusion.
-
TextWeight float64The weight of the text in the reciprocal ranking fusion.
-
-
Ranker stringThe ranker to use for the file search.
-
const FileSearchToolRankingOptionsRankerAuto FileSearchToolRankingOptionsRanker = "auto" -
const FileSearchToolRankingOptionsRankerDefault2024_11_15 FileSearchToolRankingOptionsRanker = "default-2024-11-15"
-
-
ScoreThreshold float64The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
Type ComputerThe type of the computer tool. Always
computer.const ComputerComputer Computer = "computer"
-
-
type ComputerUsePreviewTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
DisplayHeight int64The height of the computer display.
-
DisplayWidth int64The width of the computer display.
-
Environment ComputerUsePreviewToolEnvironmentThe type of computer environment to control.
-
const ComputerUsePreviewToolEnvironmentWindows ComputerUsePreviewToolEnvironment = "windows" -
const ComputerUsePreviewToolEnvironmentMac ComputerUsePreviewToolEnvironment = "mac" -
const ComputerUsePreviewToolEnvironmentLinux ComputerUsePreviewToolEnvironment = "linux" -
const ComputerUsePreviewToolEnvironmentUbuntu ComputerUsePreviewToolEnvironment = "ubuntu" -
const ComputerUsePreviewToolEnvironmentBrowser ComputerUsePreviewToolEnvironment = "browser"
-
-
Type ComputerUsePreviewThe type of the computer use tool. Always
computer_use_preview.const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"
-
-
type WebSearchTool struct{…}Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
Type WebSearchToolTypeThe type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
const WebSearchToolTypeWebSearch WebSearchToolType = "web_search" -
const WebSearchToolTypeWebSearch2025_08_26 WebSearchToolType = "web_search_2025_08_26"
-
-
Filters WebSearchToolFiltersFilters for the search.
-
AllowedDomains []stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
SearchContextSize WebSearchToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchToolSearchContextSizeLow WebSearchToolSearchContextSize = "low" -
const WebSearchToolSearchContextSizeMedium WebSearchToolSearchContextSize = "medium" -
const WebSearchToolSearchContextSizeHigh WebSearchToolSearchContextSize = "high"
-
-
UserLocation WebSearchToolUserLocationThe approximate location of the user.
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
Type stringThe type of location approximation. Always
approximate.const WebSearchToolUserLocationTypeApproximate WebSearchToolUserLocationType = "approximate"
-
-
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
ServerLabel stringA label for this MCP server, used to identify it in tool calls.
-
Type McpThe type of the MCP tool. Always
mcp.const McpMcp Mcp = "mcp"
-
AllowedTools ToolMcpAllowedToolsUnionList of allowed tool names or a filter object.
-
type ToolMcpAllowedToolsMcpAllowedTools []stringA string array of allowed tool names
-
type ToolMcpAllowedToolsMcpToolFilter struct{…}A filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
Authorization stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
ConnectorID stringIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
const ToolMcpConnectorIDConnectorDropbox ToolMcpConnectorID = "connector_dropbox" -
const ToolMcpConnectorIDConnectorGmail ToolMcpConnectorID = "connector_gmail" -
const ToolMcpConnectorIDConnectorGooglecalendar ToolMcpConnectorID = "connector_googlecalendar" -
const ToolMcpConnectorIDConnectorGoogledrive ToolMcpConnectorID = "connector_googledrive" -
const ToolMcpConnectorIDConnectorMicrosoftteams ToolMcpConnectorID = "connector_microsoftteams" -
const ToolMcpConnectorIDConnectorOutlookcalendar ToolMcpConnectorID = "connector_outlookcalendar" -
const ToolMcpConnectorIDConnectorOutlookemail ToolMcpConnectorID = "connector_outlookemail" -
const ToolMcpConnectorIDConnectorSharepoint ToolMcpConnectorID = "connector_sharepoint"
-
-
DeferLoading boolWhether this MCP tool is deferred and discovered via tool search.
-
Headers map[string, string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
RequireApproval ToolMcpRequireApprovalUnionSpecify which of the MCP server's tools require approval.
-
type ToolMcpRequireApprovalMcpToolApprovalFilter 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.-
Always ToolMcpRequireApprovalMcpToolApprovalFilterAlwaysA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
Never ToolMcpRequireApprovalMcpToolApprovalFilterNeverA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
type ToolMcpRequireApprovalMcpToolApprovalSetting stringSpecify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
const ToolMcpRequireApprovalMcpToolApprovalSettingAlways ToolMcpRequireApprovalMcpToolApprovalSetting = "always" -
const ToolMcpRequireApprovalMcpToolApprovalSettingNever ToolMcpRequireApprovalMcpToolApprovalSetting = "never"
-
-
-
ServerDescription stringOptional description of the MCP server, used to provide more context.
-
ServerURL stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
TunnelID stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
Container ToolCodeInterpreterContainerUnionThe code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
string -
type ToolCodeInterpreterContainerCodeInterpreterContainerAuto struct{…}Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
Type AutoAlways
auto.const AutoAuto Auto = "auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit stringThe memory limit for the code interpreter container.
-
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"
-
-
NetworkPolicy ToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…}-
Type DisabledDisable outbound network access. Always
disabled.const DisabledDisabled Disabled = "disabled"
-
-
type ContainerNetworkPolicyAllowlist struct{…}-
AllowedDomains []stringA list of allowed domains when type is
allowlist. -
Type AllowlistAllow outbound network access only to specified domains. Always
allowlist.const AllowlistAllowlist Allowlist = "allowlist"
-
DomainSecrets []ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
Domain stringThe domain associated with the secret.
-
Name stringThe name of the secret to inject for the domain.
-
Value stringThe secret value to inject for the domain.
-
-
-
-
-
-
Type CodeInterpreterThe type of the code interpreter tool. Always
code_interpreter.const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"
-
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
Type ImageGenerationThe type of the image generation tool. Always
image_generation.const ImageGenerationImageGeneration ImageGeneration = "image_generation"
-
Action stringWhether to generate a new image or edit an existing image. Default:
auto.-
const ToolImageGenerationActionGenerate ToolImageGenerationAction = "generate" -
const ToolImageGenerationActionEdit ToolImageGenerationAction = "edit" -
const ToolImageGenerationActionAuto ToolImageGenerationAction = "auto"
-
-
Background stringAllows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
const ToolImageGenerationBackgroundTransparent ToolImageGenerationBackground = "transparent" -
const ToolImageGenerationBackgroundOpaque ToolImageGenerationBackground = "opaque" -
const ToolImageGenerationBackgroundAuto ToolImageGenerationBackground = "auto"
-
-
InputFidelity stringControl how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
const ToolImageGenerationInputFidelityHigh ToolImageGenerationInputFidelity = "high" -
const ToolImageGenerationInputFidelityLow ToolImageGenerationInputFidelity = "low"
-
-
InputImageMask ToolImageGenerationInputImageMaskOptional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
FileID stringFile ID for the mask image.
-
ImageURL stringBase64-encoded mask image.
-
-
Model stringThe image generation model to use. Default:
gpt-image-1.-
string -
string-
const ToolImageGenerationModelGPTImage1 ToolImageGenerationModel = "gpt-image-1" -
const ToolImageGenerationModelGPTImage1Mini ToolImageGenerationModel = "gpt-image-1-mini" -
const ToolImageGenerationModelGPTImage2 ToolImageGenerationModel = "gpt-image-2" -
const ToolImageGenerationModelGPTImage2_2026_04_21 ToolImageGenerationModel = "gpt-image-2-2026-04-21" -
const ToolImageGenerationModelGPTImage1_5 ToolImageGenerationModel = "gpt-image-1.5" -
const ToolImageGenerationModelChatgptImageLatest ToolImageGenerationModel = "chatgpt-image-latest"
-
-
-
Moderation stringModeration level for the generated image. Default:
auto.-
const ToolImageGenerationModerationAuto ToolImageGenerationModeration = "auto" -
const ToolImageGenerationModerationLow ToolImageGenerationModeration = "low"
-
-
OutputCompression int64Compression level for the output image. Default: 100.
-
OutputFormat stringThe output format of the generated image. One of
png,webp, orjpeg. Default:png.-
const ToolImageGenerationOutputFormatPNG ToolImageGenerationOutputFormat = "png" -
const ToolImageGenerationOutputFormatWebP ToolImageGenerationOutputFormat = "webp" -
const ToolImageGenerationOutputFormatJPEG ToolImageGenerationOutputFormat = "jpeg"
-
-
PartialImages int64Number of partial images to generate in streaming mode, from 0 (default value) to 3.
-
Quality stringThe quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
const ToolImageGenerationQualityLow ToolImageGenerationQuality = "low" -
const ToolImageGenerationQualityMedium ToolImageGenerationQuality = "medium" -
const ToolImageGenerationQualityHigh ToolImageGenerationQuality = "high" -
const ToolImageGenerationQualityAuto ToolImageGenerationQuality = "auto"
-
-
Size stringThe size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
string -
string-
const ToolImageGenerationSize1024x1024 ToolImageGenerationSize = "1024x1024" -
const ToolImageGenerationSize1024x1536 ToolImageGenerationSize = "1024x1536" -
const ToolImageGenerationSize1536x1024 ToolImageGenerationSize = "1536x1024" -
const ToolImageGenerationSizeAuto ToolImageGenerationSize = "auto"
-
-
-
-
type ToolLocalShell struct{…}A tool that allows the model to execute shell commands in a local environment.
-
Type LocalShellThe type of the local shell tool. Always
local_shell.const LocalShellLocalShell LocalShell = "local_shell"
-
-
type FunctionShellTool struct{…}A tool that allows the model to execute shell commands.
-
Type ShellThe type of the shell tool. Always
shell.const ShellShell Shell = "shell"
-
Environment FunctionShellToolEnvironmentUnion-
type ContainerAuto struct{…}-
Type ContainerAutoAutomatically creates a container for this request
const ContainerAutoContainerAuto ContainerAuto = "container_auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit ContainerAutoMemoryLimitThe memory limit for the container.
-
const ContainerAutoMemoryLimit1g ContainerAutoMemoryLimit = "1g" -
const ContainerAutoMemoryLimit4g ContainerAutoMemoryLimit = "4g" -
const ContainerAutoMemoryLimit16g ContainerAutoMemoryLimit = "16g" -
const ContainerAutoMemoryLimit64g ContainerAutoMemoryLimit = "64g"
-
-
NetworkPolicy ContainerAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…} -
type ContainerNetworkPolicyAllowlist struct{…}
-
-
Skills []ContainerAutoSkillUnionAn optional list of skills referenced by id or inline data.
-
type SkillReference struct{…}-
SkillID stringThe ID of the referenced skill.
-
Type SkillReferenceReferences a skill created with the /v1/skills endpoint.
const SkillReferenceSkillReference SkillReference = "skill_reference"
-
Version stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
type InlineSkill struct{…}-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Source InlineSkillSourceInline skill payload
-
Data stringBase64-encoded skill zip bundle.
-
MediaType ApplicationZipThe media type of the inline skill payload. Must be
application/zip.const ApplicationZipApplicationZip ApplicationZip = "application/zip"
-
Type Base64The type of the inline skill source. Must be
base64.const Base64Base64 Base64 = "base64"
-
-
Type InlineDefines an inline skill for this request.
const InlineInline Inline = "inline"
-
-
-
-
type LocalEnvironment struct{…}-
Type LocalUse a local computer environment.
const LocalLocal Local = "local"
-
Skills []LocalSkillAn optional list of skills.
-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Path stringThe path to the directory containing the skill.
-
-
-
type ContainerReference struct{…}-
ContainerID stringThe ID of the referenced container.
-
Type ContainerReferenceReferences a container created with the /v1/containers endpoint
const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
Name stringThe name of the custom tool, used to identify it in tool calls.
-
Type CustomThe type of the custom tool. Always
custom.const CustomCustom Custom = "custom"
-
DeferLoading boolWhether this tool should be deferred and discovered via tool search.
-
Description stringOptional description of the custom tool, used to provide more context.
-
Format CustomToolInputFormatUnionThe input format for the custom tool. Default is unconstrained text.
-
type CustomToolInputFormatText struct{…}Unconstrained free-form text.
-
Type TextUnconstrained text format. Always
text.const TextText Text = "text"
-
-
type CustomToolInputFormatGrammar struct{…}A grammar defined by the user.
-
Definition stringThe grammar definition.
-
Syntax stringThe syntax of the grammar definition. One of
larkorregex.-
const CustomToolInputFormatGrammarSyntaxLark CustomToolInputFormatGrammarSyntax = "lark" -
const CustomToolInputFormatGrammarSyntaxRegex CustomToolInputFormatGrammarSyntax = "regex"
-
-
Type GrammarGrammar format. Always
grammar.const GrammarGrammar Grammar = "grammar"
-
-
-
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
Description stringA description of the namespace shown to the model.
-
Name stringThe namespace name used in tool calls (for example,
crm). -
Tools []NamespaceToolToolUnionThe function/custom tools available inside this namespace.
-
type NamespaceToolToolFunction struct{…}-
Name string -
Type Functionconst FunctionFunction Function = "function"
-
DeferLoading boolWhether this function should be deferred and discovered via tool search.
-
Description string -
Parameters any -
Strict bool
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
-
Type NamespaceThe type of the tool. Always
namespace.const NamespaceNamespace Namespace = "namespace"
-
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
Type ToolSearchThe type of the tool. Always
tool_search.const ToolSearchToolSearch ToolSearch = "tool_search"
-
Description stringDescription shown to the model for a client-executed tool search tool.
-
Execution ToolSearchToolExecutionWhether tool search is executed by the server or by the client.
-
const ToolSearchToolExecutionServer ToolSearchToolExecution = "server" -
const ToolSearchToolExecutionClient ToolSearchToolExecution = "client"
-
-
Parameters anyParameter schema for a client-executed tool search tool.
-
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
Type WebSearchPreviewToolTypeThe type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
const WebSearchPreviewToolTypeWebSearchPreview WebSearchPreviewToolType = "web_search_preview" -
const WebSearchPreviewToolTypeWebSearchPreview2025_03_11 WebSearchPreviewToolType = "web_search_preview_2025_03_11"
-
-
SearchContentTypes []string-
const WebSearchPreviewToolSearchContentTypeText WebSearchPreviewToolSearchContentType = "text" -
const WebSearchPreviewToolSearchContentTypeImage WebSearchPreviewToolSearchContentType = "image"
-
-
SearchContextSize WebSearchPreviewToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchPreviewToolSearchContextSizeLow WebSearchPreviewToolSearchContextSize = "low" -
const WebSearchPreviewToolSearchContextSizeMedium WebSearchPreviewToolSearchContextSize = "medium" -
const WebSearchPreviewToolSearchContextSizeHigh WebSearchPreviewToolSearchContextSize = "high"
-
-
UserLocation WebSearchPreviewToolUserLocationThe user's location.
-
Type ApproximateThe type of location approximation. Always
approximate.const ApproximateApproximate Approximate = "approximate"
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
Type ApplyPatchThe type of the tool. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
-
Type ToolSearchOutputThe item type. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
ID stringThe unique ID of this tool search output.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemParamExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemParamExecutionServer ResponseToolSearchOutputItemParamExecution = "server" -
const ResponseToolSearchOutputItemParamExecutionClient ResponseToolSearchOutputItemParamExecution = "client"
-
-
Status ResponseToolSearchOutputItemParamStatusThe status of the tool search output.
-
const ResponseToolSearchOutputItemParamStatusInProgress ResponseToolSearchOutputItemParamStatus = "in_progress" -
const ResponseToolSearchOutputItemParamStatusCompleted ResponseToolSearchOutputItemParamStatus = "completed" -
const ResponseToolSearchOutputItemParamStatusIncomplete ResponseToolSearchOutputItemParamStatus = "incomplete"
-
-
-
type ResponseInputItemAdditionalTools struct{…}-
Role DeveloperThe role that provided the additional tools. Only
developeris supported.const DeveloperDeveloper Developer = "developer"
-
Tools []ToolUnionA list of additional tools made available at this item.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type AdditionalToolsThe item type. Always
additional_tools.const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"
-
ID stringThe unique ID of this additional tools item.
-
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
ID stringThe unique identifier of the reasoning content.
-
Summary []ResponseReasoningItemSummaryReasoning summary content.
-
Text stringA summary of the reasoning output from the model so far.
-
Type SummaryTextThe type of the object. Always
summary_text.const SummaryTextSummaryText SummaryText = "summary_text"
-
-
Type ReasoningThe type of the object. Always
reasoning.const ReasoningReasoning Reasoning = "reasoning"
-
Content []ResponseReasoningItemContentReasoning text content.
-
Text stringThe reasoning text from the model.
-
Type ReasoningTextThe type of the reasoning text. Always
reasoning_text.const ReasoningTextReasoningText ReasoningText = "reasoning_text"
-
-
EncryptedContent stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
Status ResponseReasoningItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseReasoningItemStatusInProgress ResponseReasoningItemStatus = "in_progress" -
const ResponseReasoningItemStatusCompleted ResponseReasoningItemStatus = "completed" -
const ResponseReasoningItemStatusIncomplete ResponseReasoningItemStatus = "incomplete"
-
-
-
type ResponseCompactionItemParamResp struct{…}A compaction item generated by the
v1/responses/compactAPI.-
EncryptedContent stringThe encrypted content of the compaction summary.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
ID stringThe ID of the compaction item.
-
-
type ResponseInputItemImageGenerationCall struct{…}An image generation request made by the model.
-
ID stringThe unique ID of the image generation call.
-
Result stringThe generated image encoded in base64.
-
Status stringThe status of the image generation call.
-
const ResponseInputItemImageGenerationCallStatusInProgress ResponseInputItemImageGenerationCallStatus = "in_progress" -
const ResponseInputItemImageGenerationCallStatusCompleted ResponseInputItemImageGenerationCallStatus = "completed" -
const ResponseInputItemImageGenerationCallStatusGenerating ResponseInputItemImageGenerationCallStatus = "generating" -
const ResponseInputItemImageGenerationCallStatusFailed ResponseInputItemImageGenerationCallStatus = "failed"
-
-
Type ImageGenerationCallThe type of the image generation call. Always
image_generation_call.const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"
-
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
ID stringThe unique ID of the code interpreter tool call.
-
Code stringThe code to run, or null if not available.
-
ContainerID stringThe ID of the container used to run the code.
-
Outputs []ResponseCodeInterpreterToolCallOutputUnionThe outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
type ResponseCodeInterpreterToolCallOutputLogs struct{…}The logs output from the code interpreter.
-
Logs stringThe logs output from the code interpreter.
-
Type LogsThe type of the output. Always
logs.const LogsLogs Logs = "logs"
-
-
type ResponseCodeInterpreterToolCallOutputImage struct{…}The image output from the code interpreter.
-
Type ImageThe type of the output. Always
image.const ImageImage Image = "image"
-
URL stringThe URL of the image output from the code interpreter.
-
-
-
Status ResponseCodeInterpreterToolCallStatusThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
const ResponseCodeInterpreterToolCallStatusInProgress ResponseCodeInterpreterToolCallStatus = "in_progress" -
const ResponseCodeInterpreterToolCallStatusCompleted ResponseCodeInterpreterToolCallStatus = "completed" -
const ResponseCodeInterpreterToolCallStatusIncomplete ResponseCodeInterpreterToolCallStatus = "incomplete" -
const ResponseCodeInterpreterToolCallStatusInterpreting ResponseCodeInterpreterToolCallStatus = "interpreting" -
const ResponseCodeInterpreterToolCallStatusFailed ResponseCodeInterpreterToolCallStatus = "failed"
-
-
Type CodeInterpreterCallThe type of the code interpreter tool call. Always
code_interpreter_call.const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"
-
-
type ResponseInputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
ID stringThe unique ID of the local shell call.
-
Action ResponseInputItemLocalShellCallActionExecute a shell command on the server.
-
Command []stringThe command to run.
-
Env map[string, string]Environment variables to set for the command.
-
Type ExecThe type of the local shell action. Always
exec.const ExecExec Exec = "exec"
-
TimeoutMs int64Optional timeout in milliseconds for the command.
-
User stringOptional user to run the command as.
-
WorkingDirectory stringOptional working directory to run the command in.
-
-
CallID stringThe unique ID of the local shell tool call generated by the model.
-
Status stringThe status of the local shell call.
-
const ResponseInputItemLocalShellCallStatusInProgress ResponseInputItemLocalShellCallStatus = "in_progress" -
const ResponseInputItemLocalShellCallStatusCompleted ResponseInputItemLocalShellCallStatus = "completed" -
const ResponseInputItemLocalShellCallStatusIncomplete ResponseInputItemLocalShellCallStatus = "incomplete"
-
-
Type LocalShellCallThe type of the local shell call. Always
local_shell_call.const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"
-
-
type ResponseInputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
ID stringThe unique ID of the local shell tool call generated by the model.
-
Output stringA JSON string of the output of the local shell tool call.
-
Type LocalShellCallOutputThe type of the local shell tool call output. Always
local_shell_call_output.const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete.-
const ResponseInputItemLocalShellCallOutputStatusInProgress ResponseInputItemLocalShellCallOutputStatus = "in_progress" -
const ResponseInputItemLocalShellCallOutputStatusCompleted ResponseInputItemLocalShellCallOutputStatus = "completed" -
const ResponseInputItemLocalShellCallOutputStatusIncomplete ResponseInputItemLocalShellCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemShellCall struct{…}A tool representing a request to execute one or more shell commands.
-
Action ResponseInputItemShellCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []stringOrdered shell commands for the execution environment to run.
-
MaxOutputLength int64Maximum number of UTF-8 characters to capture from combined stdout and stderr output.
-
TimeoutMs int64Maximum wall-clock time in milliseconds to allow the shell commands to run.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Environment ResponseInputItemShellCallEnvironmentUnionThe environment to execute the shell commands in.
-
type LocalEnvironment struct{…} -
type ContainerReference struct{…}
-
-
Status stringThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseInputItemShellCallStatusInProgress ResponseInputItemShellCallStatus = "in_progress" -
const ResponseInputItemShellCallStatusCompleted ResponseInputItemShellCallStatus = "completed" -
const ResponseInputItemShellCallStatusIncomplete ResponseInputItemShellCallStatus = "incomplete"
-
-
-
type ResponseInputItemShellCallOutput struct{…}The streamed output items emitted by a shell tool call.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Output []ResponseFunctionShellCallOutputContentCaptured chunks of stdout and stderr output, along with their associated outcomes.
-
Outcome ResponseFunctionShellCallOutputContentOutcomeUnionThe exit or timeout outcome associated with this shell call.
-
type ResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellCallOutputContentOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64The exit code returned by the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringCaptured stderr output for the shell call.
-
Stdout stringCaptured stdout output for the shell call.
-
-
Type ShellCallOutputThe type of the item. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
ID stringThe unique ID of the shell tool call output. Populated when this item is returned via API.
-
MaxOutputLength int64The maximum number of UTF-8 characters captured for this shell call's combined output.
-
Status stringThe status of the shell call output.
-
const ResponseInputItemShellCallOutputStatusInProgress ResponseInputItemShellCallOutputStatus = "in_progress" -
const ResponseInputItemShellCallOutputStatusCompleted ResponseInputItemShellCallOutputStatus = "completed" -
const ResponseInputItemShellCallOutputStatusIncomplete ResponseInputItemShellCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemApplyPatchCall struct{…}A tool call representing a request to create, delete, or update files using diff patches.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseInputItemApplyPatchCallOperationUnionThe specific create, delete, or update instruction for the apply_patch tool call.
-
type ResponseInputItemApplyPatchCallOperationCreateFile struct{…}Instruction for creating a new file via the apply_patch tool.
-
Diff stringUnified diff content to apply when creating the file.
-
Path stringPath of the file to create relative to the workspace root.
-
Type CreateFileThe operation type. Always
create_file.const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseInputItemApplyPatchCallOperationDeleteFile struct{…}Instruction for deleting an existing file via the apply_patch tool.
-
Path stringPath of the file to delete relative to the workspace root.
-
Type DeleteFileThe operation type. Always
delete_file.const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseInputItemApplyPatchCallOperationUpdateFile struct{…}Instruction for updating an existing file via the apply_patch tool.
-
Diff stringUnified diff content to apply to the existing file.
-
Path stringPath of the file to update relative to the workspace root.
-
Type UpdateFileThe operation type. Always
update_file.const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status stringThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseInputItemApplyPatchCallStatusInProgress ResponseInputItemApplyPatchCallStatus = "in_progress" -
const ResponseInputItemApplyPatchCallStatusCompleted ResponseInputItemApplyPatchCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
-
type ResponseInputItemApplyPatchCallOutput struct{…}The streamed output emitted by an apply patch tool call.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status stringThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseInputItemApplyPatchCallOutputStatusCompleted ResponseInputItemApplyPatchCallOutputStatus = "completed" -
const ResponseInputItemApplyPatchCallOutputStatusFailed ResponseInputItemApplyPatchCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
Output stringOptional human-readable log text from the apply patch tool (e.g., patch results or errors).
-
-
type ResponseInputItemMcpListTools struct{…}A list of tools available on an MCP server.
-
ID stringThe unique ID of the list.
-
ServerLabel stringThe label of the MCP server.
-
Tools []ResponseInputItemMcpListToolsToolThe tools available on the server.
-
InputSchema anyThe JSON schema describing the tool's input.
-
Name stringThe name of the tool.
-
Annotations anyAdditional annotations about the tool.
-
Description stringThe description of the tool.
-
-
Type McpListToolsThe type of the item. Always
mcp_list_tools.const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
-
Error stringError message if the server could not list tools.
-
-
type ResponseInputItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
ID stringThe unique ID of the approval request.
-
Arguments stringA JSON string of arguments for the tool.
-
Name stringThe name of the tool to run.
-
ServerLabel stringThe label of the MCP server making the request.
-
Type McpApprovalRequestThe type of the item. Always
mcp_approval_request.const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"
-
-
type ResponseInputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
ApprovalRequestID stringThe ID of the approval request being answered.
-
Approve boolWhether the request was approved.
-
Type McpApprovalResponseThe type of the item. Always
mcp_approval_response.const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
-
ID stringThe unique ID of the approval response
-
Reason stringOptional reason for the decision.
-
-
type ResponseInputItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
ID stringThe unique ID of the tool call.
-
Arguments stringA JSON string of the arguments passed to the tool.
-
Name stringThe name of the tool that was run.
-
ServerLabel stringThe label of the MCP server running the tool.
-
Type McpCallThe type of the item. Always
mcp_call.const McpCallMcpCall McpCall = "mcp_call"
-
ApprovalRequestID stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
Error stringThe error from the tool call, if any.
-
Output stringThe output from the tool call.
-
Status stringThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
const ResponseInputItemMcpCallStatusInProgress ResponseInputItemMcpCallStatus = "in_progress" -
const ResponseInputItemMcpCallStatusCompleted ResponseInputItemMcpCallStatus = "completed" -
const ResponseInputItemMcpCallStatusIncomplete ResponseInputItemMcpCallStatus = "incomplete" -
const ResponseInputItemMcpCallStatusCalling ResponseInputItemMcpCallStatus = "calling" -
const ResponseInputItemMcpCallStatusFailed ResponseInputItemMcpCallStatus = "failed"
-
-
-
type ResponseCustomToolCallOutput struct{…}The output of a custom tool call from your code, being sent back to the model.
-
CallID stringThe call ID, used to map this custom tool call output to a custom tool call.
-
Output ResponseCustomToolCallOutputOutputUnionThe output from the custom tool call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseCustomToolCallOutputOutputOutputContentList []ResponseCustomToolCallOutputOutputOutputContentListItemUnionText, image, or file output of the custom tool call.
-
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
-
Type CustomToolCallOutputThe type of the custom tool call output. Always
custom_tool_call_output.const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"
-
ID stringThe unique ID of the custom tool call output in the OpenAI platform.
-
-
type ResponseCustomToolCall struct{…}A call to a custom tool created by the model.
-
CallID stringAn identifier used to map this custom tool call to a tool call output.
-
Input stringThe input for the custom tool call generated by the model.
-
Name stringThe name of the custom tool being called.
-
Type CustomToolCallThe type of the custom tool call. Always
custom_tool_call.const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"
-
ID stringThe unique ID of the custom tool call in the OpenAI platform.
-
Namespace stringThe namespace of the custom tool being called.
-
-
type ResponseInputItemCompactionTrigger struct{…}Compacts the current context. Must be the final input item.
-
Type CompactionTriggerThe type of the item. Always
compaction_trigger.const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"
-
-
type ResponseInputItemItemReference struct{…}An internal identifier for an item to reference.
-
ID stringThe ID of the item to reference.
-
Type stringThe type of item to reference. Always
item_reference.const ResponseInputItemItemReferenceTypeItemReference ResponseInputItemItemReferenceType = "item_reference"
-
-
-
-
Metadata MetadataSet of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
-
Model ResponsesModelModel ID used to generate the response, like
gpt-4ooro3. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models.-
string -
type ChatModel string-
const ChatModelGPT5_4 ChatModel = "gpt-5.4" -
const ChatModelGPT5_4Mini ChatModel = "gpt-5.4-mini" -
const ChatModelGPT5_4Nano ChatModel = "gpt-5.4-nano" -
const ChatModelGPT5_4Mini2026_03_17 ChatModel = "gpt-5.4-mini-2026-03-17" -
const ChatModelGPT5_4Nano2026_03_17 ChatModel = "gpt-5.4-nano-2026-03-17" -
const ChatModelGPT5_3ChatLatest ChatModel = "gpt-5.3-chat-latest" -
const ChatModelGPT5_2 ChatModel = "gpt-5.2" -
const ChatModelGPT5_2_2025_12_11 ChatModel = "gpt-5.2-2025-12-11" -
const ChatModelGPT5_2ChatLatest ChatModel = "gpt-5.2-chat-latest" -
const ChatModelGPT5_2Pro ChatModel = "gpt-5.2-pro" -
const ChatModelGPT5_2Pro2025_12_11 ChatModel = "gpt-5.2-pro-2025-12-11" -
const ChatModelGPT5_1 ChatModel = "gpt-5.1" -
const ChatModelGPT5_1_2025_11_13 ChatModel = "gpt-5.1-2025-11-13" -
const ChatModelGPT5_1Codex ChatModel = "gpt-5.1-codex" -
const ChatModelGPT5_1Mini ChatModel = "gpt-5.1-mini" -
const ChatModelGPT5_1ChatLatest ChatModel = "gpt-5.1-chat-latest" -
const ChatModelGPT5 ChatModel = "gpt-5" -
const ChatModelGPT5Mini ChatModel = "gpt-5-mini" -
const ChatModelGPT5Nano ChatModel = "gpt-5-nano" -
const ChatModelGPT5_2025_08_07 ChatModel = "gpt-5-2025-08-07" -
const ChatModelGPT5Mini2025_08_07 ChatModel = "gpt-5-mini-2025-08-07" -
const ChatModelGPT5Nano2025_08_07 ChatModel = "gpt-5-nano-2025-08-07" -
const ChatModelGPT5ChatLatest ChatModel = "gpt-5-chat-latest" -
const ChatModelGPT4_1 ChatModel = "gpt-4.1" -
const ChatModelGPT4_1Mini ChatModel = "gpt-4.1-mini" -
const ChatModelGPT4_1Nano ChatModel = "gpt-4.1-nano" -
const ChatModelGPT4_1_2025_04_14 ChatModel = "gpt-4.1-2025-04-14" -
const ChatModelGPT4_1Mini2025_04_14 ChatModel = "gpt-4.1-mini-2025-04-14" -
const ChatModelGPT4_1Nano2025_04_14 ChatModel = "gpt-4.1-nano-2025-04-14" -
const ChatModelO4Mini ChatModel = "o4-mini" -
const ChatModelO4Mini2025_04_16 ChatModel = "o4-mini-2025-04-16" -
const ChatModelO3 ChatModel = "o3" -
const ChatModelO3_2025_04_16 ChatModel = "o3-2025-04-16" -
const ChatModelO3Mini ChatModel = "o3-mini" -
const ChatModelO3Mini2025_01_31 ChatModel = "o3-mini-2025-01-31" -
const ChatModelO1 ChatModel = "o1" -
const ChatModelO1_2024_12_17 ChatModel = "o1-2024-12-17" -
const ChatModelO1Preview ChatModel = "o1-preview" -
const ChatModelO1Preview2024_09_12 ChatModel = "o1-preview-2024-09-12" -
const ChatModelO1Mini ChatModel = "o1-mini" -
const ChatModelO1Mini2024_09_12 ChatModel = "o1-mini-2024-09-12" -
const ChatModelGPT4o ChatModel = "gpt-4o" -
const ChatModelGPT4o2024_11_20 ChatModel = "gpt-4o-2024-11-20" -
const ChatModelGPT4o2024_08_06 ChatModel = "gpt-4o-2024-08-06" -
const ChatModelGPT4o2024_05_13 ChatModel = "gpt-4o-2024-05-13" -
const ChatModelGPT4oAudioPreview ChatModel = "gpt-4o-audio-preview" -
const ChatModelGPT4oAudioPreview2024_10_01 ChatModel = "gpt-4o-audio-preview-2024-10-01" -
const ChatModelGPT4oAudioPreview2024_12_17 ChatModel = "gpt-4o-audio-preview-2024-12-17" -
const ChatModelGPT4oAudioPreview2025_06_03 ChatModel = "gpt-4o-audio-preview-2025-06-03" -
const ChatModelGPT4oMiniAudioPreview ChatModel = "gpt-4o-mini-audio-preview" -
const ChatModelGPT4oMiniAudioPreview2024_12_17 ChatModel = "gpt-4o-mini-audio-preview-2024-12-17" -
const ChatModelGPT4oSearchPreview ChatModel = "gpt-4o-search-preview" -
const ChatModelGPT4oMiniSearchPreview ChatModel = "gpt-4o-mini-search-preview" -
const ChatModelGPT4oSearchPreview2025_03_11 ChatModel = "gpt-4o-search-preview-2025-03-11" -
const ChatModelGPT4oMiniSearchPreview2025_03_11 ChatModel = "gpt-4o-mini-search-preview-2025-03-11" -
const ChatModelChatgpt4oLatest ChatModel = "chatgpt-4o-latest" -
const ChatModelCodexMiniLatest ChatModel = "codex-mini-latest" -
const ChatModelGPT4oMini ChatModel = "gpt-4o-mini" -
const ChatModelGPT4oMini2024_07_18 ChatModel = "gpt-4o-mini-2024-07-18" -
const ChatModelGPT4Turbo ChatModel = "gpt-4-turbo" -
const ChatModelGPT4Turbo2024_04_09 ChatModel = "gpt-4-turbo-2024-04-09" -
const ChatModelGPT4_0125Preview ChatModel = "gpt-4-0125-preview" -
const ChatModelGPT4TurboPreview ChatModel = "gpt-4-turbo-preview" -
const ChatModelGPT4_1106Preview ChatModel = "gpt-4-1106-preview" -
const ChatModelGPT4VisionPreview ChatModel = "gpt-4-vision-preview" -
const ChatModelGPT4 ChatModel = "gpt-4" -
const ChatModelGPT4_0314 ChatModel = "gpt-4-0314" -
const ChatModelGPT4_0613 ChatModel = "gpt-4-0613" -
const ChatModelGPT4_32k ChatModel = "gpt-4-32k" -
const ChatModelGPT4_32k0314 ChatModel = "gpt-4-32k-0314" -
const ChatModelGPT4_32k0613 ChatModel = "gpt-4-32k-0613" -
const ChatModelGPT3_5Turbo ChatModel = "gpt-3.5-turbo" -
const ChatModelGPT3_5Turbo16k ChatModel = "gpt-3.5-turbo-16k" -
const ChatModelGPT3_5Turbo0301 ChatModel = "gpt-3.5-turbo-0301" -
const ChatModelGPT3_5Turbo0613 ChatModel = "gpt-3.5-turbo-0613" -
const ChatModelGPT3_5Turbo1106 ChatModel = "gpt-3.5-turbo-1106" -
const ChatModelGPT3_5Turbo0125 ChatModel = "gpt-3.5-turbo-0125" -
const ChatModelGPT3_5Turbo16k0613 ChatModel = "gpt-3.5-turbo-16k-0613"
-
-
type ResponsesModel string-
const ResponsesModelO1Pro ResponsesModel = "o1-pro" -
const ResponsesModelO1Pro2025_03_19 ResponsesModel = "o1-pro-2025-03-19" -
const ResponsesModelO3Pro ResponsesModel = "o3-pro" -
const ResponsesModelO3Pro2025_06_10 ResponsesModel = "o3-pro-2025-06-10" -
const ResponsesModelO3DeepResearch ResponsesModel = "o3-deep-research" -
const ResponsesModelO3DeepResearch2025_06_26 ResponsesModel = "o3-deep-research-2025-06-26" -
const ResponsesModelO4MiniDeepResearch ResponsesModel = "o4-mini-deep-research" -
const ResponsesModelO4MiniDeepResearch2025_06_26 ResponsesModel = "o4-mini-deep-research-2025-06-26" -
const ResponsesModelComputerUsePreview ResponsesModel = "computer-use-preview" -
const ResponsesModelComputerUsePreview2025_03_11 ResponsesModel = "computer-use-preview-2025-03-11" -
const ResponsesModelGPT5Codex ResponsesModel = "gpt-5-codex" -
const ResponsesModelGPT5Pro ResponsesModel = "gpt-5-pro" -
const ResponsesModelGPT5Pro2025_10_06 ResponsesModel = "gpt-5-pro-2025-10-06" -
const ResponsesModelGPT5_1CodexMax ResponsesModel = "gpt-5.1-codex-max"
-
-
-
Object ResponseThe object type of this resource - always set to
response.const ResponseResponse Response = "response"
-
Output []ResponseOutputItemUnionAn array of content items generated by the model.
-
The length and order of items in the
outputarray is dependent on the model's response. -
Rather than accessing the first item in the
outputarray and assuming it's anassistantmessage with the content generated by the model, you might consider using theoutput_textproperty where supported in SDKs. -
type ResponseOutputMessage struct{…}An output message from the model.
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
type ResponseFunctionToolCall struct{…}A tool call to run a function. See the function calling guide for more information.
-
type ResponseFunctionToolCallOutputItem struct{…}-
ID stringThe unique ID of the function call tool output.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseFunctionToolCallOutputItemOutputUnionThe output from the function call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseFunctionToolCallOutputItemOutputOutputContentList []ResponseFunctionToolCallOutputItemOutputOutputContentListItemUnionText, image, or file output of the function call.
-
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
-
Status ResponseFunctionToolCallOutputItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallOutputItemStatusInProgress ResponseFunctionToolCallOutputItemStatus = "in_progress" -
const ResponseFunctionToolCallOutputItemStatusCompleted ResponseFunctionToolCallOutputItemStatus = "completed" -
const ResponseFunctionToolCallOutputItemStatusIncomplete ResponseFunctionToolCallOutputItemStatus = "incomplete"
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
type ResponseComputerToolCallOutputItem struct{…}-
ID stringThe unique ID of the computer call tool output.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Status ResponseComputerToolCallOutputItemStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseComputerToolCallOutputItemStatusCompleted ResponseComputerToolCallOutputItemStatus = "completed" -
const ResponseComputerToolCallOutputItemStatusIncomplete ResponseComputerToolCallOutputItemStatus = "incomplete" -
const ResponseComputerToolCallOutputItemStatusFailed ResponseComputerToolCallOutputItemStatus = "failed" -
const ResponseComputerToolCallOutputItemStatusInProgress ResponseComputerToolCallOutputItemStatus = "in_progress"
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
AcknowledgedSafetyChecks []ResponseComputerToolCallOutputItemAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context. -
type ResponseToolSearchCall struct{…}-
ID stringThe unique ID of the tool search call item.
-
Arguments anyArguments used for the tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchCallExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchCallExecutionServer ResponseToolSearchCallExecution = "server" -
const ResponseToolSearchCallExecutionClient ResponseToolSearchCallExecution = "client"
-
-
Status ResponseToolSearchCallStatusThe status of the tool search call item that was recorded.
-
const ResponseToolSearchCallStatusInProgress ResponseToolSearchCallStatus = "in_progress" -
const ResponseToolSearchCallStatusCompleted ResponseToolSearchCallStatus = "completed" -
const ResponseToolSearchCallStatusIncomplete ResponseToolSearchCallStatus = "incomplete"
-
-
Type ToolSearchCallThe type of the item. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseToolSearchOutputItem struct{…}-
ID stringThe unique ID of the tool search output item.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemExecutionServer ResponseToolSearchOutputItemExecution = "server" -
const ResponseToolSearchOutputItemExecutionClient ResponseToolSearchOutputItemExecution = "client"
-
-
Status ResponseToolSearchOutputItemStatusThe status of the tool search output item that was recorded.
-
const ResponseToolSearchOutputItemStatusInProgress ResponseToolSearchOutputItemStatus = "in_progress" -
const ResponseToolSearchOutputItemStatusCompleted ResponseToolSearchOutputItemStatus = "completed" -
const ResponseToolSearchOutputItemStatusIncomplete ResponseToolSearchOutputItemStatus = "incomplete"
-
-
Tools []ToolUnionThe loaded tool definitions returned by tool search.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type ToolSearchOutputThe type of the item. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseOutputItemAdditionalTools struct{…}-
ID stringThe unique ID of the additional tools item.
-
Role stringThe role that provided the additional tools.
-
const ResponseOutputItemAdditionalToolsRoleUnknown ResponseOutputItemAdditionalToolsRole = "unknown" -
const ResponseOutputItemAdditionalToolsRoleUser ResponseOutputItemAdditionalToolsRole = "user" -
const ResponseOutputItemAdditionalToolsRoleAssistant ResponseOutputItemAdditionalToolsRole = "assistant" -
const ResponseOutputItemAdditionalToolsRoleSystem ResponseOutputItemAdditionalToolsRole = "system" -
const ResponseOutputItemAdditionalToolsRoleCritic ResponseOutputItemAdditionalToolsRole = "critic" -
const ResponseOutputItemAdditionalToolsRoleDiscriminator ResponseOutputItemAdditionalToolsRole = "discriminator" -
const ResponseOutputItemAdditionalToolsRoleDeveloper ResponseOutputItemAdditionalToolsRole = "developer" -
const ResponseOutputItemAdditionalToolsRoleTool ResponseOutputItemAdditionalToolsRole = "tool"
-
-
Tools []ToolUnionThe additional tool definitions made available at this item.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type AdditionalToolsThe type of the item. Always
additional_tools.const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"
-
-
type ResponseCompactionItem struct{…}A compaction item generated by the
v1/responses/compactAPI.-
ID stringThe unique ID of the compaction item.
-
EncryptedContent stringThe encrypted content that was produced by compaction.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseOutputItemImageGenerationCall struct{…}An image generation request made by the model.
-
ID stringThe unique ID of the image generation call.
-
Result stringThe generated image encoded in base64.
-
Status stringThe status of the image generation call.
-
const ResponseOutputItemImageGenerationCallStatusInProgress ResponseOutputItemImageGenerationCallStatus = "in_progress" -
const ResponseOutputItemImageGenerationCallStatusCompleted ResponseOutputItemImageGenerationCallStatus = "completed" -
const ResponseOutputItemImageGenerationCallStatusGenerating ResponseOutputItemImageGenerationCallStatus = "generating" -
const ResponseOutputItemImageGenerationCallStatusFailed ResponseOutputItemImageGenerationCallStatus = "failed"
-
-
Type ImageGenerationCallThe type of the image generation call. Always
image_generation_call.const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"
-
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
type ResponseOutputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
ID stringThe unique ID of the local shell call.
-
Action ResponseOutputItemLocalShellCallActionExecute a shell command on the server.
-
Command []stringThe command to run.
-
Env map[string, string]Environment variables to set for the command.
-
Type ExecThe type of the local shell action. Always
exec.const ExecExec Exec = "exec"
-
TimeoutMs int64Optional timeout in milliseconds for the command.
-
User stringOptional user to run the command as.
-
WorkingDirectory stringOptional working directory to run the command in.
-
-
CallID stringThe unique ID of the local shell tool call generated by the model.
-
Status stringThe status of the local shell call.
-
const ResponseOutputItemLocalShellCallStatusInProgress ResponseOutputItemLocalShellCallStatus = "in_progress" -
const ResponseOutputItemLocalShellCallStatusCompleted ResponseOutputItemLocalShellCallStatus = "completed" -
const ResponseOutputItemLocalShellCallStatusIncomplete ResponseOutputItemLocalShellCallStatus = "incomplete"
-
-
Type LocalShellCallThe type of the local shell call. Always
local_shell_call.const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"
-
-
type ResponseOutputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
ID stringThe unique ID of the local shell tool call generated by the model.
-
Output stringA JSON string of the output of the local shell tool call.
-
Type LocalShellCallOutputThe type of the local shell tool call output. Always
local_shell_call_output.const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete.-
const ResponseOutputItemLocalShellCallOutputStatusInProgress ResponseOutputItemLocalShellCallOutputStatus = "in_progress" -
const ResponseOutputItemLocalShellCallOutputStatusCompleted ResponseOutputItemLocalShellCallOutputStatus = "completed" -
const ResponseOutputItemLocalShellCallOutputStatusIncomplete ResponseOutputItemLocalShellCallOutputStatus = "incomplete"
-
-
-
type ResponseFunctionShellToolCall struct{…}A tool call that executes one or more shell commands in a managed environment.
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Action ResponseFunctionShellToolCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []string -
MaxOutputLength int64Optional maximum number of characters to return from each command.
-
TimeoutMs int64Optional timeout in milliseconds for the commands.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Environment ResponseFunctionShellToolCallEnvironmentUnionRepresents the use of a local environment to perform shell actions.
-
type ResponseLocalEnvironment struct{…}Represents the use of a local environment to perform shell actions.
-
Type LocalThe environment type. Always
local.const LocalLocal Local = "local"
-
-
type ResponseContainerReference struct{…}Represents a container created with /v1/containers.
-
ContainerID string -
Type ContainerReferenceThe environment type. Always
container_reference.const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
Status ResponseFunctionShellToolCallStatusThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallStatusInProgress ResponseFunctionShellToolCallStatus = "in_progress" -
const ResponseFunctionShellToolCallStatusCompleted ResponseFunctionShellToolCallStatus = "completed" -
const ResponseFunctionShellToolCallStatusIncomplete ResponseFunctionShellToolCallStatus = "incomplete"
-
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseFunctionShellToolCallOutput struct{…}The output of a shell tool call that was emitted.
-
ID stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
MaxOutputLength int64The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
Output []ResponseFunctionShellToolCallOutputOutputAn array of shell call output contents
-
Outcome ResponseFunctionShellToolCallOutputOutputOutcomeUnionRepresents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
type ResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64Exit code from the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringThe standard error output that was captured.
-
Stdout stringThe standard output that was captured.
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
Status ResponseFunctionShellToolCallOutputStatusThe status of the shell call output. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallOutputStatusInProgress ResponseFunctionShellToolCallOutputStatus = "in_progress" -
const ResponseFunctionShellToolCallOutputStatusCompleted ResponseFunctionShellToolCallOutputStatus = "completed" -
const ResponseFunctionShellToolCallOutputStatusIncomplete ResponseFunctionShellToolCallOutputStatus = "incomplete"
-
-
Type ShellCallOutputThe type of the shell call output. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseApplyPatchToolCall struct{…}A tool call that applies file diffs by creating, deleting, or updating files.
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseApplyPatchToolCallOperationUnionOne of the create_file, delete_file, or update_file operations applied via apply_patch.
-
type ResponseApplyPatchToolCallOperationCreateFile struct{…}Instruction describing how to create a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to create.
-
Type CreateFileCreate a new file with the provided diff.
const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseApplyPatchToolCallOperationDeleteFile struct{…}Instruction describing how to delete a file via the apply_patch tool.
-
Path stringPath of the file to delete.
-
Type DeleteFileDelete the specified file.
const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseApplyPatchToolCallOperationUpdateFile struct{…}Instruction describing how to update a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to update.
-
Type UpdateFileUpdate an existing file with the provided diff.
const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status ResponseApplyPatchToolCallStatusThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseApplyPatchToolCallStatusInProgress ResponseApplyPatchToolCallStatus = "in_progress" -
const ResponseApplyPatchToolCallStatusCompleted ResponseApplyPatchToolCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseApplyPatchToolCallOutput struct{…}The output emitted by an apply patch tool call.
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status ResponseApplyPatchToolCallOutputStatusThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseApplyPatchToolCallOutputStatusCompleted ResponseApplyPatchToolCallOutputStatus = "completed" -
const ResponseApplyPatchToolCallOutputStatusFailed ResponseApplyPatchToolCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
CreatedBy stringThe ID of the entity that created this tool call output.
-
Output stringOptional textual output returned by the apply patch tool.
-
-
type ResponseOutputItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
ID stringThe unique ID of the tool call.
-
Arguments stringA JSON string of the arguments passed to the tool.
-
Name stringThe name of the tool that was run.
-
ServerLabel stringThe label of the MCP server running the tool.
-
Type McpCallThe type of the item. Always
mcp_call.const McpCallMcpCall McpCall = "mcp_call"
-
ApprovalRequestID stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
Error stringThe error from the tool call, if any.
-
Output stringThe output from the tool call.
-
Status stringThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
const ResponseOutputItemMcpCallStatusInProgress ResponseOutputItemMcpCallStatus = "in_progress" -
const ResponseOutputItemMcpCallStatusCompleted ResponseOutputItemMcpCallStatus = "completed" -
const ResponseOutputItemMcpCallStatusIncomplete ResponseOutputItemMcpCallStatus = "incomplete" -
const ResponseOutputItemMcpCallStatusCalling ResponseOutputItemMcpCallStatus = "calling" -
const ResponseOutputItemMcpCallStatusFailed ResponseOutputItemMcpCallStatus = "failed"
-
-
-
type ResponseOutputItemMcpListTools struct{…}A list of tools available on an MCP server.
-
ID stringThe unique ID of the list.
-
ServerLabel stringThe label of the MCP server.
-
Tools []ResponseOutputItemMcpListToolsToolThe tools available on the server.
-
InputSchema anyThe JSON schema describing the tool's input.
-
Name stringThe name of the tool.
-
Annotations anyAdditional annotations about the tool.
-
Description stringThe description of the tool.
-
-
Type McpListToolsThe type of the item. Always
mcp_list_tools.const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
-
Error stringError message if the server could not list tools.
-
-
type ResponseOutputItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
ID stringThe unique ID of the approval request.
-
Arguments stringA JSON string of arguments for the tool.
-
Name stringThe name of the tool to run.
-
ServerLabel stringThe label of the MCP server making the request.
-
Type McpApprovalRequestThe type of the item. Always
mcp_approval_request.const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"
-
-
type ResponseOutputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
ID stringThe unique ID of the approval response
-
ApprovalRequestID stringThe ID of the approval request being answered.
-
Approve boolWhether the request was approved.
-
Type McpApprovalResponseThe type of the item. Always
mcp_approval_response.const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
-
Reason stringOptional reason for the decision.
-
-
type ResponseCustomToolCall struct{…}A call to a custom tool created by the model.
-
type ResponseCustomToolCallOutputItem struct{…}The output of a custom tool call from your code, being sent back to the model.
-
ID stringThe unique ID of the custom tool call output item.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseCustomToolCallOutputItemStatusInProgress ResponseCustomToolCallOutputItemStatus = "in_progress" -
const ResponseCustomToolCallOutputItemStatusCompleted ResponseCustomToolCallOutputItemStatus = "completed" -
const ResponseCustomToolCallOutputItemStatusIncomplete ResponseCustomToolCallOutputItemStatus = "incomplete"
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
-
ParallelToolCalls boolWhether to allow the model to run tool calls in parallel.
-
Temperature float64What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or
top_pbut not both. -
ToolChoice ResponseToolChoiceUnionHow the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call.-
type ToolChoiceOptions stringControls which (if any) tool is called by the model.
nonemeans the model will not call any tool and instead generates a message.automeans the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools.-
const ToolChoiceOptionsNone ToolChoiceOptions = "none" -
const ToolChoiceOptionsAuto ToolChoiceOptions = "auto" -
const ToolChoiceOptionsRequired ToolChoiceOptions = "required"
-
-
type ToolChoiceAllowed struct{…}Constrains the tools available to the model to a pre-defined set.
-
Mode ToolChoiceAllowedModeConstrains the tools available to the model to a pre-defined set.
autoallows the model to pick from among the allowed tools and generate a message.requiredrequires the model to call one or more of the allowed tools.-
const ToolChoiceAllowedModeAuto ToolChoiceAllowedMode = "auto" -
const ToolChoiceAllowedModeRequired ToolChoiceAllowedMode = "required"
-
-
Tools []map[string, any]A list of tool definitions that the model should be allowed to call.
For the Responses API, the list of tool definitions might look like:
[ { "type": "function", "name": "get_weather" }, { "type": "mcp", "server_label": "deepwiki" }, { "type": "image_generation" } ] -
Type AllowedToolsAllowed tool configuration type. Always
allowed_tools.const AllowedToolsAllowedTools AllowedTools = "allowed_tools"
-
-
type ToolChoiceTypes struct{…}Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
-
Type ToolChoiceTypesTypeThe type of hosted tool the model should to use. Learn more about built-in tools.
Allowed values are:
-
file_search -
web_search_preview -
computer -
computer_use_preview -
computer_use -
code_interpreter -
image_generation -
const ToolChoiceTypesTypeFileSearch ToolChoiceTypesType = "file_search" -
const ToolChoiceTypesTypeWebSearchPreview ToolChoiceTypesType = "web_search_preview" -
const ToolChoiceTypesTypeComputer ToolChoiceTypesType = "computer" -
const ToolChoiceTypesTypeComputerUsePreview ToolChoiceTypesType = "computer_use_preview" -
const ToolChoiceTypesTypeComputerUse ToolChoiceTypesType = "computer_use" -
const ToolChoiceTypesTypeWebSearchPreview2025_03_11 ToolChoiceTypesType = "web_search_preview_2025_03_11" -
const ToolChoiceTypesTypeImageGeneration ToolChoiceTypesType = "image_generation" -
const ToolChoiceTypesTypeCodeInterpreter ToolChoiceTypesType = "code_interpreter"
-
-
-
type ToolChoiceFunction struct{…}Use this option to force the model to call a specific function.
-
Name stringThe name of the function to call.
-
Type FunctionFor function calling, the type is always
function.const FunctionFunction Function = "function"
-
-
type ToolChoiceMcp struct{…}Use this option to force the model to call a specific tool on a remote MCP server.
-
ServerLabel stringThe label of the MCP server to use.
-
Type McpFor MCP tools, the type is always
mcp.const McpMcp Mcp = "mcp"
-
Name stringThe name of the tool to call on the server.
-
-
type ToolChoiceCustom struct{…}Use this option to force the model to call a specific custom tool.
-
Name stringThe name of the custom tool to call.
-
Type CustomFor custom tool calling, the type is always
custom.const CustomCustom Custom = "custom"
-
-
type ToolChoiceApplyPatch struct{…}Forces the model to call the apply_patch tool when executing a tool call.
-
Type ApplyPatchThe tool to call. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
type ToolChoiceShell struct{…}Forces the model to call the shell tool when a tool call is required.
-
Type ShellThe tool to call. Always
shell.const ShellShell Shell = "shell"
-
-
-
Tools []ToolUnionAn array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.We support the following categories of tools:
-
Built-in tools: Tools that are provided by OpenAI that extend the model's capabilities, like web search or file search. Learn more about built-in tools.
-
MCP Tools: Integrations with third-party systems via custom MCP servers or predefined connectors such as Google Drive and SharePoint. Learn more about MCP Tools.
-
Function calls (custom tools): Functions that are defined by you, enabling the model to call your own code with strongly typed arguments and outputs. Learn more about function calling. You can also use custom tools to call your own code.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
TopP float64An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
We generally recommend altering this or
temperaturebut not both. -
Background boolWhether to run the model response in the background. Learn more.
-
CompletedAt float64Unix timestamp (in seconds) of when this Response was completed. Only present when the status is
completed. -
Conversation ResponseConversationThe conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
-
ID stringThe unique ID of the conversation that this response was associated with.
-
-
MaxOutputTokens int64An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
MaxToolCalls int64The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored.
-
Moderation ResponseModerationModeration results for the response input and output, if moderated completions were requested.
-
Input ResponseModerationInputUnionModeration for the response input.
-
type ResponseModerationInputModerationResult struct{…}A moderation result produced for the response input or output.
-
Categories map[string, bool]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
CategoryAppliedInputTypes map[string, []string]Which modalities of input are reflected by the score for each category.
-
const ResponseModerationInputModerationResultCategoryAppliedInputTypeText ResponseModerationInputModerationResultCategoryAppliedInputType = "text" -
const ResponseModerationInputModerationResultCategoryAppliedInputTypeImage ResponseModerationInputModerationResultCategoryAppliedInputType = "image"
-
-
CategoryScores map[string, float64]A dictionary of moderation categories to scores.
-
Flagged boolA boolean indicating whether the content was flagged by any category.
-
Model stringThe moderation model that produced this result.
-
Type ModerationResultThe object type, which was always
moderation_resultfor successful moderation results.const ModerationResultModerationResult ModerationResult = "moderation_result"
-
-
type ResponseModerationInputError struct{…}An error produced while attempting moderation for the response input or output.
-
Code stringThe error code.
-
Message stringThe error message.
-
Type ErrorThe object type, which was always
errorfor moderation failures.const ErrorError Error = "error"
-
-
-
Output ResponseModerationOutputUnionModeration for the response output.
-
type ResponseModerationOutputModerationResult struct{…}A moderation result produced for the response input or output.
-
Categories map[string, bool]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
CategoryAppliedInputTypes map[string, []string]Which modalities of input are reflected by the score for each category.
-
const ResponseModerationOutputModerationResultCategoryAppliedInputTypeText ResponseModerationOutputModerationResultCategoryAppliedInputType = "text" -
const ResponseModerationOutputModerationResultCategoryAppliedInputTypeImage ResponseModerationOutputModerationResultCategoryAppliedInputType = "image"
-
-
CategoryScores map[string, float64]A dictionary of moderation categories to scores.
-
Flagged boolA boolean indicating whether the content was flagged by any category.
-
Model stringThe moderation model that produced this result.
-
Type ModerationResultThe object type, which was always
moderation_resultfor successful moderation results.const ModerationResultModerationResult ModerationResult = "moderation_result"
-
-
type ResponseModerationOutputError struct{…}An error produced while attempting moderation for the response input or output.
-
Code stringThe error code.
-
Message stringThe error message.
-
Type ErrorThe object type, which was always
errorfor moderation failures.const ErrorError Error = "error"
-
-
-
-
PreviousResponseID stringThe unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about conversation state. Cannot be used in conjunction with
conversation. -
Prompt ResponsePromptReference to a prompt template and its variables. Learn more.
-
ID stringThe unique identifier of the prompt template to use.
-
Variables map[string, ResponsePromptVariableUnion]Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files.
-
string -
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
Version stringOptional version of the prompt template.
-
-
PromptCacheKey stringUsed by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more. -
PromptCacheRetention ResponsePromptCacheRetentionThe retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. Forgpt-5.5,gpt-5.5-pro, and future models, only24his supported.For older models that support both
in_memoryand24h, the default depends on your organization's data retention policy:-
Organizations without ZDR enabled default to
24h. -
Organizations with ZDR enabled default to
in_memorywhenprompt_cache_retentionis not specified. -
const ResponsePromptCacheRetentionInMemory ResponsePromptCacheRetention = "in_memory" -
const ResponsePromptCacheRetention24h ResponsePromptCacheRetention = "24h"
-
-
Reasoning Reasoninggpt-5 and o-series models only
Configuration options for reasoning models.
-
Context ReasoningContextControls which reasoning items are rendered back to the model on later turns. When returned on a response, this is the effective reasoning context mode used for the response.
-
const ReasoningContextAuto ReasoningContext = "auto" -
const ReasoningContextCurrentTurn ReasoningContext = "current_turn" -
const ReasoningContextAllTurns ReasoningContext = "all_turns"
-
-
Effort ReasoningEffortConstrains effort on reasoning for reasoning models. Currently supported values are
none,minimal,low,medium,high, andxhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.-
gpt-5.1defaults tonone, which does not perform reasoning. The supported reasoning values forgpt-5.1arenone,low,medium, andhigh. Tool calls are supported for all reasoning values in gpt-5.1. -
All models before
gpt-5.1default tomediumreasoning effort, and do not supportnone. -
The
gpt-5-promodel defaults to (and only supports)highreasoning effort. -
xhighis supported for all models aftergpt-5.1-codex-max. -
const ReasoningEffortNone ReasoningEffort = "none" -
const ReasoningEffortMinimal ReasoningEffort = "minimal" -
const ReasoningEffortLow ReasoningEffort = "low" -
const ReasoningEffortMedium ReasoningEffort = "medium" -
const ReasoningEffortHigh ReasoningEffort = "high" -
const ReasoningEffortXhigh ReasoningEffort = "xhigh"
-
-
GenerateSummary ReasoningGenerateSummaryDeprecated: use
summaryinstead.A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.-
const ReasoningGenerateSummaryAuto ReasoningGenerateSummary = "auto" -
const ReasoningGenerateSummaryConcise ReasoningGenerateSummary = "concise" -
const ReasoningGenerateSummaryDetailed ReasoningGenerateSummary = "detailed"
-
-
Summary ReasoningSummaryA summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.conciseis supported forcomputer-use-previewmodels and all reasoning models aftergpt-5.-
const ReasoningSummaryAuto ReasoningSummary = "auto" -
const ReasoningSummaryConcise ReasoningSummary = "concise" -
const ReasoningSummaryDetailed ReasoningSummary = "detailed"
-
-
-
SafetyIdentifier stringA stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
ServiceTier ResponseServiceTierSpecifies the processing type used for serving the request.
- If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'.
- If set to 'default', then the request will be processed with the standard pricing and performance for the selected model.
- If set to 'flex' or 'priority', then the request will be processed with the corresponding service tier.
- When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.-
const ResponseServiceTierAuto ResponseServiceTier = "auto" -
const ResponseServiceTierDefault ResponseServiceTier = "default" -
const ResponseServiceTierFlex ResponseServiceTier = "flex" -
const ResponseServiceTierScale ResponseServiceTier = "scale" -
const ResponseServiceTierPriority ResponseServiceTier = "priority"
-
Status ResponseStatusThe status of the response generation. One of
completed,failed,in_progress,cancelled,queued, orincomplete.-
const ResponseStatusCompleted ResponseStatus = "completed" -
const ResponseStatusFailed ResponseStatus = "failed" -
const ResponseStatusInProgress ResponseStatus = "in_progress" -
const ResponseStatusCancelled ResponseStatus = "cancelled" -
const ResponseStatusQueued ResponseStatus = "queued" -
const ResponseStatusIncomplete ResponseStatus = "incomplete"
-
-
Text ResponseTextConfigConfiguration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
Format ResponseFormatTextConfigUnionAn object specifying the format that the model must output.
Configuring
{ "type": "json_schema" }enables Structured Outputs, which ensures the model will match your supplied JSON schema. Learn more in the Structured Outputs guide.The default format is
{ "type": "text" }with no additional options.Not recommended for gpt-4o and newer models:
Setting to
{ "type": "json_object" }enables the older JSON mode, which ensures the message the model generates is valid JSON. Usingjson_schemais preferred for models that support it.-
type ResponseFormatText struct{…}Default response format. Used to generate text responses.
-
Type TextThe type of response format being defined. Always
text.const TextText Text = "text"
-
-
type ResponseFormatTextJSONSchemaConfig struct{…}JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
Name stringThe name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
-
Schema map[string, any]The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
-
Type JSONSchemaThe type of response format being defined. Always
json_schema.const JSONSchemaJSONSchema JSONSchema = "json_schema"
-
Description stringA description of what the response format is for, used by the model to determine how to respond in the format.
-
Strict boolWhether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the
schemafield. Only a subset of JSON Schema is supported whenstrictistrue. To learn more, read the Structured Outputs guide.
-
-
type ResponseFormatJSONObject struct{…}JSON object response format. An older method of generating JSON responses. Using
json_schemais 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 JSONObjectThe type of response format being defined. Always
json_object.const JSONObjectJSONObject JSONObject = "json_object"
-
-
-
Verbosity ResponseTextConfigVerbosityConstrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses. Currently supported values are
low,medium, andhigh.-
const ResponseTextConfigVerbosityLow ResponseTextConfigVerbosity = "low" -
const ResponseTextConfigVerbosityMedium ResponseTextConfigVerbosity = "medium" -
const ResponseTextConfigVerbosityHigh ResponseTextConfigVerbosity = "high"
-
-
TopLogprobs int64An integer between 0 and 20 specifying the maximum number of most likely tokens to return at each token position, each with an associated log probability. In some cases, the number of returned tokens may be fewer than requested.
-
Truncation ResponseTruncationThe truncation strategy to use for the model response.
-
auto: If the input to this Response exceeds the model's context window size, the model will truncate the response to fit the context window by dropping items from the beginning of the conversation. -
disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error. -
const ResponseTruncationAuto ResponseTruncation = "auto" -
const ResponseTruncationDisabled ResponseTruncation = "disabled"
-
-
Usage ResponseUsageRepresents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
-
InputTokens int64The number of input tokens.
-
InputTokensDetails ResponseUsageInputTokensDetailsA detailed breakdown of the input tokens.
-
CachedTokens int64The number of tokens that were retrieved from the cache. More on prompt caching.
-
-
OutputTokens int64The number of output tokens.
-
OutputTokensDetails ResponseUsageOutputTokensDetailsA detailed breakdown of the output tokens.
-
ReasoningTokens int64The number of reasoning tokens.
-
-
TotalTokens int64The total number of tokens used.
-
-
User stringThis field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead to maintain caching optimizations. A stable identifier for your end-users. Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. Learn more.
-
-
SequenceNumber int64The sequence number for this event.
-
Type ResponseCompletedThe type of the event. Always
response.completed.const ResponseCompletedResponseCompleted ResponseCompleted = "response.completed"
-
-
type ResponseContentPartAddedEvent struct{…}Emitted when a new content part is added.
-
ContentIndex int64The index of the content part that was added.
-
ItemID stringThe ID of the output item that the content part was added to.
-
OutputIndex int64The index of the output item that the content part was added to.
-
Part ResponseContentPartAddedEventPartUnionThe content part that was added.
-
type ResponseOutputText struct{…}A text output from the model.
-
type ResponseOutputRefusal struct{…}A refusal from the model.
-
type ResponseContentPartAddedEventPartReasoningText struct{…}Reasoning text from the model.
-
Text stringThe reasoning text from the model.
-
Type ReasoningTextThe type of the reasoning text. Always
reasoning_text.const ReasoningTextReasoningText ReasoningText = "reasoning_text"
-
-
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseContentPartAddedThe type of the event. Always
response.content_part.added.const ResponseContentPartAddedResponseContentPartAdded ResponseContentPartAdded = "response.content_part.added"
-
-
type ResponseContentPartDoneEvent struct{…}Emitted when a content part is done.
-
ContentIndex int64The index of the content part that is done.
-
ItemID stringThe ID of the output item that the content part was added to.
-
OutputIndex int64The index of the output item that the content part was added to.
-
Part ResponseContentPartDoneEventPartUnionThe content part that is done.
-
type ResponseOutputText struct{…}A text output from the model.
-
type ResponseOutputRefusal struct{…}A refusal from the model.
-
type ResponseContentPartDoneEventPartReasoningText struct{…}Reasoning text from the model.
-
Text stringThe reasoning text from the model.
-
Type ReasoningTextThe type of the reasoning text. Always
reasoning_text.const ReasoningTextReasoningText ReasoningText = "reasoning_text"
-
-
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseContentPartDoneThe type of the event. Always
response.content_part.done.const ResponseContentPartDoneResponseContentPartDone ResponseContentPartDone = "response.content_part.done"
-
-
type ResponseCreatedEvent struct{…}An event that is emitted when a response is created.
-
Response ResponseThe response that was created.
-
SequenceNumber int64The sequence number for this event.
-
Type ResponseCreatedThe type of the event. Always
response.created.const ResponseCreatedResponseCreated ResponseCreated = "response.created"
-
-
type ResponseErrorEvent struct{…}Emitted when an error occurs.
-
Code stringThe error code.
-
Message stringThe error message.
-
Param stringThe error parameter.
-
SequenceNumber int64The sequence number of this event.
-
Type ErrorThe type of the event. Always
error.const ErrorError Error = "error"
-
-
type ResponseFileSearchCallCompletedEvent struct{…}Emitted when a file search call is completed (results found).
-
ItemID stringThe ID of the output item that the file search call is initiated.
-
OutputIndex int64The index of the output item that the file search call is initiated.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseFileSearchCallCompletedThe type of the event. Always
response.file_search_call.completed.const ResponseFileSearchCallCompletedResponseFileSearchCallCompleted ResponseFileSearchCallCompleted = "response.file_search_call.completed"
-
-
type ResponseFileSearchCallInProgressEvent struct{…}Emitted when a file search call is initiated.
-
ItemID stringThe ID of the output item that the file search call is initiated.
-
OutputIndex int64The index of the output item that the file search call is initiated.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseFileSearchCallInProgressThe type of the event. Always
response.file_search_call.in_progress.const ResponseFileSearchCallInProgressResponseFileSearchCallInProgress ResponseFileSearchCallInProgress = "response.file_search_call.in_progress"
-
-
type ResponseFileSearchCallSearchingEvent struct{…}Emitted when a file search is currently searching.
-
ItemID stringThe ID of the output item that the file search call is initiated.
-
OutputIndex int64The index of the output item that the file search call is searching.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseFileSearchCallSearchingThe type of the event. Always
response.file_search_call.searching.const ResponseFileSearchCallSearchingResponseFileSearchCallSearching ResponseFileSearchCallSearching = "response.file_search_call.searching"
-
-
type ResponseFunctionCallArgumentsDeltaEvent struct{…}Emitted when there is a partial function-call arguments delta.
-
Delta stringThe function-call arguments delta that is added.
-
ItemID stringThe ID of the output item that the function-call arguments delta is added to.
-
OutputIndex int64The index of the output item that the function-call arguments delta is added to.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseFunctionCallArgumentsDeltaThe type of the event. Always
response.function_call_arguments.delta.const ResponseFunctionCallArgumentsDeltaResponseFunctionCallArgumentsDelta ResponseFunctionCallArgumentsDelta = "response.function_call_arguments.delta"
-
-
type ResponseFunctionCallArgumentsDoneEvent struct{…}Emitted when function-call arguments are finalized.
-
Arguments stringThe function-call arguments.
-
ItemID stringThe ID of the item.
-
Name stringThe name of the function that was called.
-
OutputIndex int64The index of the output item.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseFunctionCallArgumentsDoneconst ResponseFunctionCallArgumentsDoneResponseFunctionCallArgumentsDone ResponseFunctionCallArgumentsDone = "response.function_call_arguments.done"
-
-
type ResponseInProgressEvent struct{…}Emitted when the response is in progress.
-
Response ResponseThe response that is in progress.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseInProgressThe type of the event. Always
response.in_progress.const ResponseInProgressResponseInProgress ResponseInProgress = "response.in_progress"
-
-
type ResponseFailedEvent struct{…}An event that is emitted when a response fails.
-
Response ResponseThe response that failed.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseFailedThe type of the event. Always
response.failed.const ResponseFailedResponseFailed ResponseFailed = "response.failed"
-
-
type ResponseIncompleteEvent struct{…}An event that is emitted when a response finishes as incomplete.
-
Response ResponseThe response that was incomplete.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseIncompleteThe type of the event. Always
response.incomplete.const ResponseIncompleteResponseIncomplete ResponseIncomplete = "response.incomplete"
-
-
type ResponseOutputItemAddedEvent struct{…}Emitted when a new output item is added.
-
Item ResponseOutputItemUnionThe output item that was added.
-
type ResponseOutputMessage struct{…}An output message from the model.
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
type ResponseFunctionToolCall struct{…}A tool call to run a function. See the function calling guide for more information.
-
type ResponseFunctionToolCallOutputItem struct{…} -
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
type ResponseComputerToolCallOutputItem struct{…} -
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context. -
type ResponseToolSearchCall struct{…} -
type ResponseToolSearchOutputItem struct{…} -
type ResponseOutputItemAdditionalTools struct{…} -
type ResponseCompactionItem struct{…}A compaction item generated by the
v1/responses/compactAPI. -
type ResponseOutputItemImageGenerationCall struct{…}An image generation request made by the model.
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
type ResponseOutputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
type ResponseOutputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
type ResponseFunctionShellToolCall struct{…}A tool call that executes one or more shell commands in a managed environment.
-
type ResponseFunctionShellToolCallOutput struct{…}The output of a shell tool call that was emitted.
-
type ResponseApplyPatchToolCall struct{…}A tool call that applies file diffs by creating, deleting, or updating files.
-
type ResponseApplyPatchToolCallOutput struct{…}The output emitted by an apply patch tool call.
-
type ResponseOutputItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
type ResponseOutputItemMcpListTools struct{…}A list of tools available on an MCP server.
-
type ResponseOutputItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
type ResponseOutputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
type ResponseCustomToolCall struct{…}A call to a custom tool created by the model.
-
type ResponseCustomToolCallOutputItem struct{…}The output of a custom tool call from your code, being sent back to the model.
-
-
OutputIndex int64The index of the output item that was added.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseOutputItemAddedThe type of the event. Always
response.output_item.added.const ResponseOutputItemAddedResponseOutputItemAdded ResponseOutputItemAdded = "response.output_item.added"
-
-
type ResponseOutputItemDoneEvent struct{…}Emitted when an output item is marked done.
-
Item ResponseOutputItemUnionThe output item that was marked done.
-
OutputIndex int64The index of the output item that was marked done.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseOutputItemDoneThe type of the event. Always
response.output_item.done.const ResponseOutputItemDoneResponseOutputItemDone ResponseOutputItemDone = "response.output_item.done"
-
-
type ResponseReasoningSummaryPartAddedEvent struct{…}Emitted when a new reasoning summary part is added.
-
ItemID stringThe ID of the item this summary part is associated with.
-
OutputIndex int64The index of the output item this summary part is associated with.
-
Part ResponseReasoningSummaryPartAddedEventPartThe summary part that was added.
-
Text stringThe text of the summary part.
-
Type SummaryTextThe type of the summary part. Always
summary_text.const SummaryTextSummaryText SummaryText = "summary_text"
-
-
SequenceNumber int64The sequence number of this event.
-
SummaryIndex int64The index of the summary part within the reasoning summary.
-
Type ResponseReasoningSummaryPartAddedThe type of the event. Always
response.reasoning_summary_part.added.const ResponseReasoningSummaryPartAddedResponseReasoningSummaryPartAdded ResponseReasoningSummaryPartAdded = "response.reasoning_summary_part.added"
-
-
type ResponseReasoningSummaryPartDoneEvent struct{…}Emitted when a reasoning summary part is completed.
-
ItemID stringThe ID of the item this summary part is associated with.
-
OutputIndex int64The index of the output item this summary part is associated with.
-
Part ResponseReasoningSummaryPartDoneEventPartThe completed summary part.
-
Text stringThe text of the summary part.
-
Type SummaryTextThe type of the summary part. Always
summary_text.const SummaryTextSummaryText SummaryText = "summary_text"
-
-
SequenceNumber int64The sequence number of this event.
-
SummaryIndex int64The index of the summary part within the reasoning summary.
-
Type ResponseReasoningSummaryPartDoneThe type of the event. Always
response.reasoning_summary_part.done.const ResponseReasoningSummaryPartDoneResponseReasoningSummaryPartDone ResponseReasoningSummaryPartDone = "response.reasoning_summary_part.done"
-
-
type ResponseReasoningSummaryTextDeltaEvent struct{…}Emitted when a delta is added to a reasoning summary text.
-
Delta stringThe text delta that was added to the summary.
-
ItemID stringThe ID of the item this summary text delta is associated with.
-
OutputIndex int64The index of the output item this summary text delta is associated with.
-
SequenceNumber int64The sequence number of this event.
-
SummaryIndex int64The index of the summary part within the reasoning summary.
-
Type ResponseReasoningSummaryTextDeltaThe type of the event. Always
response.reasoning_summary_text.delta.const ResponseReasoningSummaryTextDeltaResponseReasoningSummaryTextDelta ResponseReasoningSummaryTextDelta = "response.reasoning_summary_text.delta"
-
-
type ResponseReasoningSummaryTextDoneEvent struct{…}Emitted when a reasoning summary text is completed.
-
ItemID stringThe ID of the item this summary text is associated with.
-
OutputIndex int64The index of the output item this summary text is associated with.
-
SequenceNumber int64The sequence number of this event.
-
SummaryIndex int64The index of the summary part within the reasoning summary.
-
Text stringThe full text of the completed reasoning summary.
-
Type ResponseReasoningSummaryTextDoneThe type of the event. Always
response.reasoning_summary_text.done.const ResponseReasoningSummaryTextDoneResponseReasoningSummaryTextDone ResponseReasoningSummaryTextDone = "response.reasoning_summary_text.done"
-
-
type ResponseReasoningTextDeltaEvent struct{…}Emitted when a delta is added to a reasoning text.
-
ContentIndex int64The index of the reasoning content part this delta is associated with.
-
Delta stringThe text delta that was added to the reasoning content.
-
ItemID stringThe ID of the item this reasoning text delta is associated with.
-
OutputIndex int64The index of the output item this reasoning text delta is associated with.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseReasoningTextDeltaThe type of the event. Always
response.reasoning_text.delta.const ResponseReasoningTextDeltaResponseReasoningTextDelta ResponseReasoningTextDelta = "response.reasoning_text.delta"
-
-
type ResponseReasoningTextDoneEvent struct{…}Emitted when a reasoning text is completed.
-
ContentIndex int64The index of the reasoning content part.
-
ItemID stringThe ID of the item this reasoning text is associated with.
-
OutputIndex int64The index of the output item this reasoning text is associated with.
-
SequenceNumber int64The sequence number of this event.
-
Text stringThe full text of the completed reasoning content.
-
Type ResponseReasoningTextDoneThe type of the event. Always
response.reasoning_text.done.const ResponseReasoningTextDoneResponseReasoningTextDone ResponseReasoningTextDone = "response.reasoning_text.done"
-
-
type ResponseRefusalDeltaEvent struct{…}Emitted when there is a partial refusal text.
-
ContentIndex int64The index of the content part that the refusal text is added to.
-
Delta stringThe refusal text that is added.
-
ItemID stringThe ID of the output item that the refusal text is added to.
-
OutputIndex int64The index of the output item that the refusal text is added to.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseRefusalDeltaThe type of the event. Always
response.refusal.delta.const ResponseRefusalDeltaResponseRefusalDelta ResponseRefusalDelta = "response.refusal.delta"
-
-
type ResponseRefusalDoneEvent struct{…}Emitted when refusal text is finalized.
-
ContentIndex int64The index of the content part that the refusal text is finalized.
-
ItemID stringThe ID of the output item that the refusal text is finalized.
-
OutputIndex int64The index of the output item that the refusal text is finalized.
-
Refusal stringThe refusal text that is finalized.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseRefusalDoneThe type of the event. Always
response.refusal.done.const ResponseRefusalDoneResponseRefusalDone ResponseRefusalDone = "response.refusal.done"
-
-
type ResponseTextDeltaEvent struct{…}Emitted when there is an additional text delta.
-
ContentIndex int64The index of the content part that the text delta was added to.
-
Delta stringThe text delta that was added.
-
ItemID stringThe ID of the output item that the text delta was added to.
-
Logprobs []ResponseTextDeltaEventLogprobThe log probabilities of the tokens in the delta.
-
Token stringA possible text token.
-
Logprob float64The log probability of this token.
-
TopLogprobs []ResponseTextDeltaEventLogprobTopLogprobThe log probabilities of up to 20 of the most likely tokens.
-
Token stringA possible text token.
-
Logprob float64The log probability of this token.
-
-
-
OutputIndex int64The index of the output item that the text delta was added to.
-
SequenceNumber int64The sequence number for this event.
-
Type ResponseOutputTextDeltaThe type of the event. Always
response.output_text.delta.const ResponseOutputTextDeltaResponseOutputTextDelta ResponseOutputTextDelta = "response.output_text.delta"
-
-
type ResponseTextDoneEvent struct{…}Emitted when text content is finalized.
-
ContentIndex int64The index of the content part that the text content is finalized.
-
ItemID stringThe ID of the output item that the text content is finalized.
-
Logprobs []ResponseTextDoneEventLogprobThe log probabilities of the tokens in the delta.
-
Token stringA possible text token.
-
Logprob float64The log probability of this token.
-
TopLogprobs []ResponseTextDoneEventLogprobTopLogprobThe log probabilities of up to 20 of the most likely tokens.
-
Token stringA possible text token.
-
Logprob float64The log probability of this token.
-
-
-
OutputIndex int64The index of the output item that the text content is finalized.
-
SequenceNumber int64The sequence number for this event.
-
Text stringThe text content that is finalized.
-
Type ResponseOutputTextDoneThe type of the event. Always
response.output_text.done.const ResponseOutputTextDoneResponseOutputTextDone ResponseOutputTextDone = "response.output_text.done"
-
-
type ResponseWebSearchCallCompletedEvent struct{…}Emitted when a web search call is completed.
-
ItemID stringUnique ID for the output item associated with the web search call.
-
OutputIndex int64The index of the output item that the web search call is associated with.
-
SequenceNumber int64The sequence number of the web search call being processed.
-
Type ResponseWebSearchCallCompletedThe type of the event. Always
response.web_search_call.completed.const ResponseWebSearchCallCompletedResponseWebSearchCallCompleted ResponseWebSearchCallCompleted = "response.web_search_call.completed"
-
-
type ResponseWebSearchCallInProgressEvent struct{…}Emitted when a web search call is initiated.
-
ItemID stringUnique ID for the output item associated with the web search call.
-
OutputIndex int64The index of the output item that the web search call is associated with.
-
SequenceNumber int64The sequence number of the web search call being processed.
-
Type ResponseWebSearchCallInProgressThe type of the event. Always
response.web_search_call.in_progress.const ResponseWebSearchCallInProgressResponseWebSearchCallInProgress ResponseWebSearchCallInProgress = "response.web_search_call.in_progress"
-
-
type ResponseWebSearchCallSearchingEvent struct{…}Emitted when a web search call is executing.
-
ItemID stringUnique ID for the output item associated with the web search call.
-
OutputIndex int64The index of the output item that the web search call is associated with.
-
SequenceNumber int64The sequence number of the web search call being processed.
-
Type ResponseWebSearchCallSearchingThe type of the event. Always
response.web_search_call.searching.const ResponseWebSearchCallSearchingResponseWebSearchCallSearching ResponseWebSearchCallSearching = "response.web_search_call.searching"
-
-
type ResponseImageGenCallCompletedEvent struct{…}Emitted when an image generation tool call has completed and the final image is available.
-
ItemID stringThe unique identifier of the image generation item being processed.
-
OutputIndex int64The index of the output item in the response's output array.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseImageGenerationCallCompletedThe type of the event. Always 'response.image_generation_call.completed'.
const ResponseImageGenerationCallCompletedResponseImageGenerationCallCompleted ResponseImageGenerationCallCompleted = "response.image_generation_call.completed"
-
-
type ResponseImageGenCallGeneratingEvent struct{…}Emitted when an image generation tool call is actively generating an image (intermediate state).
-
ItemID stringThe unique identifier of the image generation item being processed.
-
OutputIndex int64The index of the output item in the response's output array.
-
SequenceNumber int64The sequence number of the image generation item being processed.
-
Type ResponseImageGenerationCallGeneratingThe type of the event. Always 'response.image_generation_call.generating'.
const ResponseImageGenerationCallGeneratingResponseImageGenerationCallGenerating ResponseImageGenerationCallGenerating = "response.image_generation_call.generating"
-
-
type ResponseImageGenCallInProgressEvent struct{…}Emitted when an image generation tool call is in progress.
-
ItemID stringThe unique identifier of the image generation item being processed.
-
OutputIndex int64The index of the output item in the response's output array.
-
SequenceNumber int64The sequence number of the image generation item being processed.
-
Type ResponseImageGenerationCallInProgressThe type of the event. Always 'response.image_generation_call.in_progress'.
const ResponseImageGenerationCallInProgressResponseImageGenerationCallInProgress ResponseImageGenerationCallInProgress = "response.image_generation_call.in_progress"
-
-
type ResponseImageGenCallPartialImageEvent struct{…}Emitted when a partial image is available during image generation streaming.
-
ItemID stringThe unique identifier of the image generation item being processed.
-
OutputIndex int64The index of the output item in the response's output array.
-
PartialImageB64 stringBase64-encoded partial image data, suitable for rendering as an image.
-
PartialImageIndex int640-based index for the partial image (backend is 1-based, but this is 0-based for the user).
-
SequenceNumber int64The sequence number of the image generation item being processed.
-
Type ResponseImageGenerationCallPartialImageThe type of the event. Always 'response.image_generation_call.partial_image'.
const ResponseImageGenerationCallPartialImageResponseImageGenerationCallPartialImage ResponseImageGenerationCallPartialImage = "response.image_generation_call.partial_image"
-
-
type ResponseMcpCallArgumentsDeltaEvent struct{…}Emitted when there is a delta (partial update) to the arguments of an MCP tool call.
-
Delta stringA JSON string containing the partial update to the arguments for the MCP tool call.
-
ItemID stringThe unique identifier of the MCP tool call item being processed.
-
OutputIndex int64The index of the output item in the response's output array.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseMcpCallArgumentsDeltaThe type of the event. Always 'response.mcp_call_arguments.delta'.
const ResponseMcpCallArgumentsDeltaResponseMcpCallArgumentsDelta ResponseMcpCallArgumentsDelta = "response.mcp_call_arguments.delta"
-
-
type ResponseMcpCallArgumentsDoneEvent struct{…}Emitted when the arguments for an MCP tool call are finalized.
-
Arguments stringA JSON string containing the finalized arguments for the MCP tool call.
-
ItemID stringThe unique identifier of the MCP tool call item being processed.
-
OutputIndex int64The index of the output item in the response's output array.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseMcpCallArgumentsDoneThe type of the event. Always 'response.mcp_call_arguments.done'.
const ResponseMcpCallArgumentsDoneResponseMcpCallArgumentsDone ResponseMcpCallArgumentsDone = "response.mcp_call_arguments.done"
-
-
type ResponseMcpCallCompletedEvent struct{…}Emitted when an MCP tool call has completed successfully.
-
ItemID stringThe ID of the MCP tool call item that completed.
-
OutputIndex int64The index of the output item that completed.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseMcpCallCompletedThe type of the event. Always 'response.mcp_call.completed'.
const ResponseMcpCallCompletedResponseMcpCallCompleted ResponseMcpCallCompleted = "response.mcp_call.completed"
-
-
type ResponseMcpCallFailedEvent struct{…}Emitted when an MCP tool call has failed.
-
ItemID stringThe ID of the MCP tool call item that failed.
-
OutputIndex int64The index of the output item that failed.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseMcpCallFailedThe type of the event. Always 'response.mcp_call.failed'.
const ResponseMcpCallFailedResponseMcpCallFailed ResponseMcpCallFailed = "response.mcp_call.failed"
-
-
type ResponseMcpCallInProgressEvent struct{…}Emitted when an MCP tool call is in progress.
-
ItemID stringThe unique identifier of the MCP tool call item being processed.
-
OutputIndex int64The index of the output item in the response's output array.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseMcpCallInProgressThe type of the event. Always 'response.mcp_call.in_progress'.
const ResponseMcpCallInProgressResponseMcpCallInProgress ResponseMcpCallInProgress = "response.mcp_call.in_progress"
-
-
type ResponseMcpListToolsCompletedEvent struct{…}Emitted when the list of available MCP tools has been successfully retrieved.
-
ItemID stringThe ID of the MCP tool call item that produced this output.
-
OutputIndex int64The index of the output item that was processed.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseMcpListToolsCompletedThe type of the event. Always 'response.mcp_list_tools.completed'.
const ResponseMcpListToolsCompletedResponseMcpListToolsCompleted ResponseMcpListToolsCompleted = "response.mcp_list_tools.completed"
-
-
type ResponseMcpListToolsFailedEvent struct{…}Emitted when the attempt to list available MCP tools has failed.
-
ItemID stringThe ID of the MCP tool call item that failed.
-
OutputIndex int64The index of the output item that failed.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseMcpListToolsFailedThe type of the event. Always 'response.mcp_list_tools.failed'.
const ResponseMcpListToolsFailedResponseMcpListToolsFailed ResponseMcpListToolsFailed = "response.mcp_list_tools.failed"
-
-
type ResponseMcpListToolsInProgressEvent struct{…}Emitted when the system is in the process of retrieving the list of available MCP tools.
-
ItemID stringThe ID of the MCP tool call item that is being processed.
-
OutputIndex int64The index of the output item that is being processed.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseMcpListToolsInProgressThe type of the event. Always 'response.mcp_list_tools.in_progress'.
const ResponseMcpListToolsInProgressResponseMcpListToolsInProgress ResponseMcpListToolsInProgress = "response.mcp_list_tools.in_progress"
-
-
type ResponseOutputTextAnnotationAddedEvent struct{…}Emitted when an annotation is added to output text content.
-
Annotation anyThe annotation object being added. (See annotation schema for details.)
-
AnnotationIndex int64The index of the annotation within the content part.
-
ContentIndex int64The index of the content part within the output item.
-
ItemID stringThe unique identifier of the item to which the annotation is being added.
-
OutputIndex int64The index of the output item in the response's output array.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseOutputTextAnnotationAddedThe type of the event. Always 'response.output_text.annotation.added'.
const ResponseOutputTextAnnotationAddedResponseOutputTextAnnotationAdded ResponseOutputTextAnnotationAdded = "response.output_text.annotation.added"
-
-
type ResponseQueuedEvent struct{…}Emitted when a response is queued and waiting to be processed.
-
Response ResponseThe full response object that is queued.
-
SequenceNumber int64The sequence number for this event.
-
Type ResponseQueuedThe type of the event. Always 'response.queued'.
const ResponseQueuedResponseQueued ResponseQueued = "response.queued"
-
-
type ResponseCustomToolCallInputDeltaEvent struct{…}Event representing a delta (partial update) to the input of a custom tool call.
-
Delta stringThe incremental input data (delta) for the custom tool call.
-
ItemID stringUnique identifier for the API item associated with this event.
-
OutputIndex int64The index of the output this delta applies to.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseCustomToolCallInputDeltaThe event type identifier.
const ResponseCustomToolCallInputDeltaResponseCustomToolCallInputDelta ResponseCustomToolCallInputDelta = "response.custom_tool_call_input.delta"
-
-
type ResponseCustomToolCallInputDoneEvent struct{…}Event indicating that input for a custom tool call is complete.
-
Input stringThe complete input data for the custom tool call.
-
ItemID stringUnique identifier for the API item associated with this event.
-
OutputIndex int64The index of the output this event applies to.
-
SequenceNumber int64The sequence number of this event.
-
Type ResponseCustomToolCallInputDoneThe event type identifier.
const ResponseCustomToolCallInputDoneResponseCustomToolCallInputDone ResponseCustomToolCallInputDone = "response.custom_tool_call_input.done"
-
-
Skill Reference
-
type SkillReference struct{…}-
SkillID stringThe ID of the referenced skill.
-
Type SkillReferenceReferences a skill created with the /v1/skills endpoint.
const SkillReferenceSkillReference SkillReference = "skill_reference"
-
Version stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
Tool
-
type ToolUnion interface{…}A tool that can be used to generate a response.
-
type FunctionTool struct{…}Defines a function in your own code the model can choose to call. Learn more about function calling.
-
Name stringThe name of the function to call.
-
Parameters map[string, any]A JSON schema object describing the parameters of the function.
-
Strict boolWhether to enforce strict parameter validation. Default
true. -
Type FunctionThe type of the function tool. Always
function.const FunctionFunction Function = "function"
-
DeferLoading boolWhether this function is deferred and loaded via tool search.
-
Description stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
type FileSearchTool struct{…}A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
Type FileSearchThe type of the file search tool. Always
file_search.const FileSearchFileSearch FileSearch = "file_search"
-
VectorStoreIDs []stringThe IDs of the vector stores to search.
-
Filters FileSearchToolFiltersUnionA filter to apply.
-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
Key stringThe key to compare against the value.
-
Type ComparisonFilterTypeSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
const ComparisonFilterTypeEq ComparisonFilterType = "eq" -
const ComparisonFilterTypeNe ComparisonFilterType = "ne" -
const ComparisonFilterTypeGt ComparisonFilterType = "gt" -
const ComparisonFilterTypeGte ComparisonFilterType = "gte" -
const ComparisonFilterTypeLt ComparisonFilterType = "lt" -
const ComparisonFilterTypeLte ComparisonFilterType = "lte" -
const ComparisonFilterTypeIn ComparisonFilterType = "in" -
const ComparisonFilterTypeNin ComparisonFilterType = "nin"
-
-
Value ComparisonFilterValueUnionThe value to compare against the attribute key; supports string, number, or boolean types.
-
string -
float64 -
bool -
type ComparisonFilterValueArray []ComparisonFilterValueArrayItemUnion-
string -
float64
-
-
-
-
type CompoundFilter struct{…}Combine multiple filters using
andoror.-
Filters []ComparisonFilterArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
-
Type CompoundFilterTypeType of operation:
andoror.-
const CompoundFilterTypeAnd CompoundFilterType = "and" -
const CompoundFilterTypeOr CompoundFilterType = "or"
-
-
-
-
MaxNumResults int64The maximum number of results to return. This number should be between 1 and 50 inclusive.
-
RankingOptions FileSearchToolRankingOptionsRanking options for search.
-
HybridSearch FileSearchToolRankingOptionsHybridSearchWeights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
EmbeddingWeight float64The weight of the embedding in the reciprocal ranking fusion.
-
TextWeight float64The weight of the text in the reciprocal ranking fusion.
-
-
Ranker stringThe ranker to use for the file search.
-
const FileSearchToolRankingOptionsRankerAuto FileSearchToolRankingOptionsRanker = "auto" -
const FileSearchToolRankingOptionsRankerDefault2024_11_15 FileSearchToolRankingOptionsRanker = "default-2024-11-15"
-
-
ScoreThreshold float64The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
Type ComputerThe type of the computer tool. Always
computer.const ComputerComputer Computer = "computer"
-
-
type ComputerUsePreviewTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
DisplayHeight int64The height of the computer display.
-
DisplayWidth int64The width of the computer display.
-
Environment ComputerUsePreviewToolEnvironmentThe type of computer environment to control.
-
const ComputerUsePreviewToolEnvironmentWindows ComputerUsePreviewToolEnvironment = "windows" -
const ComputerUsePreviewToolEnvironmentMac ComputerUsePreviewToolEnvironment = "mac" -
const ComputerUsePreviewToolEnvironmentLinux ComputerUsePreviewToolEnvironment = "linux" -
const ComputerUsePreviewToolEnvironmentUbuntu ComputerUsePreviewToolEnvironment = "ubuntu" -
const ComputerUsePreviewToolEnvironmentBrowser ComputerUsePreviewToolEnvironment = "browser"
-
-
Type ComputerUsePreviewThe type of the computer use tool. Always
computer_use_preview.const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"
-
-
type WebSearchTool struct{…}Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
Type WebSearchToolTypeThe type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
const WebSearchToolTypeWebSearch WebSearchToolType = "web_search" -
const WebSearchToolTypeWebSearch2025_08_26 WebSearchToolType = "web_search_2025_08_26"
-
-
Filters WebSearchToolFiltersFilters for the search.
-
AllowedDomains []stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
SearchContextSize WebSearchToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchToolSearchContextSizeLow WebSearchToolSearchContextSize = "low" -
const WebSearchToolSearchContextSizeMedium WebSearchToolSearchContextSize = "medium" -
const WebSearchToolSearchContextSizeHigh WebSearchToolSearchContextSize = "high"
-
-
UserLocation WebSearchToolUserLocationThe approximate location of the user.
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
Type stringThe type of location approximation. Always
approximate.const WebSearchToolUserLocationTypeApproximate WebSearchToolUserLocationType = "approximate"
-
-
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
ServerLabel stringA label for this MCP server, used to identify it in tool calls.
-
Type McpThe type of the MCP tool. Always
mcp.const McpMcp Mcp = "mcp"
-
AllowedTools ToolMcpAllowedToolsUnionList of allowed tool names or a filter object.
-
type ToolMcpAllowedToolsMcpAllowedTools []stringA string array of allowed tool names
-
type ToolMcpAllowedToolsMcpToolFilter struct{…}A filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
Authorization stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
ConnectorID stringIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
const ToolMcpConnectorIDConnectorDropbox ToolMcpConnectorID = "connector_dropbox" -
const ToolMcpConnectorIDConnectorGmail ToolMcpConnectorID = "connector_gmail" -
const ToolMcpConnectorIDConnectorGooglecalendar ToolMcpConnectorID = "connector_googlecalendar" -
const ToolMcpConnectorIDConnectorGoogledrive ToolMcpConnectorID = "connector_googledrive" -
const ToolMcpConnectorIDConnectorMicrosoftteams ToolMcpConnectorID = "connector_microsoftteams" -
const ToolMcpConnectorIDConnectorOutlookcalendar ToolMcpConnectorID = "connector_outlookcalendar" -
const ToolMcpConnectorIDConnectorOutlookemail ToolMcpConnectorID = "connector_outlookemail" -
const ToolMcpConnectorIDConnectorSharepoint ToolMcpConnectorID = "connector_sharepoint"
-
-
DeferLoading boolWhether this MCP tool is deferred and discovered via tool search.
-
Headers map[string, string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
RequireApproval ToolMcpRequireApprovalUnionSpecify which of the MCP server's tools require approval.
-
type ToolMcpRequireApprovalMcpToolApprovalFilter 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.-
Always ToolMcpRequireApprovalMcpToolApprovalFilterAlwaysA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
Never ToolMcpRequireApprovalMcpToolApprovalFilterNeverA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
type ToolMcpRequireApprovalMcpToolApprovalSetting stringSpecify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
const ToolMcpRequireApprovalMcpToolApprovalSettingAlways ToolMcpRequireApprovalMcpToolApprovalSetting = "always" -
const ToolMcpRequireApprovalMcpToolApprovalSettingNever ToolMcpRequireApprovalMcpToolApprovalSetting = "never"
-
-
-
ServerDescription stringOptional description of the MCP server, used to provide more context.
-
ServerURL stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
TunnelID stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
Container ToolCodeInterpreterContainerUnionThe code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
string -
type ToolCodeInterpreterContainerCodeInterpreterContainerAuto struct{…}Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
Type AutoAlways
auto.const AutoAuto Auto = "auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit stringThe memory limit for the code interpreter container.
-
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"
-
-
NetworkPolicy ToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…}-
Type DisabledDisable outbound network access. Always
disabled.const DisabledDisabled Disabled = "disabled"
-
-
type ContainerNetworkPolicyAllowlist struct{…}-
AllowedDomains []stringA list of allowed domains when type is
allowlist. -
Type AllowlistAllow outbound network access only to specified domains. Always
allowlist.const AllowlistAllowlist Allowlist = "allowlist"
-
DomainSecrets []ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
Domain stringThe domain associated with the secret.
-
Name stringThe name of the secret to inject for the domain.
-
Value stringThe secret value to inject for the domain.
-
-
-
-
-
-
Type CodeInterpreterThe type of the code interpreter tool. Always
code_interpreter.const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"
-
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
Type ImageGenerationThe type of the image generation tool. Always
image_generation.const ImageGenerationImageGeneration ImageGeneration = "image_generation"
-
Action stringWhether to generate a new image or edit an existing image. Default:
auto.-
const ToolImageGenerationActionGenerate ToolImageGenerationAction = "generate" -
const ToolImageGenerationActionEdit ToolImageGenerationAction = "edit" -
const ToolImageGenerationActionAuto ToolImageGenerationAction = "auto"
-
-
Background stringAllows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
const ToolImageGenerationBackgroundTransparent ToolImageGenerationBackground = "transparent" -
const ToolImageGenerationBackgroundOpaque ToolImageGenerationBackground = "opaque" -
const ToolImageGenerationBackgroundAuto ToolImageGenerationBackground = "auto"
-
-
InputFidelity stringControl how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
const ToolImageGenerationInputFidelityHigh ToolImageGenerationInputFidelity = "high" -
const ToolImageGenerationInputFidelityLow ToolImageGenerationInputFidelity = "low"
-
-
InputImageMask ToolImageGenerationInputImageMaskOptional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
FileID stringFile ID for the mask image.
-
ImageURL stringBase64-encoded mask image.
-
-
Model stringThe image generation model to use. Default:
gpt-image-1.-
string -
string-
const ToolImageGenerationModelGPTImage1 ToolImageGenerationModel = "gpt-image-1" -
const ToolImageGenerationModelGPTImage1Mini ToolImageGenerationModel = "gpt-image-1-mini" -
const ToolImageGenerationModelGPTImage2 ToolImageGenerationModel = "gpt-image-2" -
const ToolImageGenerationModelGPTImage2_2026_04_21 ToolImageGenerationModel = "gpt-image-2-2026-04-21" -
const ToolImageGenerationModelGPTImage1_5 ToolImageGenerationModel = "gpt-image-1.5" -
const ToolImageGenerationModelChatgptImageLatest ToolImageGenerationModel = "chatgpt-image-latest"
-
-
-
Moderation stringModeration level for the generated image. Default:
auto.-
const ToolImageGenerationModerationAuto ToolImageGenerationModeration = "auto" -
const ToolImageGenerationModerationLow ToolImageGenerationModeration = "low"
-
-
OutputCompression int64Compression level for the output image. Default: 100.
-
OutputFormat stringThe output format of the generated image. One of
png,webp, orjpeg. Default:png.-
const ToolImageGenerationOutputFormatPNG ToolImageGenerationOutputFormat = "png" -
const ToolImageGenerationOutputFormatWebP ToolImageGenerationOutputFormat = "webp" -
const ToolImageGenerationOutputFormatJPEG ToolImageGenerationOutputFormat = "jpeg"
-
-
PartialImages int64Number of partial images to generate in streaming mode, from 0 (default value) to 3.
-
Quality stringThe quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
const ToolImageGenerationQualityLow ToolImageGenerationQuality = "low" -
const ToolImageGenerationQualityMedium ToolImageGenerationQuality = "medium" -
const ToolImageGenerationQualityHigh ToolImageGenerationQuality = "high" -
const ToolImageGenerationQualityAuto ToolImageGenerationQuality = "auto"
-
-
Size stringThe size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
string -
string-
const ToolImageGenerationSize1024x1024 ToolImageGenerationSize = "1024x1024" -
const ToolImageGenerationSize1024x1536 ToolImageGenerationSize = "1024x1536" -
const ToolImageGenerationSize1536x1024 ToolImageGenerationSize = "1536x1024" -
const ToolImageGenerationSizeAuto ToolImageGenerationSize = "auto"
-
-
-
-
type ToolLocalShell struct{…}A tool that allows the model to execute shell commands in a local environment.
-
Type LocalShellThe type of the local shell tool. Always
local_shell.const LocalShellLocalShell LocalShell = "local_shell"
-
-
type FunctionShellTool struct{…}A tool that allows the model to execute shell commands.
-
Type ShellThe type of the shell tool. Always
shell.const ShellShell Shell = "shell"
-
Environment FunctionShellToolEnvironmentUnion-
type ContainerAuto struct{…}-
Type ContainerAutoAutomatically creates a container for this request
const ContainerAutoContainerAuto ContainerAuto = "container_auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit ContainerAutoMemoryLimitThe memory limit for the container.
-
const ContainerAutoMemoryLimit1g ContainerAutoMemoryLimit = "1g" -
const ContainerAutoMemoryLimit4g ContainerAutoMemoryLimit = "4g" -
const ContainerAutoMemoryLimit16g ContainerAutoMemoryLimit = "16g" -
const ContainerAutoMemoryLimit64g ContainerAutoMemoryLimit = "64g"
-
-
NetworkPolicy ContainerAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…} -
type ContainerNetworkPolicyAllowlist struct{…}
-
-
Skills []ContainerAutoSkillUnionAn optional list of skills referenced by id or inline data.
-
type SkillReference struct{…}-
SkillID stringThe ID of the referenced skill.
-
Type SkillReferenceReferences a skill created with the /v1/skills endpoint.
const SkillReferenceSkillReference SkillReference = "skill_reference"
-
Version stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
type InlineSkill struct{…}-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Source InlineSkillSourceInline skill payload
-
Data stringBase64-encoded skill zip bundle.
-
MediaType ApplicationZipThe media type of the inline skill payload. Must be
application/zip.const ApplicationZipApplicationZip ApplicationZip = "application/zip"
-
Type Base64The type of the inline skill source. Must be
base64.const Base64Base64 Base64 = "base64"
-
-
Type InlineDefines an inline skill for this request.
const InlineInline Inline = "inline"
-
-
-
-
type LocalEnvironment struct{…}-
Type LocalUse a local computer environment.
const LocalLocal Local = "local"
-
Skills []LocalSkillAn optional list of skills.
-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Path stringThe path to the directory containing the skill.
-
-
-
type ContainerReference struct{…}-
ContainerID stringThe ID of the referenced container.
-
Type ContainerReferenceReferences a container created with the /v1/containers endpoint
const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
Name stringThe name of the custom tool, used to identify it in tool calls.
-
Type CustomThe type of the custom tool. Always
custom.const CustomCustom Custom = "custom"
-
DeferLoading boolWhether this tool should be deferred and discovered via tool search.
-
Description stringOptional description of the custom tool, used to provide more context.
-
Format CustomToolInputFormatUnionThe input format for the custom tool. Default is unconstrained text.
-
type CustomToolInputFormatText struct{…}Unconstrained free-form text.
-
Type TextUnconstrained text format. Always
text.const TextText Text = "text"
-
-
type CustomToolInputFormatGrammar struct{…}A grammar defined by the user.
-
Definition stringThe grammar definition.
-
Syntax stringThe syntax of the grammar definition. One of
larkorregex.-
const CustomToolInputFormatGrammarSyntaxLark CustomToolInputFormatGrammarSyntax = "lark" -
const CustomToolInputFormatGrammarSyntaxRegex CustomToolInputFormatGrammarSyntax = "regex"
-
-
Type GrammarGrammar format. Always
grammar.const GrammarGrammar Grammar = "grammar"
-
-
-
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
Description stringA description of the namespace shown to the model.
-
Name stringThe namespace name used in tool calls (for example,
crm). -
Tools []NamespaceToolToolUnionThe function/custom tools available inside this namespace.
-
type NamespaceToolToolFunction struct{…}-
Name string -
Type Functionconst FunctionFunction Function = "function"
-
DeferLoading boolWhether this function should be deferred and discovered via tool search.
-
Description string -
Parameters any -
Strict bool
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
-
Type NamespaceThe type of the tool. Always
namespace.const NamespaceNamespace Namespace = "namespace"
-
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
Type ToolSearchThe type of the tool. Always
tool_search.const ToolSearchToolSearch ToolSearch = "tool_search"
-
Description stringDescription shown to the model for a client-executed tool search tool.
-
Execution ToolSearchToolExecutionWhether tool search is executed by the server or by the client.
-
const ToolSearchToolExecutionServer ToolSearchToolExecution = "server" -
const ToolSearchToolExecutionClient ToolSearchToolExecution = "client"
-
-
Parameters anyParameter schema for a client-executed tool search tool.
-
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
Type WebSearchPreviewToolTypeThe type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
const WebSearchPreviewToolTypeWebSearchPreview WebSearchPreviewToolType = "web_search_preview" -
const WebSearchPreviewToolTypeWebSearchPreview2025_03_11 WebSearchPreviewToolType = "web_search_preview_2025_03_11"
-
-
SearchContentTypes []string-
const WebSearchPreviewToolSearchContentTypeText WebSearchPreviewToolSearchContentType = "text" -
const WebSearchPreviewToolSearchContentTypeImage WebSearchPreviewToolSearchContentType = "image"
-
-
SearchContextSize WebSearchPreviewToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchPreviewToolSearchContextSizeLow WebSearchPreviewToolSearchContextSize = "low" -
const WebSearchPreviewToolSearchContextSizeMedium WebSearchPreviewToolSearchContextSize = "medium" -
const WebSearchPreviewToolSearchContextSizeHigh WebSearchPreviewToolSearchContextSize = "high"
-
-
UserLocation WebSearchPreviewToolUserLocationThe user's location.
-
Type ApproximateThe type of location approximation. Always
approximate.const ApproximateApproximate Approximate = "approximate"
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
Type ApplyPatchThe type of the tool. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
Tool Choice Allowed
-
type ToolChoiceAllowed struct{…}Constrains the tools available to the model to a pre-defined set.
-
Mode ToolChoiceAllowedModeConstrains the tools available to the model to a pre-defined set.
autoallows the model to pick from among the allowed tools and generate a message.requiredrequires the model to call one or more of the allowed tools.-
const ToolChoiceAllowedModeAuto ToolChoiceAllowedMode = "auto" -
const ToolChoiceAllowedModeRequired ToolChoiceAllowedMode = "required"
-
-
Tools []map[string, any]A list of tool definitions that the model should be allowed to call.
For the Responses API, the list of tool definitions might look like:
[ { "type": "function", "name": "get_weather" }, { "type": "mcp", "server_label": "deepwiki" }, { "type": "image_generation" } ] -
Type AllowedToolsAllowed tool configuration type. Always
allowed_tools.const AllowedToolsAllowedTools AllowedTools = "allowed_tools"
-
Tool Choice Apply Patch
-
type ToolChoiceApplyPatch struct{…}Forces the model to call the apply_patch tool when executing a tool call.
-
Type ApplyPatchThe tool to call. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
Tool Choice Custom
-
type ToolChoiceCustom struct{…}Use this option to force the model to call a specific custom tool.
-
Name stringThe name of the custom tool to call.
-
Type CustomFor custom tool calling, the type is always
custom.const CustomCustom Custom = "custom"
-
Tool Choice Function
-
type ToolChoiceFunction struct{…}Use this option to force the model to call a specific function.
-
Name stringThe name of the function to call.
-
Type FunctionFor function calling, the type is always
function.const FunctionFunction Function = "function"
-
Tool Choice Mcp
-
type ToolChoiceMcp struct{…}Use this option to force the model to call a specific tool on a remote MCP server.
-
ServerLabel stringThe label of the MCP server to use.
-
Type McpFor MCP tools, the type is always
mcp.const McpMcp Mcp = "mcp"
-
Name stringThe name of the tool to call on the server.
-
Tool Choice Options
-
type ToolChoiceOptions stringControls which (if any) tool is called by the model.
nonemeans the model will not call any tool and instead generates a message.automeans the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools.-
const ToolChoiceOptionsNone ToolChoiceOptions = "none" -
const ToolChoiceOptionsAuto ToolChoiceOptions = "auto" -
const ToolChoiceOptionsRequired ToolChoiceOptions = "required"
-
Tool Choice Shell
-
type ToolChoiceShell struct{…}Forces the model to call the shell tool when a tool call is required.
-
Type ShellThe tool to call. Always
shell.const ShellShell Shell = "shell"
-
Tool Choice Types
-
type ToolChoiceTypes struct{…}Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
-
Type ToolChoiceTypesTypeThe type of hosted tool the model should to use. Learn more about built-in tools.
Allowed values are:
-
file_search -
web_search_preview -
computer -
computer_use_preview -
computer_use -
code_interpreter -
image_generation -
const ToolChoiceTypesTypeFileSearch ToolChoiceTypesType = "file_search" -
const ToolChoiceTypesTypeWebSearchPreview ToolChoiceTypesType = "web_search_preview" -
const ToolChoiceTypesTypeComputer ToolChoiceTypesType = "computer" -
const ToolChoiceTypesTypeComputerUsePreview ToolChoiceTypesType = "computer_use_preview" -
const ToolChoiceTypesTypeComputerUse ToolChoiceTypesType = "computer_use" -
const ToolChoiceTypesTypeWebSearchPreview2025_03_11 ToolChoiceTypesType = "web_search_preview_2025_03_11" -
const ToolChoiceTypesTypeImageGeneration ToolChoiceTypesType = "image_generation" -
const ToolChoiceTypesTypeCodeInterpreter ToolChoiceTypesType = "code_interpreter"
-
-
Tool Search Tool
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
Type ToolSearchThe type of the tool. Always
tool_search.const ToolSearchToolSearch ToolSearch = "tool_search"
-
Description stringDescription shown to the model for a client-executed tool search tool.
-
Execution ToolSearchToolExecutionWhether tool search is executed by the server or by the client.
-
const ToolSearchToolExecutionServer ToolSearchToolExecution = "server" -
const ToolSearchToolExecutionClient ToolSearchToolExecution = "client"
-
-
Parameters anyParameter schema for a client-executed tool search tool.
-
Web Search Preview Tool
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
Type WebSearchPreviewToolTypeThe type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
const WebSearchPreviewToolTypeWebSearchPreview WebSearchPreviewToolType = "web_search_preview" -
const WebSearchPreviewToolTypeWebSearchPreview2025_03_11 WebSearchPreviewToolType = "web_search_preview_2025_03_11"
-
-
SearchContentTypes []string-
const WebSearchPreviewToolSearchContentTypeText WebSearchPreviewToolSearchContentType = "text" -
const WebSearchPreviewToolSearchContentTypeImage WebSearchPreviewToolSearchContentType = "image"
-
-
SearchContextSize WebSearchPreviewToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchPreviewToolSearchContextSizeLow WebSearchPreviewToolSearchContextSize = "low" -
const WebSearchPreviewToolSearchContextSizeMedium WebSearchPreviewToolSearchContextSize = "medium" -
const WebSearchPreviewToolSearchContextSizeHigh WebSearchPreviewToolSearchContextSize = "high"
-
-
UserLocation WebSearchPreviewToolUserLocationThe user's location.
-
Type ApproximateThe type of location approximation. Always
approximate.const ApproximateApproximate Approximate = "approximate"
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
Web Search Tool
-
type WebSearchTool struct{…}Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
Type WebSearchToolTypeThe type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
const WebSearchToolTypeWebSearch WebSearchToolType = "web_search" -
const WebSearchToolTypeWebSearch2025_08_26 WebSearchToolType = "web_search_2025_08_26"
-
-
Filters WebSearchToolFiltersFilters for the search.
-
AllowedDomains []stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
SearchContextSize WebSearchToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchToolSearchContextSizeLow WebSearchToolSearchContextSize = "low" -
const WebSearchToolSearchContextSizeMedium WebSearchToolSearchContextSize = "medium" -
const WebSearchToolSearchContextSizeHigh WebSearchToolSearchContextSize = "high"
-
-
UserLocation WebSearchToolUserLocationThe approximate location of the user.
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
Type stringThe type of location approximation. Always
approximate.const WebSearchToolUserLocationTypeApproximate WebSearchToolUserLocationType = "approximate"
-
-
Input Items
List input items
client.Responses.InputItems.List(ctx, responseID, query) (*CursorPage[ResponseItemUnion], error)
get /responses/{response_id}/input_items
Returns a list of input items for a given response.
Parameters
-
responseID string -
query InputItemListParams-
After param.Field[string]An item ID to list items after, used in pagination.
-
Include param.Field[[]ResponseIncludable]Additional fields to include in the response. See the
includeparameter for Response creation above for more information.-
const ResponseIncludableFileSearchCallResults ResponseIncludable = "file_search_call.results" -
const ResponseIncludableWebSearchCallResults ResponseIncludable = "web_search_call.results" -
const ResponseIncludableWebSearchCallActionSources ResponseIncludable = "web_search_call.action.sources" -
const ResponseIncludableMessageInputImageImageURL ResponseIncludable = "message.input_image.image_url" -
const ResponseIncludableComputerCallOutputOutputImageURL ResponseIncludable = "computer_call_output.output.image_url" -
const ResponseIncludableCodeInterpreterCallOutputs ResponseIncludable = "code_interpreter_call.outputs" -
const ResponseIncludableReasoningEncryptedContent ResponseIncludable = "reasoning.encrypted_content" -
const ResponseIncludableMessageOutputTextLogprobs ResponseIncludable = "message.output_text.logprobs"
-
-
Limit param.Field[int64]A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
-
Order param.Field[InputItemListParamsOrder]The order to return the input items in. Default is
desc.-
asc: Return the input items in ascending order. -
desc: Return the input items in descending order. -
const InputItemListParamsOrderAsc InputItemListParamsOrder = "asc" -
const InputItemListParamsOrderDesc InputItemListParamsOrder = "desc"
-
-
Returns
-
type ResponseItemUnion interface{…}Content item used to generate a response.
-
type ResponseInputMessageItem struct{…}-
ID stringThe unique ID of the message input.
-
Content ResponseInputMessageContentListA list of one or many input items to the model, containing different content types.
-
type ResponseInputText struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
Detail ResponseInputImageDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageDetailLow ResponseInputImageDetail = "low" -
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high" -
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto" -
const ResponseInputImageDetailOriginal ResponseInputImageDetail = "original"
-
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFile struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileDetailLow ResponseInputFileDetail = "low" -
const ResponseInputFileDetailHigh ResponseInputFileDetail = "high"
-
-
FileData stringThe content of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
Role ResponseInputMessageItemRoleThe role of the message input. One of
user,system, ordeveloper.-
const ResponseInputMessageItemRoleUser ResponseInputMessageItemRole = "user" -
const ResponseInputMessageItemRoleSystem ResponseInputMessageItemRole = "system" -
const ResponseInputMessageItemRoleDeveloper ResponseInputMessageItemRole = "developer"
-
-
Type MessageThe type of the message input. Always set to
message.const MessageMessage Message = "message"
-
Status ResponseInputMessageItemStatusThe status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputMessageItemStatusInProgress ResponseInputMessageItemStatus = "in_progress" -
const ResponseInputMessageItemStatusCompleted ResponseInputMessageItemStatus = "completed" -
const ResponseInputMessageItemStatusIncomplete ResponseInputMessageItemStatus = "incomplete"
-
-
-
type ResponseOutputMessage struct{…}An output message from the model.
-
ID stringThe unique ID of the output message.
-
Content []ResponseOutputMessageContentUnionThe content of the output message.
-
type ResponseOutputText struct{…}A text output from the model.
-
Annotations []ResponseOutputTextAnnotationUnionThe annotations of the text output.
-
type ResponseOutputTextAnnotationFileCitation struct{…}A citation to a file.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the file cited.
-
Index int64The index of the file in the list of files.
-
Type FileCitationThe type of the file citation. Always
file_citation.const FileCitationFileCitation FileCitation = "file_citation"
-
-
type ResponseOutputTextAnnotationURLCitation struct{…}A citation for a web resource used to generate a model response.
-
EndIndex int64The index of the last character of the URL citation in the message.
-
StartIndex int64The index of the first character of the URL citation in the message.
-
Title stringThe title of the web resource.
-
Type URLCitationThe type of the URL citation. Always
url_citation.const URLCitationURLCitation URLCitation = "url_citation"
-
URL stringThe URL of the web resource.
-
-
type ResponseOutputTextAnnotationContainerFileCitation struct{…}A citation for a container file used to generate a model response.
-
ContainerID stringThe ID of the container file.
-
EndIndex int64The index of the last character of the container file citation in the message.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the container file cited.
-
StartIndex int64The index of the first character of the container file citation in the message.
-
Type ContainerFileCitationThe type of the container file citation. Always
container_file_citation.const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"
-
-
type ResponseOutputTextAnnotationFilePath struct{…}A path to a file.
-
FileID stringThe ID of the file.
-
Index int64The index of the file in the list of files.
-
Type FilePathThe type of the file path. Always
file_path.const FilePathFilePath FilePath = "file_path"
-
-
-
Text stringThe text output from the model.
-
Type OutputTextThe type of the output text. Always
output_text.const OutputTextOutputText OutputText = "output_text"
-
Logprobs []ResponseOutputTextLogprob-
Token string -
Bytes []int64 -
Logprob float64 -
TopLogprobs []ResponseOutputTextLogprobTopLogprob-
Token string -
Bytes []int64 -
Logprob float64
-
-
-
-
type ResponseOutputRefusal struct{…}A refusal from the model.
-
Refusal stringThe refusal explanation from the model.
-
Type RefusalThe type of the refusal. Always
refusal.const RefusalRefusal Refusal = "refusal"
-
-
-
Role AssistantThe role of the output message. Always
assistant.const AssistantAssistant Assistant = "assistant"
-
Status ResponseOutputMessageStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseOutputMessageStatusInProgress ResponseOutputMessageStatus = "in_progress" -
const ResponseOutputMessageStatusCompleted ResponseOutputMessageStatus = "completed" -
const ResponseOutputMessageStatusIncomplete ResponseOutputMessageStatus = "incomplete"
-
-
Type MessageThe type of the output message. Always
message.const MessageMessage Message = "message"
-
Phase ResponseOutputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const ResponseOutputMessagePhaseCommentary ResponseOutputMessagePhase = "commentary" -
const ResponseOutputMessagePhaseFinalAnswer ResponseOutputMessagePhase = "final_answer"
-
-
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
ID stringThe unique ID of the file search tool call.
-
Queries []stringThe queries used to search for files.
-
Status ResponseFileSearchToolCallStatusThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
const ResponseFileSearchToolCallStatusInProgress ResponseFileSearchToolCallStatus = "in_progress" -
const ResponseFileSearchToolCallStatusSearching ResponseFileSearchToolCallStatus = "searching" -
const ResponseFileSearchToolCallStatusCompleted ResponseFileSearchToolCallStatus = "completed" -
const ResponseFileSearchToolCallStatusIncomplete ResponseFileSearchToolCallStatus = "incomplete" -
const ResponseFileSearchToolCallStatusFailed ResponseFileSearchToolCallStatus = "failed"
-
-
Type FileSearchCallThe type of the file search tool call. Always
file_search_call.const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"
-
Results []ResponseFileSearchToolCallResultThe results of the file search tool call.
-
Attributes map[string, ResponseFileSearchToolCallResultAttributeUnion]Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.
-
string -
float64 -
bool
-
-
FileID stringThe unique ID of the file.
-
Filename stringThe name of the file.
-
Score float64The relevance score of the file - a value between 0 and 1.
-
Text stringThe text that was retrieved from the file.
-
-
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
ID stringThe unique ID of the computer call.
-
CallID stringAn identifier used when responding to the tool call with output.
-
PendingSafetyChecks []ResponseComputerToolCallPendingSafetyCheckThe pending safety checks for the computer call.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status ResponseComputerToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseComputerToolCallStatusInProgress ResponseComputerToolCallStatus = "in_progress" -
const ResponseComputerToolCallStatusCompleted ResponseComputerToolCallStatus = "completed" -
const ResponseComputerToolCallStatusIncomplete ResponseComputerToolCallStatus = "incomplete"
-
-
Type ResponseComputerToolCallTypeThe type of the computer call. Always
computer_call.const ResponseComputerToolCallTypeComputerCall ResponseComputerToolCallType = "computer_call"
-
Action ResponseComputerToolCallActionUnionA click action.
-
type ResponseComputerToolCallActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ResponseComputerToolCallActionClickButtonLeft ResponseComputerToolCallActionClickButton = "left" -
const ResponseComputerToolCallActionClickButtonRight ResponseComputerToolCallActionClickButton = "right" -
const ResponseComputerToolCallActionClickButtonWheel ResponseComputerToolCallActionClickButton = "wheel" -
const ResponseComputerToolCallActionClickButtonBack ResponseComputerToolCallActionClickButton = "back" -
const ResponseComputerToolCallActionClickButtonForward ResponseComputerToolCallActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ResponseComputerToolCallActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ResponseComputerToolCallActionDrag struct{…}A drag action.
-
Path []ResponseComputerToolCallActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ResponseComputerToolCallActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ResponseComputerToolCallActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ResponseComputerToolCallActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ResponseComputerToolCallActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ResponseComputerToolCallActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ResponseComputerToolCallActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
Actions ComputerActionListFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
type ComputerActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ComputerActionClickButtonLeft ComputerActionClickButton = "left" -
const ComputerActionClickButtonRight ComputerActionClickButton = "right" -
const ComputerActionClickButtonWheel ComputerActionClickButton = "wheel" -
const ComputerActionClickButtonBack ComputerActionClickButton = "back" -
const ComputerActionClickButtonForward ComputerActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ComputerActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ComputerActionDrag struct{…}A drag action.
-
Path []ComputerActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ComputerActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ComputerActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ComputerActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ComputerActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ComputerActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ComputerActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
-
type ResponseComputerToolCallOutputItem struct{…}-
ID stringThe unique ID of the computer call tool output.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Type ComputerScreenshotSpecifies the event type. For a computer screenshot, this property is always set to
computer_screenshot.const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"
-
FileID stringThe identifier of an uploaded file that contains the screenshot.
-
ImageURL stringThe URL of the screenshot image.
-
-
Status ResponseComputerToolCallOutputItemStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseComputerToolCallOutputItemStatusCompleted ResponseComputerToolCallOutputItemStatus = "completed" -
const ResponseComputerToolCallOutputItemStatusIncomplete ResponseComputerToolCallOutputItemStatus = "incomplete" -
const ResponseComputerToolCallOutputItemStatusFailed ResponseComputerToolCallOutputItemStatus = "failed" -
const ResponseComputerToolCallOutputItemStatusInProgress ResponseComputerToolCallOutputItemStatus = "in_progress"
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
AcknowledgedSafetyChecks []ResponseComputerToolCallOutputItemAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
ID stringThe unique ID of the web search tool call.
-
Action ResponseFunctionWebSearchActionUnionAn object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
type ResponseFunctionWebSearchActionSearch struct{…}Action type "search" - Performs a web search query.
-
Type SearchThe action type.
const SearchSearch Search = "search"
-
Queries []stringThe search queries.
-
Query stringThe search query.
-
Sources []ResponseFunctionWebSearchActionSearchSourceThe sources used in the search.
-
Type URLThe type of source. Always
url.const URLURL URL = "url"
-
URL stringThe URL of the source.
-
-
-
type ResponseFunctionWebSearchActionOpenPage struct{…}Action type "open_page" - Opens a specific URL from search results.
-
Type OpenPageThe action type.
const OpenPageOpenPage OpenPage = "open_page"
-
URL stringThe URL opened by the model.
-
-
type ResponseFunctionWebSearchActionFindInPage struct{…}Action type "find_in_page": Searches for a pattern within a loaded page.
-
Pattern stringThe pattern or text to search for within the page.
-
Type FindInPageThe action type.
const FindInPageFindInPage FindInPage = "find_in_page"
-
URL stringThe URL of the page searched for the pattern.
-
-
-
Status ResponseFunctionWebSearchStatusThe status of the web search tool call.
-
const ResponseFunctionWebSearchStatusInProgress ResponseFunctionWebSearchStatus = "in_progress" -
const ResponseFunctionWebSearchStatusSearching ResponseFunctionWebSearchStatus = "searching" -
const ResponseFunctionWebSearchStatusCompleted ResponseFunctionWebSearchStatus = "completed" -
const ResponseFunctionWebSearchStatusFailed ResponseFunctionWebSearchStatus = "failed"
-
-
Type WebSearchCallThe type of the web search tool call. Always
web_search_call.const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"
-
-
type ResponseFunctionToolCallItem struct{…}A tool call to run a function. See the function calling guide for more information.
-
ID stringThe unique ID of the function tool call.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallItemStatusInProgress ResponseFunctionToolCallItemStatus = "in_progress" -
const ResponseFunctionToolCallItemStatusCompleted ResponseFunctionToolCallItemStatus = "completed" -
const ResponseFunctionToolCallItemStatusIncomplete ResponseFunctionToolCallItemStatus = "incomplete"
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseFunctionToolCallOutputItem struct{…}-
ID stringThe unique ID of the function call tool output.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseFunctionToolCallOutputItemOutputUnionThe output from the function call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseFunctionToolCallOutputItemOutputOutputContentList []ResponseFunctionToolCallOutputItemOutputOutputContentListItemUnionText, image, or file output of the function call.
-
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
-
Status ResponseFunctionToolCallOutputItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallOutputItemStatusInProgress ResponseFunctionToolCallOutputItemStatus = "in_progress" -
const ResponseFunctionToolCallOutputItemStatusCompleted ResponseFunctionToolCallOutputItemStatus = "completed" -
const ResponseFunctionToolCallOutputItemStatusIncomplete ResponseFunctionToolCallOutputItemStatus = "incomplete"
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseToolSearchCall struct{…}-
ID stringThe unique ID of the tool search call item.
-
Arguments anyArguments used for the tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchCallExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchCallExecutionServer ResponseToolSearchCallExecution = "server" -
const ResponseToolSearchCallExecutionClient ResponseToolSearchCallExecution = "client"
-
-
Status ResponseToolSearchCallStatusThe status of the tool search call item that was recorded.
-
const ResponseToolSearchCallStatusInProgress ResponseToolSearchCallStatus = "in_progress" -
const ResponseToolSearchCallStatusCompleted ResponseToolSearchCallStatus = "completed" -
const ResponseToolSearchCallStatusIncomplete ResponseToolSearchCallStatus = "incomplete"
-
-
Type ToolSearchCallThe type of the item. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseToolSearchOutputItem struct{…}-
ID stringThe unique ID of the tool search output item.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemExecutionServer ResponseToolSearchOutputItemExecution = "server" -
const ResponseToolSearchOutputItemExecutionClient ResponseToolSearchOutputItemExecution = "client"
-
-
Status ResponseToolSearchOutputItemStatusThe status of the tool search output item that was recorded.
-
const ResponseToolSearchOutputItemStatusInProgress ResponseToolSearchOutputItemStatus = "in_progress" -
const ResponseToolSearchOutputItemStatusCompleted ResponseToolSearchOutputItemStatus = "completed" -
const ResponseToolSearchOutputItemStatusIncomplete ResponseToolSearchOutputItemStatus = "incomplete"
-
-
Tools []ToolUnionThe loaded tool definitions returned by tool search.
-
type FunctionTool struct{…}Defines a function in your own code the model can choose to call. Learn more about function calling.
-
Name stringThe name of the function to call.
-
Parameters map[string, any]A JSON schema object describing the parameters of the function.
-
Strict boolWhether to enforce strict parameter validation. Default
true. -
Type FunctionThe type of the function tool. Always
function.const FunctionFunction Function = "function"
-
DeferLoading boolWhether this function is deferred and loaded via tool search.
-
Description stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
type FileSearchTool struct{…}A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
Type FileSearchThe type of the file search tool. Always
file_search.const FileSearchFileSearch FileSearch = "file_search"
-
VectorStoreIDs []stringThe IDs of the vector stores to search.
-
Filters FileSearchToolFiltersUnionA filter to apply.
-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
Key stringThe key to compare against the value.
-
Type ComparisonFilterTypeSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
const ComparisonFilterTypeEq ComparisonFilterType = "eq" -
const ComparisonFilterTypeNe ComparisonFilterType = "ne" -
const ComparisonFilterTypeGt ComparisonFilterType = "gt" -
const ComparisonFilterTypeGte ComparisonFilterType = "gte" -
const ComparisonFilterTypeLt ComparisonFilterType = "lt" -
const ComparisonFilterTypeLte ComparisonFilterType = "lte" -
const ComparisonFilterTypeIn ComparisonFilterType = "in" -
const ComparisonFilterTypeNin ComparisonFilterType = "nin"
-
-
Value ComparisonFilterValueUnionThe value to compare against the attribute key; supports string, number, or boolean types.
-
string -
float64 -
bool -
type ComparisonFilterValueArray []ComparisonFilterValueArrayItemUnion-
string -
float64
-
-
-
-
type CompoundFilter struct{…}Combine multiple filters using
andoror.-
Filters []ComparisonFilterArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
-
Type CompoundFilterTypeType of operation:
andoror.-
const CompoundFilterTypeAnd CompoundFilterType = "and" -
const CompoundFilterTypeOr CompoundFilterType = "or"
-
-
-
-
MaxNumResults int64The maximum number of results to return. This number should be between 1 and 50 inclusive.
-
RankingOptions FileSearchToolRankingOptionsRanking options for search.
-
HybridSearch FileSearchToolRankingOptionsHybridSearchWeights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
EmbeddingWeight float64The weight of the embedding in the reciprocal ranking fusion.
-
TextWeight float64The weight of the text in the reciprocal ranking fusion.
-
-
Ranker stringThe ranker to use for the file search.
-
const FileSearchToolRankingOptionsRankerAuto FileSearchToolRankingOptionsRanker = "auto" -
const FileSearchToolRankingOptionsRankerDefault2024_11_15 FileSearchToolRankingOptionsRanker = "default-2024-11-15"
-
-
ScoreThreshold float64The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
Type ComputerThe type of the computer tool. Always
computer.const ComputerComputer Computer = "computer"
-
-
type ComputerUsePreviewTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
DisplayHeight int64The height of the computer display.
-
DisplayWidth int64The width of the computer display.
-
Environment ComputerUsePreviewToolEnvironmentThe type of computer environment to control.
-
const ComputerUsePreviewToolEnvironmentWindows ComputerUsePreviewToolEnvironment = "windows" -
const ComputerUsePreviewToolEnvironmentMac ComputerUsePreviewToolEnvironment = "mac" -
const ComputerUsePreviewToolEnvironmentLinux ComputerUsePreviewToolEnvironment = "linux" -
const ComputerUsePreviewToolEnvironmentUbuntu ComputerUsePreviewToolEnvironment = "ubuntu" -
const ComputerUsePreviewToolEnvironmentBrowser ComputerUsePreviewToolEnvironment = "browser"
-
-
Type ComputerUsePreviewThe type of the computer use tool. Always
computer_use_preview.const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"
-
-
type WebSearchTool struct{…}Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
Type WebSearchToolTypeThe type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
const WebSearchToolTypeWebSearch WebSearchToolType = "web_search" -
const WebSearchToolTypeWebSearch2025_08_26 WebSearchToolType = "web_search_2025_08_26"
-
-
Filters WebSearchToolFiltersFilters for the search.
-
AllowedDomains []stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
SearchContextSize WebSearchToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchToolSearchContextSizeLow WebSearchToolSearchContextSize = "low" -
const WebSearchToolSearchContextSizeMedium WebSearchToolSearchContextSize = "medium" -
const WebSearchToolSearchContextSizeHigh WebSearchToolSearchContextSize = "high"
-
-
UserLocation WebSearchToolUserLocationThe approximate location of the user.
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
Type stringThe type of location approximation. Always
approximate.const WebSearchToolUserLocationTypeApproximate WebSearchToolUserLocationType = "approximate"
-
-
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
ServerLabel stringA label for this MCP server, used to identify it in tool calls.
-
Type McpThe type of the MCP tool. Always
mcp.const McpMcp Mcp = "mcp"
-
AllowedTools ToolMcpAllowedToolsUnionList of allowed tool names or a filter object.
-
type ToolMcpAllowedToolsMcpAllowedTools []stringA string array of allowed tool names
-
type ToolMcpAllowedToolsMcpToolFilter struct{…}A filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
Authorization stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
ConnectorID stringIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
const ToolMcpConnectorIDConnectorDropbox ToolMcpConnectorID = "connector_dropbox" -
const ToolMcpConnectorIDConnectorGmail ToolMcpConnectorID = "connector_gmail" -
const ToolMcpConnectorIDConnectorGooglecalendar ToolMcpConnectorID = "connector_googlecalendar" -
const ToolMcpConnectorIDConnectorGoogledrive ToolMcpConnectorID = "connector_googledrive" -
const ToolMcpConnectorIDConnectorMicrosoftteams ToolMcpConnectorID = "connector_microsoftteams" -
const ToolMcpConnectorIDConnectorOutlookcalendar ToolMcpConnectorID = "connector_outlookcalendar" -
const ToolMcpConnectorIDConnectorOutlookemail ToolMcpConnectorID = "connector_outlookemail" -
const ToolMcpConnectorIDConnectorSharepoint ToolMcpConnectorID = "connector_sharepoint"
-
-
DeferLoading boolWhether this MCP tool is deferred and discovered via tool search.
-
Headers map[string, string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
RequireApproval ToolMcpRequireApprovalUnionSpecify which of the MCP server's tools require approval.
-
type ToolMcpRequireApprovalMcpToolApprovalFilter 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.-
Always ToolMcpRequireApprovalMcpToolApprovalFilterAlwaysA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
Never ToolMcpRequireApprovalMcpToolApprovalFilterNeverA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
type ToolMcpRequireApprovalMcpToolApprovalSetting stringSpecify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
const ToolMcpRequireApprovalMcpToolApprovalSettingAlways ToolMcpRequireApprovalMcpToolApprovalSetting = "always" -
const ToolMcpRequireApprovalMcpToolApprovalSettingNever ToolMcpRequireApprovalMcpToolApprovalSetting = "never"
-
-
-
ServerDescription stringOptional description of the MCP server, used to provide more context.
-
ServerURL stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
TunnelID stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
Container ToolCodeInterpreterContainerUnionThe code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
string -
type ToolCodeInterpreterContainerCodeInterpreterContainerAuto struct{…}Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
Type AutoAlways
auto.const AutoAuto Auto = "auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit stringThe memory limit for the code interpreter container.
-
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"
-
-
NetworkPolicy ToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…}-
Type DisabledDisable outbound network access. Always
disabled.const DisabledDisabled Disabled = "disabled"
-
-
type ContainerNetworkPolicyAllowlist struct{…}-
AllowedDomains []stringA list of allowed domains when type is
allowlist. -
Type AllowlistAllow outbound network access only to specified domains. Always
allowlist.const AllowlistAllowlist Allowlist = "allowlist"
-
DomainSecrets []ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
Domain stringThe domain associated with the secret.
-
Name stringThe name of the secret to inject for the domain.
-
Value stringThe secret value to inject for the domain.
-
-
-
-
-
-
Type CodeInterpreterThe type of the code interpreter tool. Always
code_interpreter.const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"
-
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
Type ImageGenerationThe type of the image generation tool. Always
image_generation.const ImageGenerationImageGeneration ImageGeneration = "image_generation"
-
Action stringWhether to generate a new image or edit an existing image. Default:
auto.-
const ToolImageGenerationActionGenerate ToolImageGenerationAction = "generate" -
const ToolImageGenerationActionEdit ToolImageGenerationAction = "edit" -
const ToolImageGenerationActionAuto ToolImageGenerationAction = "auto"
-
-
Background stringAllows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
const ToolImageGenerationBackgroundTransparent ToolImageGenerationBackground = "transparent" -
const ToolImageGenerationBackgroundOpaque ToolImageGenerationBackground = "opaque" -
const ToolImageGenerationBackgroundAuto ToolImageGenerationBackground = "auto"
-
-
InputFidelity stringControl how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
const ToolImageGenerationInputFidelityHigh ToolImageGenerationInputFidelity = "high" -
const ToolImageGenerationInputFidelityLow ToolImageGenerationInputFidelity = "low"
-
-
InputImageMask ToolImageGenerationInputImageMaskOptional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
FileID stringFile ID for the mask image.
-
ImageURL stringBase64-encoded mask image.
-
-
Model stringThe image generation model to use. Default:
gpt-image-1.-
string -
string-
const ToolImageGenerationModelGPTImage1 ToolImageGenerationModel = "gpt-image-1" -
const ToolImageGenerationModelGPTImage1Mini ToolImageGenerationModel = "gpt-image-1-mini" -
const ToolImageGenerationModelGPTImage2 ToolImageGenerationModel = "gpt-image-2" -
const ToolImageGenerationModelGPTImage2_2026_04_21 ToolImageGenerationModel = "gpt-image-2-2026-04-21" -
const ToolImageGenerationModelGPTImage1_5 ToolImageGenerationModel = "gpt-image-1.5" -
const ToolImageGenerationModelChatgptImageLatest ToolImageGenerationModel = "chatgpt-image-latest"
-
-
-
Moderation stringModeration level for the generated image. Default:
auto.-
const ToolImageGenerationModerationAuto ToolImageGenerationModeration = "auto" -
const ToolImageGenerationModerationLow ToolImageGenerationModeration = "low"
-
-
OutputCompression int64Compression level for the output image. Default: 100.
-
OutputFormat stringThe output format of the generated image. One of
png,webp, orjpeg. Default:png.-
const ToolImageGenerationOutputFormatPNG ToolImageGenerationOutputFormat = "png" -
const ToolImageGenerationOutputFormatWebP ToolImageGenerationOutputFormat = "webp" -
const ToolImageGenerationOutputFormatJPEG ToolImageGenerationOutputFormat = "jpeg"
-
-
PartialImages int64Number of partial images to generate in streaming mode, from 0 (default value) to 3.
-
Quality stringThe quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
const ToolImageGenerationQualityLow ToolImageGenerationQuality = "low" -
const ToolImageGenerationQualityMedium ToolImageGenerationQuality = "medium" -
const ToolImageGenerationQualityHigh ToolImageGenerationQuality = "high" -
const ToolImageGenerationQualityAuto ToolImageGenerationQuality = "auto"
-
-
Size stringThe size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
string -
string-
const ToolImageGenerationSize1024x1024 ToolImageGenerationSize = "1024x1024" -
const ToolImageGenerationSize1024x1536 ToolImageGenerationSize = "1024x1536" -
const ToolImageGenerationSize1536x1024 ToolImageGenerationSize = "1536x1024" -
const ToolImageGenerationSizeAuto ToolImageGenerationSize = "auto"
-
-
-
-
type ToolLocalShell struct{…}A tool that allows the model to execute shell commands in a local environment.
-
Type LocalShellThe type of the local shell tool. Always
local_shell.const LocalShellLocalShell LocalShell = "local_shell"
-
-
type FunctionShellTool struct{…}A tool that allows the model to execute shell commands.
-
Type ShellThe type of the shell tool. Always
shell.const ShellShell Shell = "shell"
-
Environment FunctionShellToolEnvironmentUnion-
type ContainerAuto struct{…}-
Type ContainerAutoAutomatically creates a container for this request
const ContainerAutoContainerAuto ContainerAuto = "container_auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit ContainerAutoMemoryLimitThe memory limit for the container.
-
const ContainerAutoMemoryLimit1g ContainerAutoMemoryLimit = "1g" -
const ContainerAutoMemoryLimit4g ContainerAutoMemoryLimit = "4g" -
const ContainerAutoMemoryLimit16g ContainerAutoMemoryLimit = "16g" -
const ContainerAutoMemoryLimit64g ContainerAutoMemoryLimit = "64g"
-
-
NetworkPolicy ContainerAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…} -
type ContainerNetworkPolicyAllowlist struct{…}
-
-
Skills []ContainerAutoSkillUnionAn optional list of skills referenced by id or inline data.
-
type SkillReference struct{…}-
SkillID stringThe ID of the referenced skill.
-
Type SkillReferenceReferences a skill created with the /v1/skills endpoint.
const SkillReferenceSkillReference SkillReference = "skill_reference"
-
Version stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
type InlineSkill struct{…}-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Source InlineSkillSourceInline skill payload
-
Data stringBase64-encoded skill zip bundle.
-
MediaType ApplicationZipThe media type of the inline skill payload. Must be
application/zip.const ApplicationZipApplicationZip ApplicationZip = "application/zip"
-
Type Base64The type of the inline skill source. Must be
base64.const Base64Base64 Base64 = "base64"
-
-
Type InlineDefines an inline skill for this request.
const InlineInline Inline = "inline"
-
-
-
-
type LocalEnvironment struct{…}-
Type LocalUse a local computer environment.
const LocalLocal Local = "local"
-
Skills []LocalSkillAn optional list of skills.
-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Path stringThe path to the directory containing the skill.
-
-
-
type ContainerReference struct{…}-
ContainerID stringThe ID of the referenced container.
-
Type ContainerReferenceReferences a container created with the /v1/containers endpoint
const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
Name stringThe name of the custom tool, used to identify it in tool calls.
-
Type CustomThe type of the custom tool. Always
custom.const CustomCustom Custom = "custom"
-
DeferLoading boolWhether this tool should be deferred and discovered via tool search.
-
Description stringOptional description of the custom tool, used to provide more context.
-
Format CustomToolInputFormatUnionThe input format for the custom tool. Default is unconstrained text.
-
type CustomToolInputFormatText struct{…}Unconstrained free-form text.
-
Type TextUnconstrained text format. Always
text.const TextText Text = "text"
-
-
type CustomToolInputFormatGrammar struct{…}A grammar defined by the user.
-
Definition stringThe grammar definition.
-
Syntax stringThe syntax of the grammar definition. One of
larkorregex.-
const CustomToolInputFormatGrammarSyntaxLark CustomToolInputFormatGrammarSyntax = "lark" -
const CustomToolInputFormatGrammarSyntaxRegex CustomToolInputFormatGrammarSyntax = "regex"
-
-
Type GrammarGrammar format. Always
grammar.const GrammarGrammar Grammar = "grammar"
-
-
-
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
Description stringA description of the namespace shown to the model.
-
Name stringThe namespace name used in tool calls (for example,
crm). -
Tools []NamespaceToolToolUnionThe function/custom tools available inside this namespace.
-
type NamespaceToolToolFunction struct{…}-
Name string -
Type Functionconst FunctionFunction Function = "function"
-
DeferLoading boolWhether this function should be deferred and discovered via tool search.
-
Description string -
Parameters any -
Strict bool
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
-
Type NamespaceThe type of the tool. Always
namespace.const NamespaceNamespace Namespace = "namespace"
-
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
Type ToolSearchThe type of the tool. Always
tool_search.const ToolSearchToolSearch ToolSearch = "tool_search"
-
Description stringDescription shown to the model for a client-executed tool search tool.
-
Execution ToolSearchToolExecutionWhether tool search is executed by the server or by the client.
-
const ToolSearchToolExecutionServer ToolSearchToolExecution = "server" -
const ToolSearchToolExecutionClient ToolSearchToolExecution = "client"
-
-
Parameters anyParameter schema for a client-executed tool search tool.
-
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
Type WebSearchPreviewToolTypeThe type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
const WebSearchPreviewToolTypeWebSearchPreview WebSearchPreviewToolType = "web_search_preview" -
const WebSearchPreviewToolTypeWebSearchPreview2025_03_11 WebSearchPreviewToolType = "web_search_preview_2025_03_11"
-
-
SearchContentTypes []string-
const WebSearchPreviewToolSearchContentTypeText WebSearchPreviewToolSearchContentType = "text" -
const WebSearchPreviewToolSearchContentTypeImage WebSearchPreviewToolSearchContentType = "image"
-
-
SearchContextSize WebSearchPreviewToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchPreviewToolSearchContextSizeLow WebSearchPreviewToolSearchContextSize = "low" -
const WebSearchPreviewToolSearchContextSizeMedium WebSearchPreviewToolSearchContextSize = "medium" -
const WebSearchPreviewToolSearchContextSizeHigh WebSearchPreviewToolSearchContextSize = "high"
-
-
UserLocation WebSearchPreviewToolUserLocationThe user's location.
-
Type ApproximateThe type of location approximation. Always
approximate.const ApproximateApproximate Approximate = "approximate"
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
Type ApplyPatchThe type of the tool. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
-
Type ToolSearchOutputThe type of the item. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseItemAdditionalTools struct{…}-
ID stringThe unique ID of the additional tools item.
-
Role stringThe role that provided the additional tools.
-
const ResponseItemAdditionalToolsRoleUnknown ResponseItemAdditionalToolsRole = "unknown" -
const ResponseItemAdditionalToolsRoleUser ResponseItemAdditionalToolsRole = "user" -
const ResponseItemAdditionalToolsRoleAssistant ResponseItemAdditionalToolsRole = "assistant" -
const ResponseItemAdditionalToolsRoleSystem ResponseItemAdditionalToolsRole = "system" -
const ResponseItemAdditionalToolsRoleCritic ResponseItemAdditionalToolsRole = "critic" -
const ResponseItemAdditionalToolsRoleDiscriminator ResponseItemAdditionalToolsRole = "discriminator" -
const ResponseItemAdditionalToolsRoleDeveloper ResponseItemAdditionalToolsRole = "developer" -
const ResponseItemAdditionalToolsRoleTool ResponseItemAdditionalToolsRole = "tool"
-
-
Tools []ToolUnionThe additional tool definitions made available at this item.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type AdditionalToolsThe type of the item. Always
additional_tools.const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"
-
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
ID stringThe unique identifier of the reasoning content.
-
Summary []ResponseReasoningItemSummaryReasoning summary content.
-
Text stringA summary of the reasoning output from the model so far.
-
Type SummaryTextThe type of the object. Always
summary_text.const SummaryTextSummaryText SummaryText = "summary_text"
-
-
Type ReasoningThe type of the object. Always
reasoning.const ReasoningReasoning Reasoning = "reasoning"
-
Content []ResponseReasoningItemContentReasoning text content.
-
Text stringThe reasoning text from the model.
-
Type ReasoningTextThe type of the reasoning text. Always
reasoning_text.const ReasoningTextReasoningText ReasoningText = "reasoning_text"
-
-
EncryptedContent stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
Status ResponseReasoningItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseReasoningItemStatusInProgress ResponseReasoningItemStatus = "in_progress" -
const ResponseReasoningItemStatusCompleted ResponseReasoningItemStatus = "completed" -
const ResponseReasoningItemStatusIncomplete ResponseReasoningItemStatus = "incomplete"
-
-
-
type ResponseCompactionItem struct{…}A compaction item generated by the
v1/responses/compactAPI.-
ID stringThe unique ID of the compaction item.
-
EncryptedContent stringThe encrypted content that was produced by compaction.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseItemImageGenerationCall struct{…}An image generation request made by the model.
-
ID stringThe unique ID of the image generation call.
-
Result stringThe generated image encoded in base64.
-
Status stringThe status of the image generation call.
-
const ResponseItemImageGenerationCallStatusInProgress ResponseItemImageGenerationCallStatus = "in_progress" -
const ResponseItemImageGenerationCallStatusCompleted ResponseItemImageGenerationCallStatus = "completed" -
const ResponseItemImageGenerationCallStatusGenerating ResponseItemImageGenerationCallStatus = "generating" -
const ResponseItemImageGenerationCallStatusFailed ResponseItemImageGenerationCallStatus = "failed"
-
-
Type ImageGenerationCallThe type of the image generation call. Always
image_generation_call.const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"
-
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
ID stringThe unique ID of the code interpreter tool call.
-
Code stringThe code to run, or null if not available.
-
ContainerID stringThe ID of the container used to run the code.
-
Outputs []ResponseCodeInterpreterToolCallOutputUnionThe outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
type ResponseCodeInterpreterToolCallOutputLogs struct{…}The logs output from the code interpreter.
-
Logs stringThe logs output from the code interpreter.
-
Type LogsThe type of the output. Always
logs.const LogsLogs Logs = "logs"
-
-
type ResponseCodeInterpreterToolCallOutputImage struct{…}The image output from the code interpreter.
-
Type ImageThe type of the output. Always
image.const ImageImage Image = "image"
-
URL stringThe URL of the image output from the code interpreter.
-
-
-
Status ResponseCodeInterpreterToolCallStatusThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
const ResponseCodeInterpreterToolCallStatusInProgress ResponseCodeInterpreterToolCallStatus = "in_progress" -
const ResponseCodeInterpreterToolCallStatusCompleted ResponseCodeInterpreterToolCallStatus = "completed" -
const ResponseCodeInterpreterToolCallStatusIncomplete ResponseCodeInterpreterToolCallStatus = "incomplete" -
const ResponseCodeInterpreterToolCallStatusInterpreting ResponseCodeInterpreterToolCallStatus = "interpreting" -
const ResponseCodeInterpreterToolCallStatusFailed ResponseCodeInterpreterToolCallStatus = "failed"
-
-
Type CodeInterpreterCallThe type of the code interpreter tool call. Always
code_interpreter_call.const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"
-
-
type ResponseItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
ID stringThe unique ID of the local shell call.
-
Action ResponseItemLocalShellCallActionExecute a shell command on the server.
-
Command []stringThe command to run.
-
Env map[string, string]Environment variables to set for the command.
-
Type ExecThe type of the local shell action. Always
exec.const ExecExec Exec = "exec"
-
TimeoutMs int64Optional timeout in milliseconds for the command.
-
User stringOptional user to run the command as.
-
WorkingDirectory stringOptional working directory to run the command in.
-
-
CallID stringThe unique ID of the local shell tool call generated by the model.
-
Status stringThe status of the local shell call.
-
const ResponseItemLocalShellCallStatusInProgress ResponseItemLocalShellCallStatus = "in_progress" -
const ResponseItemLocalShellCallStatusCompleted ResponseItemLocalShellCallStatus = "completed" -
const ResponseItemLocalShellCallStatusIncomplete ResponseItemLocalShellCallStatus = "incomplete"
-
-
Type LocalShellCallThe type of the local shell call. Always
local_shell_call.const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"
-
-
type ResponseItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
ID stringThe unique ID of the local shell tool call generated by the model.
-
Output stringA JSON string of the output of the local shell tool call.
-
Type LocalShellCallOutputThe type of the local shell tool call output. Always
local_shell_call_output.const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete.-
const ResponseItemLocalShellCallOutputStatusInProgress ResponseItemLocalShellCallOutputStatus = "in_progress" -
const ResponseItemLocalShellCallOutputStatusCompleted ResponseItemLocalShellCallOutputStatus = "completed" -
const ResponseItemLocalShellCallOutputStatusIncomplete ResponseItemLocalShellCallOutputStatus = "incomplete"
-
-
-
type ResponseFunctionShellToolCall struct{…}A tool call that executes one or more shell commands in a managed environment.
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Action ResponseFunctionShellToolCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []string -
MaxOutputLength int64Optional maximum number of characters to return from each command.
-
TimeoutMs int64Optional timeout in milliseconds for the commands.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Environment ResponseFunctionShellToolCallEnvironmentUnionRepresents the use of a local environment to perform shell actions.
-
type ResponseLocalEnvironment struct{…}Represents the use of a local environment to perform shell actions.
-
Type LocalThe environment type. Always
local.const LocalLocal Local = "local"
-
-
type ResponseContainerReference struct{…}Represents a container created with /v1/containers.
-
ContainerID string -
Type ContainerReferenceThe environment type. Always
container_reference.const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
Status ResponseFunctionShellToolCallStatusThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallStatusInProgress ResponseFunctionShellToolCallStatus = "in_progress" -
const ResponseFunctionShellToolCallStatusCompleted ResponseFunctionShellToolCallStatus = "completed" -
const ResponseFunctionShellToolCallStatusIncomplete ResponseFunctionShellToolCallStatus = "incomplete"
-
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseFunctionShellToolCallOutput struct{…}The output of a shell tool call that was emitted.
-
ID stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
MaxOutputLength int64The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
Output []ResponseFunctionShellToolCallOutputOutputAn array of shell call output contents
-
Outcome ResponseFunctionShellToolCallOutputOutputOutcomeUnionRepresents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
type ResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64Exit code from the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringThe standard error output that was captured.
-
Stdout stringThe standard output that was captured.
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
Status ResponseFunctionShellToolCallOutputStatusThe status of the shell call output. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallOutputStatusInProgress ResponseFunctionShellToolCallOutputStatus = "in_progress" -
const ResponseFunctionShellToolCallOutputStatusCompleted ResponseFunctionShellToolCallOutputStatus = "completed" -
const ResponseFunctionShellToolCallOutputStatusIncomplete ResponseFunctionShellToolCallOutputStatus = "incomplete"
-
-
Type ShellCallOutputThe type of the shell call output. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseApplyPatchToolCall struct{…}A tool call that applies file diffs by creating, deleting, or updating files.
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseApplyPatchToolCallOperationUnionOne of the create_file, delete_file, or update_file operations applied via apply_patch.
-
type ResponseApplyPatchToolCallOperationCreateFile struct{…}Instruction describing how to create a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to create.
-
Type CreateFileCreate a new file with the provided diff.
const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseApplyPatchToolCallOperationDeleteFile struct{…}Instruction describing how to delete a file via the apply_patch tool.
-
Path stringPath of the file to delete.
-
Type DeleteFileDelete the specified file.
const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseApplyPatchToolCallOperationUpdateFile struct{…}Instruction describing how to update a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to update.
-
Type UpdateFileUpdate an existing file with the provided diff.
const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status ResponseApplyPatchToolCallStatusThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseApplyPatchToolCallStatusInProgress ResponseApplyPatchToolCallStatus = "in_progress" -
const ResponseApplyPatchToolCallStatusCompleted ResponseApplyPatchToolCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseApplyPatchToolCallOutput struct{…}The output emitted by an apply patch tool call.
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status ResponseApplyPatchToolCallOutputStatusThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseApplyPatchToolCallOutputStatusCompleted ResponseApplyPatchToolCallOutputStatus = "completed" -
const ResponseApplyPatchToolCallOutputStatusFailed ResponseApplyPatchToolCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
CreatedBy stringThe ID of the entity that created this tool call output.
-
Output stringOptional textual output returned by the apply patch tool.
-
-
type ResponseItemMcpListTools struct{…}A list of tools available on an MCP server.
-
ID stringThe unique ID of the list.
-
ServerLabel stringThe label of the MCP server.
-
Tools []ResponseItemMcpListToolsToolThe tools available on the server.
-
InputSchema anyThe JSON schema describing the tool's input.
-
Name stringThe name of the tool.
-
Annotations anyAdditional annotations about the tool.
-
Description stringThe description of the tool.
-
-
Type McpListToolsThe type of the item. Always
mcp_list_tools.const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
-
Error stringError message if the server could not list tools.
-
-
type ResponseItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
ID stringThe unique ID of the approval request.
-
Arguments stringA JSON string of arguments for the tool.
-
Name stringThe name of the tool to run.
-
ServerLabel stringThe label of the MCP server making the request.
-
Type McpApprovalRequestThe type of the item. Always
mcp_approval_request.const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"
-
-
type ResponseItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
ID stringThe unique ID of the approval response
-
ApprovalRequestID stringThe ID of the approval request being answered.
-
Approve boolWhether the request was approved.
-
Type McpApprovalResponseThe type of the item. Always
mcp_approval_response.const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
-
Reason stringOptional reason for the decision.
-
-
type ResponseItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
ID stringThe unique ID of the tool call.
-
Arguments stringA JSON string of the arguments passed to the tool.
-
Name stringThe name of the tool that was run.
-
ServerLabel stringThe label of the MCP server running the tool.
-
Type McpCallThe type of the item. Always
mcp_call.const McpCallMcpCall McpCall = "mcp_call"
-
ApprovalRequestID stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
Error stringThe error from the tool call, if any.
-
Output stringThe output from the tool call.
-
Status stringThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
const ResponseItemMcpCallStatusInProgress ResponseItemMcpCallStatus = "in_progress" -
const ResponseItemMcpCallStatusCompleted ResponseItemMcpCallStatus = "completed" -
const ResponseItemMcpCallStatusIncomplete ResponseItemMcpCallStatus = "incomplete" -
const ResponseItemMcpCallStatusCalling ResponseItemMcpCallStatus = "calling" -
const ResponseItemMcpCallStatusFailed ResponseItemMcpCallStatus = "failed"
-
-
-
type ResponseCustomToolCallItem struct{…}A call to a custom tool created by the model.
-
ID stringThe unique ID of the custom tool call item.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseCustomToolCallItemStatusInProgress ResponseCustomToolCallItemStatus = "in_progress" -
const ResponseCustomToolCallItemStatusCompleted ResponseCustomToolCallItemStatus = "completed" -
const ResponseCustomToolCallItemStatusIncomplete ResponseCustomToolCallItemStatus = "incomplete"
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseCustomToolCallOutputItem struct{…}The output of a custom tool call from your code, being sent back to the model.
-
ID stringThe unique ID of the custom tool call output item.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseCustomToolCallOutputItemStatusInProgress ResponseCustomToolCallOutputItemStatus = "in_progress" -
const ResponseCustomToolCallOutputItemStatusCompleted ResponseCustomToolCallOutputItemStatus = "completed" -
const ResponseCustomToolCallOutputItemStatusIncomplete ResponseCustomToolCallOutputItemStatus = "incomplete"
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
Example
package main
import (
"context"
"fmt"
"github.com/openai/openai-go"
"github.com/openai/openai-go/option"
"github.com/openai/openai-go/responses"
)
func main() {
client := openai.NewClient(
option.WithAPIKey("My API Key"),
)
page, err := client.Responses.InputItems.List(
context.TODO(),
"response_id",
responses.InputItemListParams{
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
Response
{
"data": [
{
"id": "id",
"content": [
{
"text": "text",
"type": "input_text"
}
],
"role": "user",
"type": "message",
"status": "in_progress"
}
],
"first_id": "first_id",
"has_more": true,
"last_id": "last_id",
"object": "list"
}
Domain Types
Response Item List
-
type ResponseItemList struct{…}A list of Response items.
-
Data []ResponseItemUnionA list of items used to generate this response.
-
type ResponseInputMessageItem struct{…}-
ID stringThe unique ID of the message input.
-
Content ResponseInputMessageContentListA list of one or many input items to the model, containing different content types.
-
type ResponseInputText struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
Detail ResponseInputImageDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageDetailLow ResponseInputImageDetail = "low" -
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high" -
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto" -
const ResponseInputImageDetailOriginal ResponseInputImageDetail = "original"
-
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFile struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileDetailLow ResponseInputFileDetail = "low" -
const ResponseInputFileDetailHigh ResponseInputFileDetail = "high"
-
-
FileData stringThe content of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
Role ResponseInputMessageItemRoleThe role of the message input. One of
user,system, ordeveloper.-
const ResponseInputMessageItemRoleUser ResponseInputMessageItemRole = "user" -
const ResponseInputMessageItemRoleSystem ResponseInputMessageItemRole = "system" -
const ResponseInputMessageItemRoleDeveloper ResponseInputMessageItemRole = "developer"
-
-
Type MessageThe type of the message input. Always set to
message.const MessageMessage Message = "message"
-
Status ResponseInputMessageItemStatusThe status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputMessageItemStatusInProgress ResponseInputMessageItemStatus = "in_progress" -
const ResponseInputMessageItemStatusCompleted ResponseInputMessageItemStatus = "completed" -
const ResponseInputMessageItemStatusIncomplete ResponseInputMessageItemStatus = "incomplete"
-
-
-
type ResponseOutputMessage struct{…}An output message from the model.
-
ID stringThe unique ID of the output message.
-
Content []ResponseOutputMessageContentUnionThe content of the output message.
-
type ResponseOutputText struct{…}A text output from the model.
-
Annotations []ResponseOutputTextAnnotationUnionThe annotations of the text output.
-
type ResponseOutputTextAnnotationFileCitation struct{…}A citation to a file.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the file cited.
-
Index int64The index of the file in the list of files.
-
Type FileCitationThe type of the file citation. Always
file_citation.const FileCitationFileCitation FileCitation = "file_citation"
-
-
type ResponseOutputTextAnnotationURLCitation struct{…}A citation for a web resource used to generate a model response.
-
EndIndex int64The index of the last character of the URL citation in the message.
-
StartIndex int64The index of the first character of the URL citation in the message.
-
Title stringThe title of the web resource.
-
Type URLCitationThe type of the URL citation. Always
url_citation.const URLCitationURLCitation URLCitation = "url_citation"
-
URL stringThe URL of the web resource.
-
-
type ResponseOutputTextAnnotationContainerFileCitation struct{…}A citation for a container file used to generate a model response.
-
ContainerID stringThe ID of the container file.
-
EndIndex int64The index of the last character of the container file citation in the message.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the container file cited.
-
StartIndex int64The index of the first character of the container file citation in the message.
-
Type ContainerFileCitationThe type of the container file citation. Always
container_file_citation.const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"
-
-
type ResponseOutputTextAnnotationFilePath struct{…}A path to a file.
-
FileID stringThe ID of the file.
-
Index int64The index of the file in the list of files.
-
Type FilePathThe type of the file path. Always
file_path.const FilePathFilePath FilePath = "file_path"
-
-
-
Text stringThe text output from the model.
-
Type OutputTextThe type of the output text. Always
output_text.const OutputTextOutputText OutputText = "output_text"
-
Logprobs []ResponseOutputTextLogprob-
Token string -
Bytes []int64 -
Logprob float64 -
TopLogprobs []ResponseOutputTextLogprobTopLogprob-
Token string -
Bytes []int64 -
Logprob float64
-
-
-
-
type ResponseOutputRefusal struct{…}A refusal from the model.
-
Refusal stringThe refusal explanation from the model.
-
Type RefusalThe type of the refusal. Always
refusal.const RefusalRefusal Refusal = "refusal"
-
-
-
Role AssistantThe role of the output message. Always
assistant.const AssistantAssistant Assistant = "assistant"
-
Status ResponseOutputMessageStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseOutputMessageStatusInProgress ResponseOutputMessageStatus = "in_progress" -
const ResponseOutputMessageStatusCompleted ResponseOutputMessageStatus = "completed" -
const ResponseOutputMessageStatusIncomplete ResponseOutputMessageStatus = "incomplete"
-
-
Type MessageThe type of the output message. Always
message.const MessageMessage Message = "message"
-
Phase ResponseOutputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const ResponseOutputMessagePhaseCommentary ResponseOutputMessagePhase = "commentary" -
const ResponseOutputMessagePhaseFinalAnswer ResponseOutputMessagePhase = "final_answer"
-
-
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
ID stringThe unique ID of the file search tool call.
-
Queries []stringThe queries used to search for files.
-
Status ResponseFileSearchToolCallStatusThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
const ResponseFileSearchToolCallStatusInProgress ResponseFileSearchToolCallStatus = "in_progress" -
const ResponseFileSearchToolCallStatusSearching ResponseFileSearchToolCallStatus = "searching" -
const ResponseFileSearchToolCallStatusCompleted ResponseFileSearchToolCallStatus = "completed" -
const ResponseFileSearchToolCallStatusIncomplete ResponseFileSearchToolCallStatus = "incomplete" -
const ResponseFileSearchToolCallStatusFailed ResponseFileSearchToolCallStatus = "failed"
-
-
Type FileSearchCallThe type of the file search tool call. Always
file_search_call.const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"
-
Results []ResponseFileSearchToolCallResultThe results of the file search tool call.
-
Attributes map[string, ResponseFileSearchToolCallResultAttributeUnion]Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.
-
string -
float64 -
bool
-
-
FileID stringThe unique ID of the file.
-
Filename stringThe name of the file.
-
Score float64The relevance score of the file - a value between 0 and 1.
-
Text stringThe text that was retrieved from the file.
-
-
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
ID stringThe unique ID of the computer call.
-
CallID stringAn identifier used when responding to the tool call with output.
-
PendingSafetyChecks []ResponseComputerToolCallPendingSafetyCheckThe pending safety checks for the computer call.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status ResponseComputerToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseComputerToolCallStatusInProgress ResponseComputerToolCallStatus = "in_progress" -
const ResponseComputerToolCallStatusCompleted ResponseComputerToolCallStatus = "completed" -
const ResponseComputerToolCallStatusIncomplete ResponseComputerToolCallStatus = "incomplete"
-
-
Type ResponseComputerToolCallTypeThe type of the computer call. Always
computer_call.const ResponseComputerToolCallTypeComputerCall ResponseComputerToolCallType = "computer_call"
-
Action ResponseComputerToolCallActionUnionA click action.
-
type ResponseComputerToolCallActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ResponseComputerToolCallActionClickButtonLeft ResponseComputerToolCallActionClickButton = "left" -
const ResponseComputerToolCallActionClickButtonRight ResponseComputerToolCallActionClickButton = "right" -
const ResponseComputerToolCallActionClickButtonWheel ResponseComputerToolCallActionClickButton = "wheel" -
const ResponseComputerToolCallActionClickButtonBack ResponseComputerToolCallActionClickButton = "back" -
const ResponseComputerToolCallActionClickButtonForward ResponseComputerToolCallActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ResponseComputerToolCallActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ResponseComputerToolCallActionDrag struct{…}A drag action.
-
Path []ResponseComputerToolCallActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ResponseComputerToolCallActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ResponseComputerToolCallActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ResponseComputerToolCallActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ResponseComputerToolCallActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ResponseComputerToolCallActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ResponseComputerToolCallActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
Actions ComputerActionListFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
type ComputerActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ComputerActionClickButtonLeft ComputerActionClickButton = "left" -
const ComputerActionClickButtonRight ComputerActionClickButton = "right" -
const ComputerActionClickButtonWheel ComputerActionClickButton = "wheel" -
const ComputerActionClickButtonBack ComputerActionClickButton = "back" -
const ComputerActionClickButtonForward ComputerActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ComputerActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ComputerActionDrag struct{…}A drag action.
-
Path []ComputerActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ComputerActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ComputerActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ComputerActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ComputerActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ComputerActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ComputerActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
-
type ResponseComputerToolCallOutputItem struct{…}-
ID stringThe unique ID of the computer call tool output.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Type ComputerScreenshotSpecifies the event type. For a computer screenshot, this property is always set to
computer_screenshot.const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"
-
FileID stringThe identifier of an uploaded file that contains the screenshot.
-
ImageURL stringThe URL of the screenshot image.
-
-
Status ResponseComputerToolCallOutputItemStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseComputerToolCallOutputItemStatusCompleted ResponseComputerToolCallOutputItemStatus = "completed" -
const ResponseComputerToolCallOutputItemStatusIncomplete ResponseComputerToolCallOutputItemStatus = "incomplete" -
const ResponseComputerToolCallOutputItemStatusFailed ResponseComputerToolCallOutputItemStatus = "failed" -
const ResponseComputerToolCallOutputItemStatusInProgress ResponseComputerToolCallOutputItemStatus = "in_progress"
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
AcknowledgedSafetyChecks []ResponseComputerToolCallOutputItemAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
ID stringThe unique ID of the web search tool call.
-
Action ResponseFunctionWebSearchActionUnionAn object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
type ResponseFunctionWebSearchActionSearch struct{…}Action type "search" - Performs a web search query.
-
Type SearchThe action type.
const SearchSearch Search = "search"
-
Queries []stringThe search queries.
-
Query stringThe search query.
-
Sources []ResponseFunctionWebSearchActionSearchSourceThe sources used in the search.
-
Type URLThe type of source. Always
url.const URLURL URL = "url"
-
URL stringThe URL of the source.
-
-
-
type ResponseFunctionWebSearchActionOpenPage struct{…}Action type "open_page" - Opens a specific URL from search results.
-
Type OpenPageThe action type.
const OpenPageOpenPage OpenPage = "open_page"
-
URL stringThe URL opened by the model.
-
-
type ResponseFunctionWebSearchActionFindInPage struct{…}Action type "find_in_page": Searches for a pattern within a loaded page.
-
Pattern stringThe pattern or text to search for within the page.
-
Type FindInPageThe action type.
const FindInPageFindInPage FindInPage = "find_in_page"
-
URL stringThe URL of the page searched for the pattern.
-
-
-
Status ResponseFunctionWebSearchStatusThe status of the web search tool call.
-
const ResponseFunctionWebSearchStatusInProgress ResponseFunctionWebSearchStatus = "in_progress" -
const ResponseFunctionWebSearchStatusSearching ResponseFunctionWebSearchStatus = "searching" -
const ResponseFunctionWebSearchStatusCompleted ResponseFunctionWebSearchStatus = "completed" -
const ResponseFunctionWebSearchStatusFailed ResponseFunctionWebSearchStatus = "failed"
-
-
Type WebSearchCallThe type of the web search tool call. Always
web_search_call.const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"
-
-
type ResponseFunctionToolCallItem struct{…}A tool call to run a function. See the function calling guide for more information.
-
ID stringThe unique ID of the function tool call.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallItemStatusInProgress ResponseFunctionToolCallItemStatus = "in_progress" -
const ResponseFunctionToolCallItemStatusCompleted ResponseFunctionToolCallItemStatus = "completed" -
const ResponseFunctionToolCallItemStatusIncomplete ResponseFunctionToolCallItemStatus = "incomplete"
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseFunctionToolCallOutputItem struct{…}-
ID stringThe unique ID of the function call tool output.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseFunctionToolCallOutputItemOutputUnionThe output from the function call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseFunctionToolCallOutputItemOutputOutputContentList []ResponseFunctionToolCallOutputItemOutputOutputContentListItemUnionText, image, or file output of the function call.
-
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
-
Status ResponseFunctionToolCallOutputItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallOutputItemStatusInProgress ResponseFunctionToolCallOutputItemStatus = "in_progress" -
const ResponseFunctionToolCallOutputItemStatusCompleted ResponseFunctionToolCallOutputItemStatus = "completed" -
const ResponseFunctionToolCallOutputItemStatusIncomplete ResponseFunctionToolCallOutputItemStatus = "incomplete"
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseToolSearchCall struct{…}-
ID stringThe unique ID of the tool search call item.
-
Arguments anyArguments used for the tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchCallExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchCallExecutionServer ResponseToolSearchCallExecution = "server" -
const ResponseToolSearchCallExecutionClient ResponseToolSearchCallExecution = "client"
-
-
Status ResponseToolSearchCallStatusThe status of the tool search call item that was recorded.
-
const ResponseToolSearchCallStatusInProgress ResponseToolSearchCallStatus = "in_progress" -
const ResponseToolSearchCallStatusCompleted ResponseToolSearchCallStatus = "completed" -
const ResponseToolSearchCallStatusIncomplete ResponseToolSearchCallStatus = "incomplete"
-
-
Type ToolSearchCallThe type of the item. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseToolSearchOutputItem struct{…}-
ID stringThe unique ID of the tool search output item.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemExecutionServer ResponseToolSearchOutputItemExecution = "server" -
const ResponseToolSearchOutputItemExecutionClient ResponseToolSearchOutputItemExecution = "client"
-
-
Status ResponseToolSearchOutputItemStatusThe status of the tool search output item that was recorded.
-
const ResponseToolSearchOutputItemStatusInProgress ResponseToolSearchOutputItemStatus = "in_progress" -
const ResponseToolSearchOutputItemStatusCompleted ResponseToolSearchOutputItemStatus = "completed" -
const ResponseToolSearchOutputItemStatusIncomplete ResponseToolSearchOutputItemStatus = "incomplete"
-
-
Tools []ToolUnionThe loaded tool definitions returned by tool search.
-
type FunctionTool struct{…}Defines a function in your own code the model can choose to call. Learn more about function calling.
-
Name stringThe name of the function to call.
-
Parameters map[string, any]A JSON schema object describing the parameters of the function.
-
Strict boolWhether to enforce strict parameter validation. Default
true. -
Type FunctionThe type of the function tool. Always
function.const FunctionFunction Function = "function"
-
DeferLoading boolWhether this function is deferred and loaded via tool search.
-
Description stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
type FileSearchTool struct{…}A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
Type FileSearchThe type of the file search tool. Always
file_search.const FileSearchFileSearch FileSearch = "file_search"
-
VectorStoreIDs []stringThe IDs of the vector stores to search.
-
Filters FileSearchToolFiltersUnionA filter to apply.
-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
Key stringThe key to compare against the value.
-
Type ComparisonFilterTypeSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
const ComparisonFilterTypeEq ComparisonFilterType = "eq" -
const ComparisonFilterTypeNe ComparisonFilterType = "ne" -
const ComparisonFilterTypeGt ComparisonFilterType = "gt" -
const ComparisonFilterTypeGte ComparisonFilterType = "gte" -
const ComparisonFilterTypeLt ComparisonFilterType = "lt" -
const ComparisonFilterTypeLte ComparisonFilterType = "lte" -
const ComparisonFilterTypeIn ComparisonFilterType = "in" -
const ComparisonFilterTypeNin ComparisonFilterType = "nin"
-
-
Value ComparisonFilterValueUnionThe value to compare against the attribute key; supports string, number, or boolean types.
-
string -
float64 -
bool -
type ComparisonFilterValueArray []ComparisonFilterValueArrayItemUnion-
string -
float64
-
-
-
-
type CompoundFilter struct{…}Combine multiple filters using
andoror.-
Filters []ComparisonFilterArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
-
Type CompoundFilterTypeType of operation:
andoror.-
const CompoundFilterTypeAnd CompoundFilterType = "and" -
const CompoundFilterTypeOr CompoundFilterType = "or"
-
-
-
-
MaxNumResults int64The maximum number of results to return. This number should be between 1 and 50 inclusive.
-
RankingOptions FileSearchToolRankingOptionsRanking options for search.
-
HybridSearch FileSearchToolRankingOptionsHybridSearchWeights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
EmbeddingWeight float64The weight of the embedding in the reciprocal ranking fusion.
-
TextWeight float64The weight of the text in the reciprocal ranking fusion.
-
-
Ranker stringThe ranker to use for the file search.
-
const FileSearchToolRankingOptionsRankerAuto FileSearchToolRankingOptionsRanker = "auto" -
const FileSearchToolRankingOptionsRankerDefault2024_11_15 FileSearchToolRankingOptionsRanker = "default-2024-11-15"
-
-
ScoreThreshold float64The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
Type ComputerThe type of the computer tool. Always
computer.const ComputerComputer Computer = "computer"
-
-
type ComputerUsePreviewTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
DisplayHeight int64The height of the computer display.
-
DisplayWidth int64The width of the computer display.
-
Environment ComputerUsePreviewToolEnvironmentThe type of computer environment to control.
-
const ComputerUsePreviewToolEnvironmentWindows ComputerUsePreviewToolEnvironment = "windows" -
const ComputerUsePreviewToolEnvironmentMac ComputerUsePreviewToolEnvironment = "mac" -
const ComputerUsePreviewToolEnvironmentLinux ComputerUsePreviewToolEnvironment = "linux" -
const ComputerUsePreviewToolEnvironmentUbuntu ComputerUsePreviewToolEnvironment = "ubuntu" -
const ComputerUsePreviewToolEnvironmentBrowser ComputerUsePreviewToolEnvironment = "browser"
-
-
Type ComputerUsePreviewThe type of the computer use tool. Always
computer_use_preview.const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"
-
-
type WebSearchTool struct{…}Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
Type WebSearchToolTypeThe type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
const WebSearchToolTypeWebSearch WebSearchToolType = "web_search" -
const WebSearchToolTypeWebSearch2025_08_26 WebSearchToolType = "web_search_2025_08_26"
-
-
Filters WebSearchToolFiltersFilters for the search.
-
AllowedDomains []stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
SearchContextSize WebSearchToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchToolSearchContextSizeLow WebSearchToolSearchContextSize = "low" -
const WebSearchToolSearchContextSizeMedium WebSearchToolSearchContextSize = "medium" -
const WebSearchToolSearchContextSizeHigh WebSearchToolSearchContextSize = "high"
-
-
UserLocation WebSearchToolUserLocationThe approximate location of the user.
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
Type stringThe type of location approximation. Always
approximate.const WebSearchToolUserLocationTypeApproximate WebSearchToolUserLocationType = "approximate"
-
-
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
ServerLabel stringA label for this MCP server, used to identify it in tool calls.
-
Type McpThe type of the MCP tool. Always
mcp.const McpMcp Mcp = "mcp"
-
AllowedTools ToolMcpAllowedToolsUnionList of allowed tool names or a filter object.
-
type ToolMcpAllowedToolsMcpAllowedTools []stringA string array of allowed tool names
-
type ToolMcpAllowedToolsMcpToolFilter struct{…}A filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
Authorization stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
ConnectorID stringIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
const ToolMcpConnectorIDConnectorDropbox ToolMcpConnectorID = "connector_dropbox" -
const ToolMcpConnectorIDConnectorGmail ToolMcpConnectorID = "connector_gmail" -
const ToolMcpConnectorIDConnectorGooglecalendar ToolMcpConnectorID = "connector_googlecalendar" -
const ToolMcpConnectorIDConnectorGoogledrive ToolMcpConnectorID = "connector_googledrive" -
const ToolMcpConnectorIDConnectorMicrosoftteams ToolMcpConnectorID = "connector_microsoftteams" -
const ToolMcpConnectorIDConnectorOutlookcalendar ToolMcpConnectorID = "connector_outlookcalendar" -
const ToolMcpConnectorIDConnectorOutlookemail ToolMcpConnectorID = "connector_outlookemail" -
const ToolMcpConnectorIDConnectorSharepoint ToolMcpConnectorID = "connector_sharepoint"
-
-
DeferLoading boolWhether this MCP tool is deferred and discovered via tool search.
-
Headers map[string, string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
RequireApproval ToolMcpRequireApprovalUnionSpecify which of the MCP server's tools require approval.
-
type ToolMcpRequireApprovalMcpToolApprovalFilter 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.-
Always ToolMcpRequireApprovalMcpToolApprovalFilterAlwaysA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
Never ToolMcpRequireApprovalMcpToolApprovalFilterNeverA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
type ToolMcpRequireApprovalMcpToolApprovalSetting stringSpecify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
const ToolMcpRequireApprovalMcpToolApprovalSettingAlways ToolMcpRequireApprovalMcpToolApprovalSetting = "always" -
const ToolMcpRequireApprovalMcpToolApprovalSettingNever ToolMcpRequireApprovalMcpToolApprovalSetting = "never"
-
-
-
ServerDescription stringOptional description of the MCP server, used to provide more context.
-
ServerURL stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
TunnelID stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
Container ToolCodeInterpreterContainerUnionThe code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
string -
type ToolCodeInterpreterContainerCodeInterpreterContainerAuto struct{…}Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
Type AutoAlways
auto.const AutoAuto Auto = "auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit stringThe memory limit for the code interpreter container.
-
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"
-
-
NetworkPolicy ToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…}-
Type DisabledDisable outbound network access. Always
disabled.const DisabledDisabled Disabled = "disabled"
-
-
type ContainerNetworkPolicyAllowlist struct{…}-
AllowedDomains []stringA list of allowed domains when type is
allowlist. -
Type AllowlistAllow outbound network access only to specified domains. Always
allowlist.const AllowlistAllowlist Allowlist = "allowlist"
-
DomainSecrets []ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
Domain stringThe domain associated with the secret.
-
Name stringThe name of the secret to inject for the domain.
-
Value stringThe secret value to inject for the domain.
-
-
-
-
-
-
Type CodeInterpreterThe type of the code interpreter tool. Always
code_interpreter.const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"
-
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
Type ImageGenerationThe type of the image generation tool. Always
image_generation.const ImageGenerationImageGeneration ImageGeneration = "image_generation"
-
Action stringWhether to generate a new image or edit an existing image. Default:
auto.-
const ToolImageGenerationActionGenerate ToolImageGenerationAction = "generate" -
const ToolImageGenerationActionEdit ToolImageGenerationAction = "edit" -
const ToolImageGenerationActionAuto ToolImageGenerationAction = "auto"
-
-
Background stringAllows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
const ToolImageGenerationBackgroundTransparent ToolImageGenerationBackground = "transparent" -
const ToolImageGenerationBackgroundOpaque ToolImageGenerationBackground = "opaque" -
const ToolImageGenerationBackgroundAuto ToolImageGenerationBackground = "auto"
-
-
InputFidelity stringControl how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
const ToolImageGenerationInputFidelityHigh ToolImageGenerationInputFidelity = "high" -
const ToolImageGenerationInputFidelityLow ToolImageGenerationInputFidelity = "low"
-
-
InputImageMask ToolImageGenerationInputImageMaskOptional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
FileID stringFile ID for the mask image.
-
ImageURL stringBase64-encoded mask image.
-
-
Model stringThe image generation model to use. Default:
gpt-image-1.-
string -
string-
const ToolImageGenerationModelGPTImage1 ToolImageGenerationModel = "gpt-image-1" -
const ToolImageGenerationModelGPTImage1Mini ToolImageGenerationModel = "gpt-image-1-mini" -
const ToolImageGenerationModelGPTImage2 ToolImageGenerationModel = "gpt-image-2" -
const ToolImageGenerationModelGPTImage2_2026_04_21 ToolImageGenerationModel = "gpt-image-2-2026-04-21" -
const ToolImageGenerationModelGPTImage1_5 ToolImageGenerationModel = "gpt-image-1.5" -
const ToolImageGenerationModelChatgptImageLatest ToolImageGenerationModel = "chatgpt-image-latest"
-
-
-
Moderation stringModeration level for the generated image. Default:
auto.-
const ToolImageGenerationModerationAuto ToolImageGenerationModeration = "auto" -
const ToolImageGenerationModerationLow ToolImageGenerationModeration = "low"
-
-
OutputCompression int64Compression level for the output image. Default: 100.
-
OutputFormat stringThe output format of the generated image. One of
png,webp, orjpeg. Default:png.-
const ToolImageGenerationOutputFormatPNG ToolImageGenerationOutputFormat = "png" -
const ToolImageGenerationOutputFormatWebP ToolImageGenerationOutputFormat = "webp" -
const ToolImageGenerationOutputFormatJPEG ToolImageGenerationOutputFormat = "jpeg"
-
-
PartialImages int64Number of partial images to generate in streaming mode, from 0 (default value) to 3.
-
Quality stringThe quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
const ToolImageGenerationQualityLow ToolImageGenerationQuality = "low" -
const ToolImageGenerationQualityMedium ToolImageGenerationQuality = "medium" -
const ToolImageGenerationQualityHigh ToolImageGenerationQuality = "high" -
const ToolImageGenerationQualityAuto ToolImageGenerationQuality = "auto"
-
-
Size stringThe size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
string -
string-
const ToolImageGenerationSize1024x1024 ToolImageGenerationSize = "1024x1024" -
const ToolImageGenerationSize1024x1536 ToolImageGenerationSize = "1024x1536" -
const ToolImageGenerationSize1536x1024 ToolImageGenerationSize = "1536x1024" -
const ToolImageGenerationSizeAuto ToolImageGenerationSize = "auto"
-
-
-
-
type ToolLocalShell struct{…}A tool that allows the model to execute shell commands in a local environment.
-
Type LocalShellThe type of the local shell tool. Always
local_shell.const LocalShellLocalShell LocalShell = "local_shell"
-
-
type FunctionShellTool struct{…}A tool that allows the model to execute shell commands.
-
Type ShellThe type of the shell tool. Always
shell.const ShellShell Shell = "shell"
-
Environment FunctionShellToolEnvironmentUnion-
type ContainerAuto struct{…}-
Type ContainerAutoAutomatically creates a container for this request
const ContainerAutoContainerAuto ContainerAuto = "container_auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit ContainerAutoMemoryLimitThe memory limit for the container.
-
const ContainerAutoMemoryLimit1g ContainerAutoMemoryLimit = "1g" -
const ContainerAutoMemoryLimit4g ContainerAutoMemoryLimit = "4g" -
const ContainerAutoMemoryLimit16g ContainerAutoMemoryLimit = "16g" -
const ContainerAutoMemoryLimit64g ContainerAutoMemoryLimit = "64g"
-
-
NetworkPolicy ContainerAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…} -
type ContainerNetworkPolicyAllowlist struct{…}
-
-
Skills []ContainerAutoSkillUnionAn optional list of skills referenced by id or inline data.
-
type SkillReference struct{…}-
SkillID stringThe ID of the referenced skill.
-
Type SkillReferenceReferences a skill created with the /v1/skills endpoint.
const SkillReferenceSkillReference SkillReference = "skill_reference"
-
Version stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
type InlineSkill struct{…}-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Source InlineSkillSourceInline skill payload
-
Data stringBase64-encoded skill zip bundle.
-
MediaType ApplicationZipThe media type of the inline skill payload. Must be
application/zip.const ApplicationZipApplicationZip ApplicationZip = "application/zip"
-
Type Base64The type of the inline skill source. Must be
base64.const Base64Base64 Base64 = "base64"
-
-
Type InlineDefines an inline skill for this request.
const InlineInline Inline = "inline"
-
-
-
-
type LocalEnvironment struct{…}-
Type LocalUse a local computer environment.
const LocalLocal Local = "local"
-
Skills []LocalSkillAn optional list of skills.
-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Path stringThe path to the directory containing the skill.
-
-
-
type ContainerReference struct{…}-
ContainerID stringThe ID of the referenced container.
-
Type ContainerReferenceReferences a container created with the /v1/containers endpoint
const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
Name stringThe name of the custom tool, used to identify it in tool calls.
-
Type CustomThe type of the custom tool. Always
custom.const CustomCustom Custom = "custom"
-
DeferLoading boolWhether this tool should be deferred and discovered via tool search.
-
Description stringOptional description of the custom tool, used to provide more context.
-
Format CustomToolInputFormatUnionThe input format for the custom tool. Default is unconstrained text.
-
type CustomToolInputFormatText struct{…}Unconstrained free-form text.
-
Type TextUnconstrained text format. Always
text.const TextText Text = "text"
-
-
type CustomToolInputFormatGrammar struct{…}A grammar defined by the user.
-
Definition stringThe grammar definition.
-
Syntax stringThe syntax of the grammar definition. One of
larkorregex.-
const CustomToolInputFormatGrammarSyntaxLark CustomToolInputFormatGrammarSyntax = "lark" -
const CustomToolInputFormatGrammarSyntaxRegex CustomToolInputFormatGrammarSyntax = "regex"
-
-
Type GrammarGrammar format. Always
grammar.const GrammarGrammar Grammar = "grammar"
-
-
-
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
Description stringA description of the namespace shown to the model.
-
Name stringThe namespace name used in tool calls (for example,
crm). -
Tools []NamespaceToolToolUnionThe function/custom tools available inside this namespace.
-
type NamespaceToolToolFunction struct{…}-
Name string -
Type Functionconst FunctionFunction Function = "function"
-
DeferLoading boolWhether this function should be deferred and discovered via tool search.
-
Description string -
Parameters any -
Strict bool
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
-
Type NamespaceThe type of the tool. Always
namespace.const NamespaceNamespace Namespace = "namespace"
-
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
Type ToolSearchThe type of the tool. Always
tool_search.const ToolSearchToolSearch ToolSearch = "tool_search"
-
Description stringDescription shown to the model for a client-executed tool search tool.
-
Execution ToolSearchToolExecutionWhether tool search is executed by the server or by the client.
-
const ToolSearchToolExecutionServer ToolSearchToolExecution = "server" -
const ToolSearchToolExecutionClient ToolSearchToolExecution = "client"
-
-
Parameters anyParameter schema for a client-executed tool search tool.
-
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
Type WebSearchPreviewToolTypeThe type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
const WebSearchPreviewToolTypeWebSearchPreview WebSearchPreviewToolType = "web_search_preview" -
const WebSearchPreviewToolTypeWebSearchPreview2025_03_11 WebSearchPreviewToolType = "web_search_preview_2025_03_11"
-
-
SearchContentTypes []string-
const WebSearchPreviewToolSearchContentTypeText WebSearchPreviewToolSearchContentType = "text" -
const WebSearchPreviewToolSearchContentTypeImage WebSearchPreviewToolSearchContentType = "image"
-
-
SearchContextSize WebSearchPreviewToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchPreviewToolSearchContextSizeLow WebSearchPreviewToolSearchContextSize = "low" -
const WebSearchPreviewToolSearchContextSizeMedium WebSearchPreviewToolSearchContextSize = "medium" -
const WebSearchPreviewToolSearchContextSizeHigh WebSearchPreviewToolSearchContextSize = "high"
-
-
UserLocation WebSearchPreviewToolUserLocationThe user's location.
-
Type ApproximateThe type of location approximation. Always
approximate.const ApproximateApproximate Approximate = "approximate"
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
Type ApplyPatchThe type of the tool. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
-
Type ToolSearchOutputThe type of the item. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseItemAdditionalTools struct{…}-
ID stringThe unique ID of the additional tools item.
-
Role stringThe role that provided the additional tools.
-
const ResponseItemAdditionalToolsRoleUnknown ResponseItemAdditionalToolsRole = "unknown" -
const ResponseItemAdditionalToolsRoleUser ResponseItemAdditionalToolsRole = "user" -
const ResponseItemAdditionalToolsRoleAssistant ResponseItemAdditionalToolsRole = "assistant" -
const ResponseItemAdditionalToolsRoleSystem ResponseItemAdditionalToolsRole = "system" -
const ResponseItemAdditionalToolsRoleCritic ResponseItemAdditionalToolsRole = "critic" -
const ResponseItemAdditionalToolsRoleDiscriminator ResponseItemAdditionalToolsRole = "discriminator" -
const ResponseItemAdditionalToolsRoleDeveloper ResponseItemAdditionalToolsRole = "developer" -
const ResponseItemAdditionalToolsRoleTool ResponseItemAdditionalToolsRole = "tool"
-
-
Tools []ToolUnionThe additional tool definitions made available at this item.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type AdditionalToolsThe type of the item. Always
additional_tools.const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"
-
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
ID stringThe unique identifier of the reasoning content.
-
Summary []ResponseReasoningItemSummaryReasoning summary content.
-
Text stringA summary of the reasoning output from the model so far.
-
Type SummaryTextThe type of the object. Always
summary_text.const SummaryTextSummaryText SummaryText = "summary_text"
-
-
Type ReasoningThe type of the object. Always
reasoning.const ReasoningReasoning Reasoning = "reasoning"
-
Content []ResponseReasoningItemContentReasoning text content.
-
Text stringThe reasoning text from the model.
-
Type ReasoningTextThe type of the reasoning text. Always
reasoning_text.const ReasoningTextReasoningText ReasoningText = "reasoning_text"
-
-
EncryptedContent stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
Status ResponseReasoningItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseReasoningItemStatusInProgress ResponseReasoningItemStatus = "in_progress" -
const ResponseReasoningItemStatusCompleted ResponseReasoningItemStatus = "completed" -
const ResponseReasoningItemStatusIncomplete ResponseReasoningItemStatus = "incomplete"
-
-
-
type ResponseCompactionItem struct{…}A compaction item generated by the
v1/responses/compactAPI.-
ID stringThe unique ID of the compaction item.
-
EncryptedContent stringThe encrypted content that was produced by compaction.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseItemImageGenerationCall struct{…}An image generation request made by the model.
-
ID stringThe unique ID of the image generation call.
-
Result stringThe generated image encoded in base64.
-
Status stringThe status of the image generation call.
-
const ResponseItemImageGenerationCallStatusInProgress ResponseItemImageGenerationCallStatus = "in_progress" -
const ResponseItemImageGenerationCallStatusCompleted ResponseItemImageGenerationCallStatus = "completed" -
const ResponseItemImageGenerationCallStatusGenerating ResponseItemImageGenerationCallStatus = "generating" -
const ResponseItemImageGenerationCallStatusFailed ResponseItemImageGenerationCallStatus = "failed"
-
-
Type ImageGenerationCallThe type of the image generation call. Always
image_generation_call.const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"
-
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
ID stringThe unique ID of the code interpreter tool call.
-
Code stringThe code to run, or null if not available.
-
ContainerID stringThe ID of the container used to run the code.
-
Outputs []ResponseCodeInterpreterToolCallOutputUnionThe outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
type ResponseCodeInterpreterToolCallOutputLogs struct{…}The logs output from the code interpreter.
-
Logs stringThe logs output from the code interpreter.
-
Type LogsThe type of the output. Always
logs.const LogsLogs Logs = "logs"
-
-
type ResponseCodeInterpreterToolCallOutputImage struct{…}The image output from the code interpreter.
-
Type ImageThe type of the output. Always
image.const ImageImage Image = "image"
-
URL stringThe URL of the image output from the code interpreter.
-
-
-
Status ResponseCodeInterpreterToolCallStatusThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
const ResponseCodeInterpreterToolCallStatusInProgress ResponseCodeInterpreterToolCallStatus = "in_progress" -
const ResponseCodeInterpreterToolCallStatusCompleted ResponseCodeInterpreterToolCallStatus = "completed" -
const ResponseCodeInterpreterToolCallStatusIncomplete ResponseCodeInterpreterToolCallStatus = "incomplete" -
const ResponseCodeInterpreterToolCallStatusInterpreting ResponseCodeInterpreterToolCallStatus = "interpreting" -
const ResponseCodeInterpreterToolCallStatusFailed ResponseCodeInterpreterToolCallStatus = "failed"
-
-
Type CodeInterpreterCallThe type of the code interpreter tool call. Always
code_interpreter_call.const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"
-
-
type ResponseItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
ID stringThe unique ID of the local shell call.
-
Action ResponseItemLocalShellCallActionExecute a shell command on the server.
-
Command []stringThe command to run.
-
Env map[string, string]Environment variables to set for the command.
-
Type ExecThe type of the local shell action. Always
exec.const ExecExec Exec = "exec"
-
TimeoutMs int64Optional timeout in milliseconds for the command.
-
User stringOptional user to run the command as.
-
WorkingDirectory stringOptional working directory to run the command in.
-
-
CallID stringThe unique ID of the local shell tool call generated by the model.
-
Status stringThe status of the local shell call.
-
const ResponseItemLocalShellCallStatusInProgress ResponseItemLocalShellCallStatus = "in_progress" -
const ResponseItemLocalShellCallStatusCompleted ResponseItemLocalShellCallStatus = "completed" -
const ResponseItemLocalShellCallStatusIncomplete ResponseItemLocalShellCallStatus = "incomplete"
-
-
Type LocalShellCallThe type of the local shell call. Always
local_shell_call.const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"
-
-
type ResponseItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
ID stringThe unique ID of the local shell tool call generated by the model.
-
Output stringA JSON string of the output of the local shell tool call.
-
Type LocalShellCallOutputThe type of the local shell tool call output. Always
local_shell_call_output.const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete.-
const ResponseItemLocalShellCallOutputStatusInProgress ResponseItemLocalShellCallOutputStatus = "in_progress" -
const ResponseItemLocalShellCallOutputStatusCompleted ResponseItemLocalShellCallOutputStatus = "completed" -
const ResponseItemLocalShellCallOutputStatusIncomplete ResponseItemLocalShellCallOutputStatus = "incomplete"
-
-
-
type ResponseFunctionShellToolCall struct{…}A tool call that executes one or more shell commands in a managed environment.
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Action ResponseFunctionShellToolCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []string -
MaxOutputLength int64Optional maximum number of characters to return from each command.
-
TimeoutMs int64Optional timeout in milliseconds for the commands.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Environment ResponseFunctionShellToolCallEnvironmentUnionRepresents the use of a local environment to perform shell actions.
-
type ResponseLocalEnvironment struct{…}Represents the use of a local environment to perform shell actions.
-
Type LocalThe environment type. Always
local.const LocalLocal Local = "local"
-
-
type ResponseContainerReference struct{…}Represents a container created with /v1/containers.
-
ContainerID string -
Type ContainerReferenceThe environment type. Always
container_reference.const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
Status ResponseFunctionShellToolCallStatusThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallStatusInProgress ResponseFunctionShellToolCallStatus = "in_progress" -
const ResponseFunctionShellToolCallStatusCompleted ResponseFunctionShellToolCallStatus = "completed" -
const ResponseFunctionShellToolCallStatusIncomplete ResponseFunctionShellToolCallStatus = "incomplete"
-
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseFunctionShellToolCallOutput struct{…}The output of a shell tool call that was emitted.
-
ID stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
MaxOutputLength int64The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
Output []ResponseFunctionShellToolCallOutputOutputAn array of shell call output contents
-
Outcome ResponseFunctionShellToolCallOutputOutputOutcomeUnionRepresents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
type ResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64Exit code from the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringThe standard error output that was captured.
-
Stdout stringThe standard output that was captured.
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
Status ResponseFunctionShellToolCallOutputStatusThe status of the shell call output. One of
in_progress,completed, orincomplete.-
const ResponseFunctionShellToolCallOutputStatusInProgress ResponseFunctionShellToolCallOutputStatus = "in_progress" -
const ResponseFunctionShellToolCallOutputStatusCompleted ResponseFunctionShellToolCallOutputStatus = "completed" -
const ResponseFunctionShellToolCallOutputStatusIncomplete ResponseFunctionShellToolCallOutputStatus = "incomplete"
-
-
Type ShellCallOutputThe type of the shell call output. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseApplyPatchToolCall struct{…}A tool call that applies file diffs by creating, deleting, or updating files.
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseApplyPatchToolCallOperationUnionOne of the create_file, delete_file, or update_file operations applied via apply_patch.
-
type ResponseApplyPatchToolCallOperationCreateFile struct{…}Instruction describing how to create a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to create.
-
Type CreateFileCreate a new file with the provided diff.
const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseApplyPatchToolCallOperationDeleteFile struct{…}Instruction describing how to delete a file via the apply_patch tool.
-
Path stringPath of the file to delete.
-
Type DeleteFileDelete the specified file.
const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseApplyPatchToolCallOperationUpdateFile struct{…}Instruction describing how to update a file via the apply_patch tool.
-
Diff stringDiff to apply.
-
Path stringPath of the file to update.
-
Type UpdateFileUpdate an existing file with the provided diff.
const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status ResponseApplyPatchToolCallStatusThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseApplyPatchToolCallStatusInProgress ResponseApplyPatchToolCallStatus = "in_progress" -
const ResponseApplyPatchToolCallStatusCompleted ResponseApplyPatchToolCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
CreatedBy stringThe ID of the entity that created this tool call.
-
-
type ResponseApplyPatchToolCallOutput struct{…}The output emitted by an apply patch tool call.
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status ResponseApplyPatchToolCallOutputStatusThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseApplyPatchToolCallOutputStatusCompleted ResponseApplyPatchToolCallOutputStatus = "completed" -
const ResponseApplyPatchToolCallOutputStatusFailed ResponseApplyPatchToolCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
CreatedBy stringThe ID of the entity that created this tool call output.
-
Output stringOptional textual output returned by the apply patch tool.
-
-
type ResponseItemMcpListTools struct{…}A list of tools available on an MCP server.
-
ID stringThe unique ID of the list.
-
ServerLabel stringThe label of the MCP server.
-
Tools []ResponseItemMcpListToolsToolThe tools available on the server.
-
InputSchema anyThe JSON schema describing the tool's input.
-
Name stringThe name of the tool.
-
Annotations anyAdditional annotations about the tool.
-
Description stringThe description of the tool.
-
-
Type McpListToolsThe type of the item. Always
mcp_list_tools.const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
-
Error stringError message if the server could not list tools.
-
-
type ResponseItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
ID stringThe unique ID of the approval request.
-
Arguments stringA JSON string of arguments for the tool.
-
Name stringThe name of the tool to run.
-
ServerLabel stringThe label of the MCP server making the request.
-
Type McpApprovalRequestThe type of the item. Always
mcp_approval_request.const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"
-
-
type ResponseItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
ID stringThe unique ID of the approval response
-
ApprovalRequestID stringThe ID of the approval request being answered.
-
Approve boolWhether the request was approved.
-
Type McpApprovalResponseThe type of the item. Always
mcp_approval_response.const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
-
Reason stringOptional reason for the decision.
-
-
type ResponseItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
ID stringThe unique ID of the tool call.
-
Arguments stringA JSON string of the arguments passed to the tool.
-
Name stringThe name of the tool that was run.
-
ServerLabel stringThe label of the MCP server running the tool.
-
Type McpCallThe type of the item. Always
mcp_call.const McpCallMcpCall McpCall = "mcp_call"
-
ApprovalRequestID stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
Error stringThe error from the tool call, if any.
-
Output stringThe output from the tool call.
-
Status stringThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
const ResponseItemMcpCallStatusInProgress ResponseItemMcpCallStatus = "in_progress" -
const ResponseItemMcpCallStatusCompleted ResponseItemMcpCallStatus = "completed" -
const ResponseItemMcpCallStatusIncomplete ResponseItemMcpCallStatus = "incomplete" -
const ResponseItemMcpCallStatusCalling ResponseItemMcpCallStatus = "calling" -
const ResponseItemMcpCallStatusFailed ResponseItemMcpCallStatus = "failed"
-
-
-
type ResponseCustomToolCallItem struct{…}A call to a custom tool created by the model.
-
ID stringThe unique ID of the custom tool call item.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseCustomToolCallItemStatusInProgress ResponseCustomToolCallItemStatus = "in_progress" -
const ResponseCustomToolCallItemStatusCompleted ResponseCustomToolCallItemStatus = "completed" -
const ResponseCustomToolCallItemStatusIncomplete ResponseCustomToolCallItemStatus = "incomplete"
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
type ResponseCustomToolCallOutputItem struct{…}The output of a custom tool call from your code, being sent back to the model.
-
ID stringThe unique ID of the custom tool call output item.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseCustomToolCallOutputItemStatusInProgress ResponseCustomToolCallOutputItemStatus = "in_progress" -
const ResponseCustomToolCallOutputItemStatusCompleted ResponseCustomToolCallOutputItemStatus = "completed" -
const ResponseCustomToolCallOutputItemStatusIncomplete ResponseCustomToolCallOutputItemStatus = "incomplete"
-
-
CreatedBy stringThe identifier of the actor that created the item.
-
-
-
FirstID stringThe ID of the first item in the list.
-
HasMore boolWhether there are more items available.
-
LastID stringThe ID of the last item in the list.
-
Object ListThe type of object returned, must be
list.const ListList List = "list"
-
Input Tokens
Get input token counts
client.Responses.InputTokens.Count(ctx, body) (*InputTokenCountResponse, error)
post /responses/input_tokens
Returns input token counts of the request.
Returns an object with object set to response.input_tokens and an input_tokens count.
Parameters
-
body InputTokenCountParams-
Conversation param.Field[InputTokenCountParamsConversationUnion]The conversation that this response belongs to. Items from this conversation are prepended to
input_itemsfor this response request. Input items and output items from this response are automatically added to this conversation after this response completes.-
string -
type ResponseConversationParamResp struct{…}The conversation that this response belongs to.
-
ID stringThe unique ID of the conversation.
-
-
-
Input param.Field[InputTokenCountParamsInputUnion]Text, image, or file inputs to the model, used to generate a response
-
string -
type InputTokenCountParamsInputArray []ResponseInputItemUnionA list of one or many input items to the model, containing different content types.
-
type EasyInputMessage struct{…}A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.-
Content EasyInputMessageContentUnionText, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
-
string -
type ResponseInputMessageContentList []ResponseInputContentUnionA list of one or many input items to the model, containing different content types.
-
type ResponseInputText struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
Detail ResponseInputImageDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageDetailLow ResponseInputImageDetail = "low" -
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high" -
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto" -
const ResponseInputImageDetailOriginal ResponseInputImageDetail = "original"
-
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFile struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileDetailLow ResponseInputFileDetail = "low" -
const ResponseInputFileDetailHigh ResponseInputFileDetail = "high"
-
-
FileData stringThe content of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Role EasyInputMessageRoleThe role of the message input. One of
user,assistant,system, ordeveloper.-
const EasyInputMessageRoleUser EasyInputMessageRole = "user" -
const EasyInputMessageRoleAssistant EasyInputMessageRole = "assistant" -
const EasyInputMessageRoleSystem EasyInputMessageRole = "system" -
const EasyInputMessageRoleDeveloper EasyInputMessageRole = "developer"
-
-
Phase EasyInputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const EasyInputMessagePhaseCommentary EasyInputMessagePhase = "commentary" -
const EasyInputMessagePhaseFinalAnswer EasyInputMessagePhase = "final_answer"
-
-
Type EasyInputMessageTypeThe type of the message input. Always
message.const EasyInputMessageTypeMessage EasyInputMessageType = "message"
-
-
type ResponseInputItemMessage struct{…}A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole.-
Content ResponseInputMessageContentListA list of one or many input items to the model, containing different content types.
-
Role stringThe role of the message input. One of
user,system, ordeveloper.-
const ResponseInputItemMessageRoleUser ResponseInputItemMessageRole = "user" -
const ResponseInputItemMessageRoleSystem ResponseInputItemMessageRole = "system" -
const ResponseInputItemMessageRoleDeveloper ResponseInputItemMessageRole = "developer"
-
-
Status stringThe status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputItemMessageStatusInProgress ResponseInputItemMessageStatus = "in_progress" -
const ResponseInputItemMessageStatusCompleted ResponseInputItemMessageStatus = "completed" -
const ResponseInputItemMessageStatusIncomplete ResponseInputItemMessageStatus = "incomplete"
-
-
Type stringThe type of the message input. Always set to
message.const ResponseInputItemMessageTypeMessage ResponseInputItemMessageType = "message"
-
-
type ResponseOutputMessage struct{…}An output message from the model.
-
ID stringThe unique ID of the output message.
-
Content []ResponseOutputMessageContentUnionThe content of the output message.
-
type ResponseOutputText struct{…}A text output from the model.
-
Annotations []ResponseOutputTextAnnotationUnionThe annotations of the text output.
-
type ResponseOutputTextAnnotationFileCitation struct{…}A citation to a file.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the file cited.
-
Index int64The index of the file in the list of files.
-
Type FileCitationThe type of the file citation. Always
file_citation.const FileCitationFileCitation FileCitation = "file_citation"
-
-
type ResponseOutputTextAnnotationURLCitation struct{…}A citation for a web resource used to generate a model response.
-
EndIndex int64The index of the last character of the URL citation in the message.
-
StartIndex int64The index of the first character of the URL citation in the message.
-
Title stringThe title of the web resource.
-
Type URLCitationThe type of the URL citation. Always
url_citation.const URLCitationURLCitation URLCitation = "url_citation"
-
URL stringThe URL of the web resource.
-
-
type ResponseOutputTextAnnotationContainerFileCitation struct{…}A citation for a container file used to generate a model response.
-
ContainerID stringThe ID of the container file.
-
EndIndex int64The index of the last character of the container file citation in the message.
-
FileID stringThe ID of the file.
-
Filename stringThe filename of the container file cited.
-
StartIndex int64The index of the first character of the container file citation in the message.
-
Type ContainerFileCitationThe type of the container file citation. Always
container_file_citation.const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"
-
-
type ResponseOutputTextAnnotationFilePath struct{…}A path to a file.
-
FileID stringThe ID of the file.
-
Index int64The index of the file in the list of files.
-
Type FilePathThe type of the file path. Always
file_path.const FilePathFilePath FilePath = "file_path"
-
-
-
Text stringThe text output from the model.
-
Type OutputTextThe type of the output text. Always
output_text.const OutputTextOutputText OutputText = "output_text"
-
Logprobs []ResponseOutputTextLogprob-
Token string -
Bytes []int64 -
Logprob float64 -
TopLogprobs []ResponseOutputTextLogprobTopLogprob-
Token string -
Bytes []int64 -
Logprob float64
-
-
-
-
type ResponseOutputRefusal struct{…}A refusal from the model.
-
Refusal stringThe refusal explanation from the model.
-
Type RefusalThe type of the refusal. Always
refusal.const RefusalRefusal Refusal = "refusal"
-
-
-
Role AssistantThe role of the output message. Always
assistant.const AssistantAssistant Assistant = "assistant"
-
Status ResponseOutputMessageStatusThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseOutputMessageStatusInProgress ResponseOutputMessageStatus = "in_progress" -
const ResponseOutputMessageStatusCompleted ResponseOutputMessageStatus = "completed" -
const ResponseOutputMessageStatusIncomplete ResponseOutputMessageStatus = "incomplete"
-
-
Type MessageThe type of the output message. Always
message.const MessageMessage Message = "message"
-
Phase ResponseOutputMessagePhaseLabels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
const ResponseOutputMessagePhaseCommentary ResponseOutputMessagePhase = "commentary" -
const ResponseOutputMessagePhaseFinalAnswer ResponseOutputMessagePhase = "final_answer"
-
-
-
type ResponseFileSearchToolCall struct{…}The results of a file search tool call. See the file search guide for more information.
-
ID stringThe unique ID of the file search tool call.
-
Queries []stringThe queries used to search for files.
-
Status ResponseFileSearchToolCallStatusThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
const ResponseFileSearchToolCallStatusInProgress ResponseFileSearchToolCallStatus = "in_progress" -
const ResponseFileSearchToolCallStatusSearching ResponseFileSearchToolCallStatus = "searching" -
const ResponseFileSearchToolCallStatusCompleted ResponseFileSearchToolCallStatus = "completed" -
const ResponseFileSearchToolCallStatusIncomplete ResponseFileSearchToolCallStatus = "incomplete" -
const ResponseFileSearchToolCallStatusFailed ResponseFileSearchToolCallStatus = "failed"
-
-
Type FileSearchCallThe type of the file search tool call. Always
file_search_call.const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"
-
Results []ResponseFileSearchToolCallResultThe results of the file search tool call.
-
Attributes map[string, ResponseFileSearchToolCallResultAttributeUnion]Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.
-
string -
float64 -
bool
-
-
FileID stringThe unique ID of the file.
-
Filename stringThe name of the file.
-
Score float64The relevance score of the file - a value between 0 and 1.
-
Text stringThe text that was retrieved from the file.
-
-
-
type ResponseComputerToolCall struct{…}A tool call to a computer use tool. See the computer use guide for more information.
-
ID stringThe unique ID of the computer call.
-
CallID stringAn identifier used when responding to the tool call with output.
-
PendingSafetyChecks []ResponseComputerToolCallPendingSafetyCheckThe pending safety checks for the computer call.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status ResponseComputerToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseComputerToolCallStatusInProgress ResponseComputerToolCallStatus = "in_progress" -
const ResponseComputerToolCallStatusCompleted ResponseComputerToolCallStatus = "completed" -
const ResponseComputerToolCallStatusIncomplete ResponseComputerToolCallStatus = "incomplete"
-
-
Type ResponseComputerToolCallTypeThe type of the computer call. Always
computer_call.const ResponseComputerToolCallTypeComputerCall ResponseComputerToolCallType = "computer_call"
-
Action ResponseComputerToolCallActionUnionA click action.
-
type ResponseComputerToolCallActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ResponseComputerToolCallActionClickButtonLeft ResponseComputerToolCallActionClickButton = "left" -
const ResponseComputerToolCallActionClickButtonRight ResponseComputerToolCallActionClickButton = "right" -
const ResponseComputerToolCallActionClickButtonWheel ResponseComputerToolCallActionClickButton = "wheel" -
const ResponseComputerToolCallActionClickButtonBack ResponseComputerToolCallActionClickButton = "back" -
const ResponseComputerToolCallActionClickButtonForward ResponseComputerToolCallActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ResponseComputerToolCallActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ResponseComputerToolCallActionDrag struct{…}A drag action.
-
Path []ResponseComputerToolCallActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ResponseComputerToolCallActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ResponseComputerToolCallActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ResponseComputerToolCallActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ResponseComputerToolCallActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ResponseComputerToolCallActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ResponseComputerToolCallActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
Actions ComputerActionListFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
type ComputerActionClick struct{…}A click action.
-
Button stringIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
const ComputerActionClickButtonLeft ComputerActionClickButton = "left" -
const ComputerActionClickButtonRight ComputerActionClickButton = "right" -
const ComputerActionClickButtonWheel ComputerActionClickButton = "wheel" -
const ComputerActionClickButtonBack ComputerActionClickButton = "back" -
const ComputerActionClickButtonForward ComputerActionClickButton = "forward"
-
-
Type ClickSpecifies the event type. For a click action, this property is always
click.const ClickClick Click = "click"
-
X int64The x-coordinate where the click occurred.
-
Y int64The y-coordinate where the click occurred.
-
Keys []stringThe keys being held while clicking.
-
-
type ComputerActionDoubleClick struct{…}A double click action.
-
Keys []stringThe keys being held while double-clicking.
-
Type DoubleClickSpecifies the event type. For a double click action, this property is always set to
double_click.const DoubleClickDoubleClick DoubleClick = "double_click"
-
X int64The x-coordinate where the double click occurred.
-
Y int64The y-coordinate where the double click occurred.
-
-
type ComputerActionDrag struct{…}A drag action.
-
Path []ComputerActionDragPathAn array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
X int64The x-coordinate.
-
Y int64The y-coordinate.
-
-
Type DragSpecifies the event type. For a drag action, this property is always set to
drag.const DragDrag Drag = "drag"
-
Keys []stringThe keys being held while dragging the mouse.
-
-
type ComputerActionKeypress struct{…}A collection of keypresses the model would like to perform.
-
Keys []stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
Type KeypressSpecifies the event type. For a keypress action, this property is always set to
keypress.const KeypressKeypress Keypress = "keypress"
-
-
type ComputerActionMove struct{…}A mouse move action.
-
Type MoveSpecifies the event type. For a move action, this property is always set to
move.const MoveMove Move = "move"
-
X int64The x-coordinate to move to.
-
Y int64The y-coordinate to move to.
-
Keys []stringThe keys being held while moving the mouse.
-
-
type ComputerActionScreenshot struct{…}A screenshot action.
-
Type ScreenshotSpecifies the event type. For a screenshot action, this property is always set to
screenshot.const ScreenshotScreenshot Screenshot = "screenshot"
-
-
type ComputerActionScroll struct{…}A scroll action.
-
ScrollX int64The horizontal scroll distance.
-
ScrollY int64The vertical scroll distance.
-
Type ScrollSpecifies the event type. For a scroll action, this property is always set to
scroll.const ScrollScroll Scroll = "scroll"
-
X int64The x-coordinate where the scroll occurred.
-
Y int64The y-coordinate where the scroll occurred.
-
Keys []stringThe keys being held while scrolling.
-
-
type ComputerActionType struct{…}An action to type in text.
-
Text stringThe text to type.
-
Type TypeSpecifies the event type. For a type action, this property is always set to
type.const TypeType Type = "type"
-
-
type ComputerActionWait struct{…}A wait action.
-
Type WaitSpecifies the event type. For a wait action, this property is always set to
wait.const WaitWait Wait = "wait"
-
-
-
-
type ResponseInputItemComputerCallOutput struct{…}The output of a computer tool call.
-
CallID stringThe ID of the computer tool call that produced the output.
-
Output ResponseComputerToolCallOutputScreenshotA computer screenshot image used with the computer use tool.
-
Type ComputerScreenshotSpecifies the event type. For a computer screenshot, this property is always set to
computer_screenshot.const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"
-
FileID stringThe identifier of an uploaded file that contains the screenshot.
-
ImageURL stringThe URL of the screenshot image.
-
-
Type ComputerCallOutputThe type of the computer tool call output. Always
computer_call_output.const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
-
ID stringThe ID of the computer tool call output.
-
AcknowledgedSafetyChecks []ResponseInputItemComputerCallOutputAcknowledgedSafetyCheckThe safety checks reported by the API that have been acknowledged by the developer.
-
ID stringThe ID of the pending safety check.
-
Code stringThe type of the pending safety check.
-
Message stringDetails about the pending safety check.
-
-
Status stringThe status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
const ResponseInputItemComputerCallOutputStatusInProgress ResponseInputItemComputerCallOutputStatus = "in_progress" -
const ResponseInputItemComputerCallOutputStatusCompleted ResponseInputItemComputerCallOutputStatus = "completed" -
const ResponseInputItemComputerCallOutputStatusIncomplete ResponseInputItemComputerCallOutputStatus = "incomplete"
-
-
-
type ResponseFunctionWebSearch struct{…}The results of a web search tool call. See the web search guide for more information.
-
ID stringThe unique ID of the web search tool call.
-
Action ResponseFunctionWebSearchActionUnionAn object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
type ResponseFunctionWebSearchActionSearch struct{…}Action type "search" - Performs a web search query.
-
Type SearchThe action type.
const SearchSearch Search = "search"
-
Queries []stringThe search queries.
-
Query stringThe search query.
-
Sources []ResponseFunctionWebSearchActionSearchSourceThe sources used in the search.
-
Type URLThe type of source. Always
url.const URLURL URL = "url"
-
URL stringThe URL of the source.
-
-
-
type ResponseFunctionWebSearchActionOpenPage struct{…}Action type "open_page" - Opens a specific URL from search results.
-
Type OpenPageThe action type.
const OpenPageOpenPage OpenPage = "open_page"
-
URL stringThe URL opened by the model.
-
-
type ResponseFunctionWebSearchActionFindInPage struct{…}Action type "find_in_page": Searches for a pattern within a loaded page.
-
Pattern stringThe pattern or text to search for within the page.
-
Type FindInPageThe action type.
const FindInPageFindInPage FindInPage = "find_in_page"
-
URL stringThe URL of the page searched for the pattern.
-
-
-
Status ResponseFunctionWebSearchStatusThe status of the web search tool call.
-
const ResponseFunctionWebSearchStatusInProgress ResponseFunctionWebSearchStatus = "in_progress" -
const ResponseFunctionWebSearchStatusSearching ResponseFunctionWebSearchStatus = "searching" -
const ResponseFunctionWebSearchStatusCompleted ResponseFunctionWebSearchStatus = "completed" -
const ResponseFunctionWebSearchStatusFailed ResponseFunctionWebSearchStatus = "failed"
-
-
Type WebSearchCallThe type of the web search tool call. Always
web_search_call.const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"
-
-
type ResponseFunctionToolCall struct{…}A tool call to run a function. See the function calling guide for more information.
-
Arguments stringA JSON string of the arguments to pass to the function.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Name stringThe name of the function to run.
-
Type FunctionCallThe type of the function tool call. Always
function_call.const FunctionCallFunctionCall FunctionCall = "function_call"
-
ID stringThe unique ID of the function tool call.
-
Namespace stringThe namespace of the function to run.
-
Status ResponseFunctionToolCallStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseFunctionToolCallStatusInProgress ResponseFunctionToolCallStatus = "in_progress" -
const ResponseFunctionToolCallStatusCompleted ResponseFunctionToolCallStatus = "completed" -
const ResponseFunctionToolCallStatusIncomplete ResponseFunctionToolCallStatus = "incomplete"
-
-
-
type ResponseInputItemFunctionCallOutput struct{…}The output of a function tool call.
-
CallID stringThe unique ID of the function tool call generated by the model.
-
Output ResponseInputItemFunctionCallOutputOutputUnionText, image, or file output of the function tool call.
-
string -
type ResponseFunctionCallOutputItemList []ResponseFunctionCallOutputItemUnionAn array of content outputs (text, image, file) for the function tool call.
-
type ResponseInputTextContent struct{…}A text input to the model.
-
Text stringThe text input to the model.
-
Type InputTextThe type of the input item. Always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ResponseInputImageContent struct{…}An image input to the model. Learn about image inputs
-
Type InputImageThe type of the input item. Always
input_image.const InputImageInputImage InputImage = "input_image"
-
Detail ResponseInputImageContentDetailThe detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
const ResponseInputImageContentDetailLow ResponseInputImageContentDetail = "low" -
const ResponseInputImageContentDetailHigh ResponseInputImageContentDetail = "high" -
const ResponseInputImageContentDetailAuto ResponseInputImageContentDetail = "auto" -
const ResponseInputImageContentDetailOriginal ResponseInputImageContentDetail = "original"
-
-
FileID stringThe ID of the file to be sent to the model.
-
ImageURL stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
type ResponseInputFileContent struct{…}A file input to the model.
-
Type InputFileThe type of the input item. Always
input_file.const InputFileInputFile InputFile = "input_file"
-
Detail ResponseInputFileContentDetailThe detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
const ResponseInputFileContentDetailLow ResponseInputFileContentDetail = "low" -
const ResponseInputFileContentDetailHigh ResponseInputFileContentDetail = "high"
-
-
FileData stringThe base64-encoded data of the file to be sent to the model.
-
FileID stringThe ID of the file to be sent to the model.
-
FileURL stringThe URL of the file to be sent to the model.
-
Filename stringThe name of the file to be sent to the model.
-
-
-
-
Type FunctionCallOutputThe type of the function tool call output. Always
function_call_output.const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
-
ID stringThe unique ID of the function tool call output. Populated when this item is returned via API.
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseInputItemFunctionCallOutputStatusInProgress ResponseInputItemFunctionCallOutputStatus = "in_progress" -
const ResponseInputItemFunctionCallOutputStatusCompleted ResponseInputItemFunctionCallOutputStatus = "completed" -
const ResponseInputItemFunctionCallOutputStatusIncomplete ResponseInputItemFunctionCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemToolSearchCall struct{…}-
Arguments anyThe arguments supplied to the tool search call.
-
Type ToolSearchCallThe item type. Always
tool_search_call.const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
-
ID stringThe unique ID of this tool search call.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution stringWhether tool search was executed by the server or by the client.
-
const ResponseInputItemToolSearchCallExecutionServer ResponseInputItemToolSearchCallExecution = "server" -
const ResponseInputItemToolSearchCallExecutionClient ResponseInputItemToolSearchCallExecution = "client"
-
-
Status stringThe status of the tool search call.
-
const ResponseInputItemToolSearchCallStatusInProgress ResponseInputItemToolSearchCallStatus = "in_progress" -
const ResponseInputItemToolSearchCallStatusCompleted ResponseInputItemToolSearchCallStatus = "completed" -
const ResponseInputItemToolSearchCallStatusIncomplete ResponseInputItemToolSearchCallStatus = "incomplete"
-
-
-
type ResponseToolSearchOutputItemParamResp struct{…}-
Tools []ToolUnionThe loaded tool definitions returned by the tool search output.
-
type FunctionTool struct{…}Defines a function in your own code the model can choose to call. Learn more about function calling.
-
Name stringThe name of the function to call.
-
Parameters map[string, any]A JSON schema object describing the parameters of the function.
-
Strict boolWhether to enforce strict parameter validation. Default
true. -
Type FunctionThe type of the function tool. Always
function.const FunctionFunction Function = "function"
-
DeferLoading boolWhether this function is deferred and loaded via tool search.
-
Description stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
type FileSearchTool struct{…}A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
Type FileSearchThe type of the file search tool. Always
file_search.const FileSearchFileSearch FileSearch = "file_search"
-
VectorStoreIDs []stringThe IDs of the vector stores to search.
-
Filters FileSearchToolFiltersUnionA filter to apply.
-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
Key stringThe key to compare against the value.
-
Type ComparisonFilterTypeSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
const ComparisonFilterTypeEq ComparisonFilterType = "eq" -
const ComparisonFilterTypeNe ComparisonFilterType = "ne" -
const ComparisonFilterTypeGt ComparisonFilterType = "gt" -
const ComparisonFilterTypeGte ComparisonFilterType = "gte" -
const ComparisonFilterTypeLt ComparisonFilterType = "lt" -
const ComparisonFilterTypeLte ComparisonFilterType = "lte" -
const ComparisonFilterTypeIn ComparisonFilterType = "in" -
const ComparisonFilterTypeNin ComparisonFilterType = "nin"
-
-
Value ComparisonFilterValueUnionThe value to compare against the attribute key; supports string, number, or boolean types.
-
string -
float64 -
bool -
type ComparisonFilterValueArray []ComparisonFilterValueArrayItemUnion-
string -
float64
-
-
-
-
type CompoundFilter struct{…}Combine multiple filters using
andoror.-
Filters []ComparisonFilterArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
type ComparisonFilter struct{…}A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
-
Type CompoundFilterTypeType of operation:
andoror.-
const CompoundFilterTypeAnd CompoundFilterType = "and" -
const CompoundFilterTypeOr CompoundFilterType = "or"
-
-
-
-
MaxNumResults int64The maximum number of results to return. This number should be between 1 and 50 inclusive.
-
RankingOptions FileSearchToolRankingOptionsRanking options for search.
-
HybridSearch FileSearchToolRankingOptionsHybridSearchWeights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
EmbeddingWeight float64The weight of the embedding in the reciprocal ranking fusion.
-
TextWeight float64The weight of the text in the reciprocal ranking fusion.
-
-
Ranker stringThe ranker to use for the file search.
-
const FileSearchToolRankingOptionsRankerAuto FileSearchToolRankingOptionsRanker = "auto" -
const FileSearchToolRankingOptionsRankerDefault2024_11_15 FileSearchToolRankingOptionsRanker = "default-2024-11-15"
-
-
ScoreThreshold float64The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
Type ComputerThe type of the computer tool. Always
computer.const ComputerComputer Computer = "computer"
-
-
type ComputerUsePreviewTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
DisplayHeight int64The height of the computer display.
-
DisplayWidth int64The width of the computer display.
-
Environment ComputerUsePreviewToolEnvironmentThe type of computer environment to control.
-
const ComputerUsePreviewToolEnvironmentWindows ComputerUsePreviewToolEnvironment = "windows" -
const ComputerUsePreviewToolEnvironmentMac ComputerUsePreviewToolEnvironment = "mac" -
const ComputerUsePreviewToolEnvironmentLinux ComputerUsePreviewToolEnvironment = "linux" -
const ComputerUsePreviewToolEnvironmentUbuntu ComputerUsePreviewToolEnvironment = "ubuntu" -
const ComputerUsePreviewToolEnvironmentBrowser ComputerUsePreviewToolEnvironment = "browser"
-
-
Type ComputerUsePreviewThe type of the computer use tool. Always
computer_use_preview.const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"
-
-
type WebSearchTool struct{…}Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
Type WebSearchToolTypeThe type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
const WebSearchToolTypeWebSearch WebSearchToolType = "web_search" -
const WebSearchToolTypeWebSearch2025_08_26 WebSearchToolType = "web_search_2025_08_26"
-
-
Filters WebSearchToolFiltersFilters for the search.
-
AllowedDomains []stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
SearchContextSize WebSearchToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchToolSearchContextSizeLow WebSearchToolSearchContextSize = "low" -
const WebSearchToolSearchContextSizeMedium WebSearchToolSearchContextSize = "medium" -
const WebSearchToolSearchContextSizeHigh WebSearchToolSearchContextSize = "high"
-
-
UserLocation WebSearchToolUserLocationThe approximate location of the user.
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
Type stringThe type of location approximation. Always
approximate.const WebSearchToolUserLocationTypeApproximate WebSearchToolUserLocationType = "approximate"
-
-
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
ServerLabel stringA label for this MCP server, used to identify it in tool calls.
-
Type McpThe type of the MCP tool. Always
mcp.const McpMcp Mcp = "mcp"
-
AllowedTools ToolMcpAllowedToolsUnionList of allowed tool names or a filter object.
-
type ToolMcpAllowedToolsMcpAllowedTools []stringA string array of allowed tool names
-
type ToolMcpAllowedToolsMcpToolFilter struct{…}A filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
Authorization stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
ConnectorID stringIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
const ToolMcpConnectorIDConnectorDropbox ToolMcpConnectorID = "connector_dropbox" -
const ToolMcpConnectorIDConnectorGmail ToolMcpConnectorID = "connector_gmail" -
const ToolMcpConnectorIDConnectorGooglecalendar ToolMcpConnectorID = "connector_googlecalendar" -
const ToolMcpConnectorIDConnectorGoogledrive ToolMcpConnectorID = "connector_googledrive" -
const ToolMcpConnectorIDConnectorMicrosoftteams ToolMcpConnectorID = "connector_microsoftteams" -
const ToolMcpConnectorIDConnectorOutlookcalendar ToolMcpConnectorID = "connector_outlookcalendar" -
const ToolMcpConnectorIDConnectorOutlookemail ToolMcpConnectorID = "connector_outlookemail" -
const ToolMcpConnectorIDConnectorSharepoint ToolMcpConnectorID = "connector_sharepoint"
-
-
DeferLoading boolWhether this MCP tool is deferred and discovered via tool search.
-
Headers map[string, string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
RequireApproval ToolMcpRequireApprovalUnionSpecify which of the MCP server's tools require approval.
-
type ToolMcpRequireApprovalMcpToolApprovalFilter 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.-
Always ToolMcpRequireApprovalMcpToolApprovalFilterAlwaysA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
Never ToolMcpRequireApprovalMcpToolApprovalFilterNeverA filter object to specify which tools are allowed.
-
ReadOnly boolIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
ToolNames []stringList of allowed tool names.
-
-
-
type ToolMcpRequireApprovalMcpToolApprovalSetting stringSpecify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
const ToolMcpRequireApprovalMcpToolApprovalSettingAlways ToolMcpRequireApprovalMcpToolApprovalSetting = "always" -
const ToolMcpRequireApprovalMcpToolApprovalSettingNever ToolMcpRequireApprovalMcpToolApprovalSetting = "never"
-
-
-
ServerDescription stringOptional description of the MCP server, used to provide more context.
-
ServerURL stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
TunnelID stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
Container ToolCodeInterpreterContainerUnionThe code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
string -
type ToolCodeInterpreterContainerCodeInterpreterContainerAuto struct{…}Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
Type AutoAlways
auto.const AutoAuto Auto = "auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit stringThe memory limit for the code interpreter container.
-
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g" -
const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"
-
-
NetworkPolicy ToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…}-
Type DisabledDisable outbound network access. Always
disabled.const DisabledDisabled Disabled = "disabled"
-
-
type ContainerNetworkPolicyAllowlist struct{…}-
AllowedDomains []stringA list of allowed domains when type is
allowlist. -
Type AllowlistAllow outbound network access only to specified domains. Always
allowlist.const AllowlistAllowlist Allowlist = "allowlist"
-
DomainSecrets []ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
Domain stringThe domain associated with the secret.
-
Name stringThe name of the secret to inject for the domain.
-
Value stringThe secret value to inject for the domain.
-
-
-
-
-
-
Type CodeInterpreterThe type of the code interpreter tool. Always
code_interpreter.const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"
-
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
Type ImageGenerationThe type of the image generation tool. Always
image_generation.const ImageGenerationImageGeneration ImageGeneration = "image_generation"
-
Action stringWhether to generate a new image or edit an existing image. Default:
auto.-
const ToolImageGenerationActionGenerate ToolImageGenerationAction = "generate" -
const ToolImageGenerationActionEdit ToolImageGenerationAction = "edit" -
const ToolImageGenerationActionAuto ToolImageGenerationAction = "auto"
-
-
Background stringAllows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
const ToolImageGenerationBackgroundTransparent ToolImageGenerationBackground = "transparent" -
const ToolImageGenerationBackgroundOpaque ToolImageGenerationBackground = "opaque" -
const ToolImageGenerationBackgroundAuto ToolImageGenerationBackground = "auto"
-
-
InputFidelity stringControl how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
const ToolImageGenerationInputFidelityHigh ToolImageGenerationInputFidelity = "high" -
const ToolImageGenerationInputFidelityLow ToolImageGenerationInputFidelity = "low"
-
-
InputImageMask ToolImageGenerationInputImageMaskOptional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
FileID stringFile ID for the mask image.
-
ImageURL stringBase64-encoded mask image.
-
-
Model stringThe image generation model to use. Default:
gpt-image-1.-
string -
string-
const ToolImageGenerationModelGPTImage1 ToolImageGenerationModel = "gpt-image-1" -
const ToolImageGenerationModelGPTImage1Mini ToolImageGenerationModel = "gpt-image-1-mini" -
const ToolImageGenerationModelGPTImage2 ToolImageGenerationModel = "gpt-image-2" -
const ToolImageGenerationModelGPTImage2_2026_04_21 ToolImageGenerationModel = "gpt-image-2-2026-04-21" -
const ToolImageGenerationModelGPTImage1_5 ToolImageGenerationModel = "gpt-image-1.5" -
const ToolImageGenerationModelChatgptImageLatest ToolImageGenerationModel = "chatgpt-image-latest"
-
-
-
Moderation stringModeration level for the generated image. Default:
auto.-
const ToolImageGenerationModerationAuto ToolImageGenerationModeration = "auto" -
const ToolImageGenerationModerationLow ToolImageGenerationModeration = "low"
-
-
OutputCompression int64Compression level for the output image. Default: 100.
-
OutputFormat stringThe output format of the generated image. One of
png,webp, orjpeg. Default:png.-
const ToolImageGenerationOutputFormatPNG ToolImageGenerationOutputFormat = "png" -
const ToolImageGenerationOutputFormatWebP ToolImageGenerationOutputFormat = "webp" -
const ToolImageGenerationOutputFormatJPEG ToolImageGenerationOutputFormat = "jpeg"
-
-
PartialImages int64Number of partial images to generate in streaming mode, from 0 (default value) to 3.
-
Quality stringThe quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
const ToolImageGenerationQualityLow ToolImageGenerationQuality = "low" -
const ToolImageGenerationQualityMedium ToolImageGenerationQuality = "medium" -
const ToolImageGenerationQualityHigh ToolImageGenerationQuality = "high" -
const ToolImageGenerationQualityAuto ToolImageGenerationQuality = "auto"
-
-
Size stringThe size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
string -
string-
const ToolImageGenerationSize1024x1024 ToolImageGenerationSize = "1024x1024" -
const ToolImageGenerationSize1024x1536 ToolImageGenerationSize = "1024x1536" -
const ToolImageGenerationSize1536x1024 ToolImageGenerationSize = "1536x1024" -
const ToolImageGenerationSizeAuto ToolImageGenerationSize = "auto"
-
-
-
-
type ToolLocalShell struct{…}A tool that allows the model to execute shell commands in a local environment.
-
Type LocalShellThe type of the local shell tool. Always
local_shell.const LocalShellLocalShell LocalShell = "local_shell"
-
-
type FunctionShellTool struct{…}A tool that allows the model to execute shell commands.
-
Type ShellThe type of the shell tool. Always
shell.const ShellShell Shell = "shell"
-
Environment FunctionShellToolEnvironmentUnion-
type ContainerAuto struct{…}-
Type ContainerAutoAutomatically creates a container for this request
const ContainerAutoContainerAuto ContainerAuto = "container_auto"
-
FileIDs []stringAn optional list of uploaded files to make available to your code.
-
MemoryLimit ContainerAutoMemoryLimitThe memory limit for the container.
-
const ContainerAutoMemoryLimit1g ContainerAutoMemoryLimit = "1g" -
const ContainerAutoMemoryLimit4g ContainerAutoMemoryLimit = "4g" -
const ContainerAutoMemoryLimit16g ContainerAutoMemoryLimit = "16g" -
const ContainerAutoMemoryLimit64g ContainerAutoMemoryLimit = "64g"
-
-
NetworkPolicy ContainerAutoNetworkPolicyUnionNetwork access policy for the container.
-
type ContainerNetworkPolicyDisabled struct{…} -
type ContainerNetworkPolicyAllowlist struct{…}
-
-
Skills []ContainerAutoSkillUnionAn optional list of skills referenced by id or inline data.
-
type SkillReference struct{…}-
SkillID stringThe ID of the referenced skill.
-
Type SkillReferenceReferences a skill created with the /v1/skills endpoint.
const SkillReferenceSkillReference SkillReference = "skill_reference"
-
Version stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
type InlineSkill struct{…}-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Source InlineSkillSourceInline skill payload
-
Data stringBase64-encoded skill zip bundle.
-
MediaType ApplicationZipThe media type of the inline skill payload. Must be
application/zip.const ApplicationZipApplicationZip ApplicationZip = "application/zip"
-
Type Base64The type of the inline skill source. Must be
base64.const Base64Base64 Base64 = "base64"
-
-
Type InlineDefines an inline skill for this request.
const InlineInline Inline = "inline"
-
-
-
-
type LocalEnvironment struct{…}-
Type LocalUse a local computer environment.
const LocalLocal Local = "local"
-
Skills []LocalSkillAn optional list of skills.
-
Description stringThe description of the skill.
-
Name stringThe name of the skill.
-
Path stringThe path to the directory containing the skill.
-
-
-
type ContainerReference struct{…}-
ContainerID stringThe ID of the referenced container.
-
Type ContainerReferenceReferences a container created with the /v1/containers endpoint
const ContainerReferenceContainerReference ContainerReference = "container_reference"
-
-
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
Name stringThe name of the custom tool, used to identify it in tool calls.
-
Type CustomThe type of the custom tool. Always
custom.const CustomCustom Custom = "custom"
-
DeferLoading boolWhether this tool should be deferred and discovered via tool search.
-
Description stringOptional description of the custom tool, used to provide more context.
-
Format CustomToolInputFormatUnionThe input format for the custom tool. Default is unconstrained text.
-
type CustomToolInputFormatText struct{…}Unconstrained free-form text.
-
Type TextUnconstrained text format. Always
text.const TextText Text = "text"
-
-
type CustomToolInputFormatGrammar struct{…}A grammar defined by the user.
-
Definition stringThe grammar definition.
-
Syntax stringThe syntax of the grammar definition. One of
larkorregex.-
const CustomToolInputFormatGrammarSyntaxLark CustomToolInputFormatGrammarSyntax = "lark" -
const CustomToolInputFormatGrammarSyntaxRegex CustomToolInputFormatGrammarSyntax = "regex"
-
-
Type GrammarGrammar format. Always
grammar.const GrammarGrammar Grammar = "grammar"
-
-
-
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
Description stringA description of the namespace shown to the model.
-
Name stringThe namespace name used in tool calls (for example,
crm). -
Tools []NamespaceToolToolUnionThe function/custom tools available inside this namespace.
-
type NamespaceToolToolFunction struct{…}-
Name string -
Type Functionconst FunctionFunction Function = "function"
-
DeferLoading boolWhether this function should be deferred and discovered via tool search.
-
Description string -
Parameters any -
Strict bool
-
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
-
Type NamespaceThe type of the tool. Always
namespace.const NamespaceNamespace Namespace = "namespace"
-
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
Type ToolSearchThe type of the tool. Always
tool_search.const ToolSearchToolSearch ToolSearch = "tool_search"
-
Description stringDescription shown to the model for a client-executed tool search tool.
-
Execution ToolSearchToolExecutionWhether tool search is executed by the server or by the client.
-
const ToolSearchToolExecutionServer ToolSearchToolExecution = "server" -
const ToolSearchToolExecutionClient ToolSearchToolExecution = "client"
-
-
Parameters anyParameter schema for a client-executed tool search tool.
-
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
Type WebSearchPreviewToolTypeThe type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
const WebSearchPreviewToolTypeWebSearchPreview WebSearchPreviewToolType = "web_search_preview" -
const WebSearchPreviewToolTypeWebSearchPreview2025_03_11 WebSearchPreviewToolType = "web_search_preview_2025_03_11"
-
-
SearchContentTypes []string-
const WebSearchPreviewToolSearchContentTypeText WebSearchPreviewToolSearchContentType = "text" -
const WebSearchPreviewToolSearchContentTypeImage WebSearchPreviewToolSearchContentType = "image"
-
-
SearchContextSize WebSearchPreviewToolSearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
const WebSearchPreviewToolSearchContextSizeLow WebSearchPreviewToolSearchContextSize = "low" -
const WebSearchPreviewToolSearchContextSizeMedium WebSearchPreviewToolSearchContextSize = "medium" -
const WebSearchPreviewToolSearchContextSizeHigh WebSearchPreviewToolSearchContextSize = "high"
-
-
UserLocation WebSearchPreviewToolUserLocationThe user's location.
-
Type ApproximateThe type of location approximation. Always
approximate.const ApproximateApproximate Approximate = "approximate"
-
City stringFree text input for the city of the user, e.g.
San Francisco. -
Country stringThe two-letter ISO country code of the user, e.g.
US. -
Region stringFree text input for the region of the user, e.g.
California. -
Timezone stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
Type ApplyPatchThe type of the tool. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
-
Type ToolSearchOutputThe item type. Always
tool_search_output.const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
-
ID stringThe unique ID of this tool search output.
-
CallID stringThe unique ID of the tool search call generated by the model.
-
Execution ResponseToolSearchOutputItemParamExecutionWhether tool search was executed by the server or by the client.
-
const ResponseToolSearchOutputItemParamExecutionServer ResponseToolSearchOutputItemParamExecution = "server" -
const ResponseToolSearchOutputItemParamExecutionClient ResponseToolSearchOutputItemParamExecution = "client"
-
-
Status ResponseToolSearchOutputItemParamStatusThe status of the tool search output.
-
const ResponseToolSearchOutputItemParamStatusInProgress ResponseToolSearchOutputItemParamStatus = "in_progress" -
const ResponseToolSearchOutputItemParamStatusCompleted ResponseToolSearchOutputItemParamStatus = "completed" -
const ResponseToolSearchOutputItemParamStatusIncomplete ResponseToolSearchOutputItemParamStatus = "incomplete"
-
-
-
type ResponseInputItemAdditionalTools struct{…}-
Role DeveloperThe role that provided the additional tools. Only
developeris supported.const DeveloperDeveloper Developer = "developer"
-
Tools []ToolUnionA list of additional tools made available at this item.
-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Type AdditionalToolsThe item type. Always
additional_tools.const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"
-
ID stringThe unique ID of this additional tools item.
-
-
type ResponseReasoningItem 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
ID stringThe unique identifier of the reasoning content.
-
Summary []ResponseReasoningItemSummaryReasoning summary content.
-
Text stringA summary of the reasoning output from the model so far.
-
Type SummaryTextThe type of the object. Always
summary_text.const SummaryTextSummaryText SummaryText = "summary_text"
-
-
Type ReasoningThe type of the object. Always
reasoning.const ReasoningReasoning Reasoning = "reasoning"
-
Content []ResponseReasoningItemContentReasoning text content.
-
Text stringThe reasoning text from the model.
-
Type ReasoningTextThe type of the reasoning text. Always
reasoning_text.const ReasoningTextReasoningText ReasoningText = "reasoning_text"
-
-
EncryptedContent stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
Status ResponseReasoningItemStatusThe status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
const ResponseReasoningItemStatusInProgress ResponseReasoningItemStatus = "in_progress" -
const ResponseReasoningItemStatusCompleted ResponseReasoningItemStatus = "completed" -
const ResponseReasoningItemStatusIncomplete ResponseReasoningItemStatus = "incomplete"
-
-
-
type ResponseCompactionItemParamResp struct{…}A compaction item generated by the
v1/responses/compactAPI.-
EncryptedContent stringThe encrypted content of the compaction summary.
-
Type CompactionThe type of the item. Always
compaction.const CompactionCompaction Compaction = "compaction"
-
ID stringThe ID of the compaction item.
-
-
type ResponseInputItemImageGenerationCall struct{…}An image generation request made by the model.
-
ID stringThe unique ID of the image generation call.
-
Result stringThe generated image encoded in base64.
-
Status stringThe status of the image generation call.
-
const ResponseInputItemImageGenerationCallStatusInProgress ResponseInputItemImageGenerationCallStatus = "in_progress" -
const ResponseInputItemImageGenerationCallStatusCompleted ResponseInputItemImageGenerationCallStatus = "completed" -
const ResponseInputItemImageGenerationCallStatusGenerating ResponseInputItemImageGenerationCallStatus = "generating" -
const ResponseInputItemImageGenerationCallStatusFailed ResponseInputItemImageGenerationCallStatus = "failed"
-
-
Type ImageGenerationCallThe type of the image generation call. Always
image_generation_call.const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"
-
-
type ResponseCodeInterpreterToolCall struct{…}A tool call to run code.
-
ID stringThe unique ID of the code interpreter tool call.
-
Code stringThe code to run, or null if not available.
-
ContainerID stringThe ID of the container used to run the code.
-
Outputs []ResponseCodeInterpreterToolCallOutputUnionThe outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
type ResponseCodeInterpreterToolCallOutputLogs struct{…}The logs output from the code interpreter.
-
Logs stringThe logs output from the code interpreter.
-
Type LogsThe type of the output. Always
logs.const LogsLogs Logs = "logs"
-
-
type ResponseCodeInterpreterToolCallOutputImage struct{…}The image output from the code interpreter.
-
Type ImageThe type of the output. Always
image.const ImageImage Image = "image"
-
URL stringThe URL of the image output from the code interpreter.
-
-
-
Status ResponseCodeInterpreterToolCallStatusThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
const ResponseCodeInterpreterToolCallStatusInProgress ResponseCodeInterpreterToolCallStatus = "in_progress" -
const ResponseCodeInterpreterToolCallStatusCompleted ResponseCodeInterpreterToolCallStatus = "completed" -
const ResponseCodeInterpreterToolCallStatusIncomplete ResponseCodeInterpreterToolCallStatus = "incomplete" -
const ResponseCodeInterpreterToolCallStatusInterpreting ResponseCodeInterpreterToolCallStatus = "interpreting" -
const ResponseCodeInterpreterToolCallStatusFailed ResponseCodeInterpreterToolCallStatus = "failed"
-
-
Type CodeInterpreterCallThe type of the code interpreter tool call. Always
code_interpreter_call.const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"
-
-
type ResponseInputItemLocalShellCall struct{…}A tool call to run a command on the local shell.
-
ID stringThe unique ID of the local shell call.
-
Action ResponseInputItemLocalShellCallActionExecute a shell command on the server.
-
Command []stringThe command to run.
-
Env map[string, string]Environment variables to set for the command.
-
Type ExecThe type of the local shell action. Always
exec.const ExecExec Exec = "exec"
-
TimeoutMs int64Optional timeout in milliseconds for the command.
-
User stringOptional user to run the command as.
-
WorkingDirectory stringOptional working directory to run the command in.
-
-
CallID stringThe unique ID of the local shell tool call generated by the model.
-
Status stringThe status of the local shell call.
-
const ResponseInputItemLocalShellCallStatusInProgress ResponseInputItemLocalShellCallStatus = "in_progress" -
const ResponseInputItemLocalShellCallStatusCompleted ResponseInputItemLocalShellCallStatus = "completed" -
const ResponseInputItemLocalShellCallStatusIncomplete ResponseInputItemLocalShellCallStatus = "incomplete"
-
-
Type LocalShellCallThe type of the local shell call. Always
local_shell_call.const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"
-
-
type ResponseInputItemLocalShellCallOutput struct{…}The output of a local shell tool call.
-
ID stringThe unique ID of the local shell tool call generated by the model.
-
Output stringA JSON string of the output of the local shell tool call.
-
Type LocalShellCallOutputThe type of the local shell tool call output. Always
local_shell_call_output.const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
-
Status stringThe status of the item. One of
in_progress,completed, orincomplete.-
const ResponseInputItemLocalShellCallOutputStatusInProgress ResponseInputItemLocalShellCallOutputStatus = "in_progress" -
const ResponseInputItemLocalShellCallOutputStatusCompleted ResponseInputItemLocalShellCallOutputStatus = "completed" -
const ResponseInputItemLocalShellCallOutputStatusIncomplete ResponseInputItemLocalShellCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemShellCall struct{…}A tool representing a request to execute one or more shell commands.
-
Action ResponseInputItemShellCallActionThe shell commands and limits that describe how to run the tool call.
-
Commands []stringOrdered shell commands for the execution environment to run.
-
MaxOutputLength int64Maximum number of UTF-8 characters to capture from combined stdout and stderr output.
-
TimeoutMs int64Maximum wall-clock time in milliseconds to allow the shell commands to run.
-
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Type ShellCallThe type of the item. Always
shell_call.const ShellCallShellCall ShellCall = "shell_call"
-
ID stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
Environment ResponseInputItemShellCallEnvironmentUnionThe environment to execute the shell commands in.
-
type LocalEnvironment struct{…} -
type ContainerReference struct{…}
-
-
Status stringThe status of the shell call. One of
in_progress,completed, orincomplete.-
const ResponseInputItemShellCallStatusInProgress ResponseInputItemShellCallStatus = "in_progress" -
const ResponseInputItemShellCallStatusCompleted ResponseInputItemShellCallStatus = "completed" -
const ResponseInputItemShellCallStatusIncomplete ResponseInputItemShellCallStatus = "incomplete"
-
-
-
type ResponseInputItemShellCallOutput struct{…}The streamed output items emitted by a shell tool call.
-
CallID stringThe unique ID of the shell tool call generated by the model.
-
Output []ResponseFunctionShellCallOutputContentCaptured chunks of stdout and stderr output, along with their associated outcomes.
-
Outcome ResponseFunctionShellCallOutputContentOutcomeUnionThe exit or timeout outcome associated with this shell call.
-
type ResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}Indicates that the shell call exceeded its configured time limit.
-
Type TimeoutThe outcome type. Always
timeout.const TimeoutTimeout Timeout = "timeout"
-
-
type ResponseFunctionShellCallOutputContentOutcomeExit struct{…}Indicates that the shell commands finished and returned an exit code.
-
ExitCode int64The exit code returned by the shell process.
-
Type ExitThe outcome type. Always
exit.const ExitExit Exit = "exit"
-
-
-
Stderr stringCaptured stderr output for the shell call.
-
Stdout stringCaptured stdout output for the shell call.
-
-
Type ShellCallOutputThe type of the item. Always
shell_call_output.const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
-
ID stringThe unique ID of the shell tool call output. Populated when this item is returned via API.
-
MaxOutputLength int64The maximum number of UTF-8 characters captured for this shell call's combined output.
-
Status stringThe status of the shell call output.
-
const ResponseInputItemShellCallOutputStatusInProgress ResponseInputItemShellCallOutputStatus = "in_progress" -
const ResponseInputItemShellCallOutputStatusCompleted ResponseInputItemShellCallOutputStatus = "completed" -
const ResponseInputItemShellCallOutputStatusIncomplete ResponseInputItemShellCallOutputStatus = "incomplete"
-
-
-
type ResponseInputItemApplyPatchCall struct{…}A tool call representing a request to create, delete, or update files using diff patches.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Operation ResponseInputItemApplyPatchCallOperationUnionThe specific create, delete, or update instruction for the apply_patch tool call.
-
type ResponseInputItemApplyPatchCallOperationCreateFile struct{…}Instruction for creating a new file via the apply_patch tool.
-
Diff stringUnified diff content to apply when creating the file.
-
Path stringPath of the file to create relative to the workspace root.
-
Type CreateFileThe operation type. Always
create_file.const CreateFileCreateFile CreateFile = "create_file"
-
-
type ResponseInputItemApplyPatchCallOperationDeleteFile struct{…}Instruction for deleting an existing file via the apply_patch tool.
-
Path stringPath of the file to delete relative to the workspace root.
-
Type DeleteFileThe operation type. Always
delete_file.const DeleteFileDeleteFile DeleteFile = "delete_file"
-
-
type ResponseInputItemApplyPatchCallOperationUpdateFile struct{…}Instruction for updating an existing file via the apply_patch tool.
-
Diff stringUnified diff content to apply to the existing file.
-
Path stringPath of the file to update relative to the workspace root.
-
Type UpdateFileThe operation type. Always
update_file.const UpdateFileUpdateFile UpdateFile = "update_file"
-
-
-
Status stringThe status of the apply patch tool call. One of
in_progressorcompleted.-
const ResponseInputItemApplyPatchCallStatusInProgress ResponseInputItemApplyPatchCallStatus = "in_progress" -
const ResponseInputItemApplyPatchCallStatusCompleted ResponseInputItemApplyPatchCallStatus = "completed"
-
-
Type ApplyPatchCallThe type of the item. Always
apply_patch_call.const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
-
ID stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
-
type ResponseInputItemApplyPatchCallOutput struct{…}The streamed output emitted by an apply patch tool call.
-
CallID stringThe unique ID of the apply patch tool call generated by the model.
-
Status stringThe status of the apply patch tool call output. One of
completedorfailed.-
const ResponseInputItemApplyPatchCallOutputStatusCompleted ResponseInputItemApplyPatchCallOutputStatus = "completed" -
const ResponseInputItemApplyPatchCallOutputStatusFailed ResponseInputItemApplyPatchCallOutputStatus = "failed"
-
-
Type ApplyPatchCallOutputThe type of the item. Always
apply_patch_call_output.const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
-
ID stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
Output stringOptional human-readable log text from the apply patch tool (e.g., patch results or errors).
-
-
type ResponseInputItemMcpListTools struct{…}A list of tools available on an MCP server.
-
ID stringThe unique ID of the list.
-
ServerLabel stringThe label of the MCP server.
-
Tools []ResponseInputItemMcpListToolsToolThe tools available on the server.
-
InputSchema anyThe JSON schema describing the tool's input.
-
Name stringThe name of the tool.
-
Annotations anyAdditional annotations about the tool.
-
Description stringThe description of the tool.
-
-
Type McpListToolsThe type of the item. Always
mcp_list_tools.const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
-
Error stringError message if the server could not list tools.
-
-
type ResponseInputItemMcpApprovalRequest struct{…}A request for human approval of a tool invocation.
-
ID stringThe unique ID of the approval request.
-
Arguments stringA JSON string of arguments for the tool.
-
Name stringThe name of the tool to run.
-
ServerLabel stringThe label of the MCP server making the request.
-
Type McpApprovalRequestThe type of the item. Always
mcp_approval_request.const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"
-
-
type ResponseInputItemMcpApprovalResponse struct{…}A response to an MCP approval request.
-
ApprovalRequestID stringThe ID of the approval request being answered.
-
Approve boolWhether the request was approved.
-
Type McpApprovalResponseThe type of the item. Always
mcp_approval_response.const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
-
ID stringThe unique ID of the approval response
-
Reason stringOptional reason for the decision.
-
-
type ResponseInputItemMcpCall struct{…}An invocation of a tool on an MCP server.
-
ID stringThe unique ID of the tool call.
-
Arguments stringA JSON string of the arguments passed to the tool.
-
Name stringThe name of the tool that was run.
-
ServerLabel stringThe label of the MCP server running the tool.
-
Type McpCallThe type of the item. Always
mcp_call.const McpCallMcpCall McpCall = "mcp_call"
-
ApprovalRequestID stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
Error stringThe error from the tool call, if any.
-
Output stringThe output from the tool call.
-
Status stringThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
const ResponseInputItemMcpCallStatusInProgress ResponseInputItemMcpCallStatus = "in_progress" -
const ResponseInputItemMcpCallStatusCompleted ResponseInputItemMcpCallStatus = "completed" -
const ResponseInputItemMcpCallStatusIncomplete ResponseInputItemMcpCallStatus = "incomplete" -
const ResponseInputItemMcpCallStatusCalling ResponseInputItemMcpCallStatus = "calling" -
const ResponseInputItemMcpCallStatusFailed ResponseInputItemMcpCallStatus = "failed"
-
-
-
type ResponseCustomToolCallOutput struct{…}The output of a custom tool call from your code, being sent back to the model.
-
CallID stringThe call ID, used to map this custom tool call output to a custom tool call.
-
Output ResponseCustomToolCallOutputOutputUnionThe output from the custom tool call generated by your code. Can be a string or an list of output content.
-
string -
type ResponseCustomToolCallOutputOutputOutputContentList []ResponseCustomToolCallOutputOutputOutputContentListItemUnionText, image, or file output of the custom tool call.
-
type ResponseInputText struct{…}A text input to the model.
-
type ResponseInputImage struct{…}An image input to the model. Learn about image inputs.
-
type ResponseInputFile struct{…}A file input to the model.
-
-
-
Type CustomToolCallOutputThe type of the custom tool call output. Always
custom_tool_call_output.const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"
-
ID stringThe unique ID of the custom tool call output in the OpenAI platform.
-
-
type ResponseCustomToolCall struct{…}A call to a custom tool created by the model.
-
CallID stringAn identifier used to map this custom tool call to a tool call output.
-
Input stringThe input for the custom tool call generated by the model.
-
Name stringThe name of the custom tool being called.
-
Type CustomToolCallThe type of the custom tool call. Always
custom_tool_call.const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"
-
ID stringThe unique ID of the custom tool call in the OpenAI platform.
-
Namespace stringThe namespace of the custom tool being called.
-
-
type ResponseInputItemCompactionTrigger struct{…}Compacts the current context. Must be the final input item.
-
Type CompactionTriggerThe type of the item. Always
compaction_trigger.const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"
-
-
type ResponseInputItemItemReference struct{…}An internal identifier for an item to reference.
-
ID stringThe ID of the item to reference.
-
Type stringThe type of item to reference. Always
item_reference.const ResponseInputItemItemReferenceTypeItemReference ResponseInputItemItemReferenceType = "item_reference"
-
-
-
-
Instructions param.Field[string]A system (or developer) message inserted into the model's context. When used along with
previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses. -
Model param.Field[string]Model ID used to generate the response, like
gpt-4ooro3. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. -
ParallelToolCalls param.Field[bool]Whether to allow the model to run tool calls in parallel.
-
Personality param.Field[InputTokenCountParamsPersonality]A model-owned style preset to apply to this request. Omit this parameter to use the model's default style. Supported values may expand over time. Values must be at most 64 characters.
-
string -
type InputTokenCountParamsPersonality stringA model-owned style preset to apply to this request. Omit this parameter to use the model's default style. Supported values may expand over time. Values must be at most 64 characters.
-
const InputTokenCountParamsPersonalityFriendly InputTokenCountParamsPersonality = "friendly" -
const InputTokenCountParamsPersonalityPragmatic InputTokenCountParamsPersonality = "pragmatic"
-
-
-
PreviousResponseID param.Field[string]The unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about conversation state. Cannot be used in conjunction with
conversation. -
Reasoning param.Field[Reasoning]gpt-5 and o-series models only Configuration options for reasoning models.
-
Text param.Field[InputTokenCountParamsText]Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
Format ResponseFormatTextConfigUnionAn object specifying the format that the model must output.
Configuring
{ "type": "json_schema" }enables Structured Outputs, which ensures the model will match your supplied JSON schema. Learn more in the Structured Outputs guide.The default format is
{ "type": "text" }with no additional options.Not recommended for gpt-4o and newer models:
Setting to
{ "type": "json_object" }enables the older JSON mode, which ensures the message the model generates is valid JSON. Usingjson_schemais preferred for models that support it.-
type ResponseFormatText struct{…}Default response format. Used to generate text responses.
-
Type TextThe type of response format being defined. Always
text.const TextText Text = "text"
-
-
type ResponseFormatTextJSONSchemaConfig struct{…}JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
Name stringThe name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
-
Schema map[string, any]The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
-
Type JSONSchemaThe type of response format being defined. Always
json_schema.const JSONSchemaJSONSchema JSONSchema = "json_schema"
-
Description stringA description of what the response format is for, used by the model to determine how to respond in the format.
-
Strict boolWhether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the
schemafield. Only a subset of JSON Schema is supported whenstrictistrue. To learn more, read the Structured Outputs guide.
-
-
type ResponseFormatJSONObject struct{…}JSON object response format. An older method of generating JSON responses. Using
json_schemais 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 JSONObjectThe type of response format being defined. Always
json_object.const JSONObjectJSONObject JSONObject = "json_object"
-
-
-
Verbosity stringConstrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses. Currently supported values are
low,medium, andhigh.-
const InputTokenCountParamsTextVerbosityLow InputTokenCountParamsTextVerbosity = "low" -
const InputTokenCountParamsTextVerbosityMedium InputTokenCountParamsTextVerbosity = "medium" -
const InputTokenCountParamsTextVerbosityHigh InputTokenCountParamsTextVerbosity = "high"
-
-
ToolChoice param.Field[InputTokenCountParamsToolChoiceUnion]Controls which tool the model should use, if any.
-
type ToolChoiceOptions stringControls which (if any) tool is called by the model.
nonemeans the model will not call any tool and instead generates a message.automeans the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools.-
const ToolChoiceOptionsNone ToolChoiceOptions = "none" -
const ToolChoiceOptionsAuto ToolChoiceOptions = "auto" -
const ToolChoiceOptionsRequired ToolChoiceOptions = "required"
-
-
type ToolChoiceAllowed struct{…}Constrains the tools available to the model to a pre-defined set.
-
Mode ToolChoiceAllowedModeConstrains the tools available to the model to a pre-defined set.
autoallows the model to pick from among the allowed tools and generate a message.requiredrequires the model to call one or more of the allowed tools.-
const ToolChoiceAllowedModeAuto ToolChoiceAllowedMode = "auto" -
const ToolChoiceAllowedModeRequired ToolChoiceAllowedMode = "required"
-
-
Tools []map[string, any]A list of tool definitions that the model should be allowed to call.
For the Responses API, the list of tool definitions might look like:
[ { "type": "function", "name": "get_weather" }, { "type": "mcp", "server_label": "deepwiki" }, { "type": "image_generation" } ] -
Type AllowedToolsAllowed tool configuration type. Always
allowed_tools.const AllowedToolsAllowedTools AllowedTools = "allowed_tools"
-
-
type ToolChoiceTypes struct{…}Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
-
Type ToolChoiceTypesTypeThe type of hosted tool the model should to use. Learn more about built-in tools.
Allowed values are:
-
file_search -
web_search_preview -
computer -
computer_use_preview -
computer_use -
code_interpreter -
image_generation -
const ToolChoiceTypesTypeFileSearch ToolChoiceTypesType = "file_search" -
const ToolChoiceTypesTypeWebSearchPreview ToolChoiceTypesType = "web_search_preview" -
const ToolChoiceTypesTypeComputer ToolChoiceTypesType = "computer" -
const ToolChoiceTypesTypeComputerUsePreview ToolChoiceTypesType = "computer_use_preview" -
const ToolChoiceTypesTypeComputerUse ToolChoiceTypesType = "computer_use" -
const ToolChoiceTypesTypeWebSearchPreview2025_03_11 ToolChoiceTypesType = "web_search_preview_2025_03_11" -
const ToolChoiceTypesTypeImageGeneration ToolChoiceTypesType = "image_generation" -
const ToolChoiceTypesTypeCodeInterpreter ToolChoiceTypesType = "code_interpreter"
-
-
-
type ToolChoiceFunction struct{…}Use this option to force the model to call a specific function.
-
Name stringThe name of the function to call.
-
Type FunctionFor function calling, the type is always
function.const FunctionFunction Function = "function"
-
-
type ToolChoiceMcp struct{…}Use this option to force the model to call a specific tool on a remote MCP server.
-
ServerLabel stringThe label of the MCP server to use.
-
Type McpFor MCP tools, the type is always
mcp.const McpMcp Mcp = "mcp"
-
Name stringThe name of the tool to call on the server.
-
-
type ToolChoiceCustom struct{…}Use this option to force the model to call a specific custom tool.
-
Name stringThe name of the custom tool to call.
-
Type CustomFor custom tool calling, the type is always
custom.const CustomCustom Custom = "custom"
-
-
type ToolChoiceApplyPatch struct{…}Forces the model to call the apply_patch tool when executing a tool call.
-
Type ApplyPatchThe tool to call. Always
apply_patch.const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
-
-
type ToolChoiceShell struct{…}Forces the model to call the shell tool when a tool call is required.
-
Type ShellThe tool to call. Always
shell.const ShellShell Shell = "shell"
-
-
-
Tools param.Field[[]ToolUnion]An array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.-
type FunctionTool struct{…}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.
-
type ComputerTool struct{…}A tool that controls a virtual computer. Learn more about the computer tool.
-
type ComputerUsePreviewTool struct{…}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.
-
type ToolMcp struct{…}Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
type ToolCodeInterpreter struct{…}A tool that runs Python code to help generate a response to a prompt.
-
type ToolImageGeneration struct{…}A tool that generates images using the GPT image models.
-
type ToolLocalShell struct{…}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.
-
type CustomTool struct{…}A custom tool that processes input using a specified format. Learn more about custom tools
-
type NamespaceTool struct{…}Groups function/custom tools under a shared namespace.
-
type ToolSearchTool struct{…}Hosted or BYOT tool search configuration for deferred tools.
-
type WebSearchPreviewTool struct{…}This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
type ApplyPatchTool struct{…}Allows the assistant to create, delete, or update files using unified diffs.
-
-
Truncation param.Field[InputTokenCountParamsTruncation]The truncation strategy to use for the model response. -
auto: If the input to this Response exceeds the model's context window size, the model will truncate the response to fit the context window by dropping items from the beginning of the conversation. -disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error.-
const InputTokenCountParamsTruncationAuto InputTokenCountParamsTruncation = "auto" -
const InputTokenCountParamsTruncationDisabled InputTokenCountParamsTruncation = "disabled"
-
-
Returns
-
type InputTokenCountResponse struct{…}-
InputTokens int64 -
Object ResponseInputTokensconst ResponseInputTokensResponseInputTokens ResponseInputTokens = "response.input_tokens"
-
Example
package main
import (
"context"
"fmt"
"github.com/openai/openai-go"
"github.com/openai/openai-go/option"
"github.com/openai/openai-go/responses"
)
func main() {
client := openai.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.Responses.InputTokens.Count(context.TODO(), responses.InputTokenCountParams{
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.InputTokens)
}
Response
{
"input_tokens": 123,
"object": "response.input_tokens"
}
Example
package main
import (
"context"
"fmt"
"github.com/openai/openai-go"
"github.com/openai/openai-go/responses"
)
func main() {
client := openai.NewClient()
response, err := client.Responses.InputTokens.Count(context.TODO(), responses.InputTokenCountParams{
Model: "gpt-5",
Input: "Tell me a joke.",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.InputTokens)
}
Response
{
"object": "response.input_tokens",
"input_tokens": 11
}