SpyBara
Go Premium

go/resources/responses/subresources/input_items/index.md 2026-06-16 21:57 UTC to 2026-06-17 18:02 UTC

18 added, 8 removed.

2026
Fri 26 17:57 Thu 25 20:59 Wed 24 22:02 Tue 23 22:00 Wed 17 18:02 Tue 16 21:57 Fri 12 00:01 Wed 10 15:48 Tue 9 06:34 Fri 5 06:45 Thu 4 06:52 Tue 2 06:51

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 include parameter 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 string

        The unique ID of the message input.

      • Content ResponseInputMessageContentList

        A list of one or many input items to the model, containing different content types.

        • type ResponseInputText struct{…}

          A text input to the model.

          • Text string

            The text input to the model.

          • Type InputText

            The 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 ResponseInputImageDetail

            The detail level of the image to be sent to the model. One of high, low, auto, or original. Defaults to auto.

            • const ResponseInputImageDetailLow ResponseInputImageDetail = "low"

            • const ResponseInputImageDetailHigh ResponseInputImageDetail = "high"

            • const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto"

            • const ResponseInputImageDetailOriginal ResponseInputImageDetail = "original"

          • Type InputImage

            The type of the input item. Always input_image.

            • const InputImageInputImage InputImage = "input_image"
          • FileID string

            The ID of the file to be sent to the model.

          • ImageURL string

            The 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 InputFile

            The type of the input item. Always input_file.

            • const InputFileInputFile InputFile = "input_file"
          • Detail ResponseInputFileDetail

            The detail level of the file to be sent to the model. Use low for the default rendering behavior, or high to render the file at higher quality. Defaults to low.

            • const ResponseInputFileDetailLow ResponseInputFileDetail = "low"

            • const ResponseInputFileDetailHigh ResponseInputFileDetail = "high"

          • FileData string

            The content of the file to be sent to the model.

          • FileID string

            The ID of the file to be sent to the model.

          • FileURL string

            The URL of the file to be sent to the model.

          • Filename string

            The name of the file to be sent to the model.

      • Role ResponseInputMessageItemRole

        The role of the message input. One of user, system, or developer.

        • const ResponseInputMessageItemRoleUser ResponseInputMessageItemRole = "user"

        • const ResponseInputMessageItemRoleSystem ResponseInputMessageItemRole = "system"

        • const ResponseInputMessageItemRoleDeveloper ResponseInputMessageItemRole = "developer"

      • Type Message

        The type of the message input. Always set to message.

        • const MessageMessage Message = "message"
      • Status ResponseInputMessageItemStatus

        The status of item. One of in_progress, completed, or incomplete. 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 string

        The unique ID of the output message.

      • Content []ResponseOutputMessageContentUnion

        The content of the output message.

        • type ResponseOutputText struct{…}

          A text output from the model.

          • Annotations []ResponseOutputTextAnnotationUnion

            The annotations of the text output.

            • type ResponseOutputTextAnnotationFileCitation struct{…}

              A citation to a file.

              • FileID string

                The ID of the file.

              • Filename string

                The filename of the file cited.

              • Index int64

                The index of the file in the list of files.

              • Type FileCitation

                The 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 int64

                The index of the last character of the URL citation in the message.

              • StartIndex int64

                The index of the first character of the URL citation in the message.

              • Title string

                The title of the web resource.

              • Type URLCitation

                The type of the URL citation. Always url_citation.

                • const URLCitationURLCitation URLCitation = "url_citation"
              • URL string

                The URL of the web resource.

            • type ResponseOutputTextAnnotationContainerFileCitation struct{…}

              A citation for a container file used to generate a model response.

              • ContainerID string

                The ID of the container file.

              • EndIndex int64

                The index of the last character of the container file citation in the message.

              • FileID string

                The ID of the file.

              • Filename string

                The filename of the container file cited.

              • StartIndex int64

                The index of the first character of the container file citation in the message.

              • Type ContainerFileCitation

                The 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 string

                The ID of the file.

              • Index int64

                The index of the file in the list of files.

              • Type FilePath

                The type of the file path. Always file_path.

                • const FilePathFilePath FilePath = "file_path"
          • Text string

            The text output from the model.

          • Type OutputText

            The 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 string

            The refusal explanation from the model.

          • Type Refusal

            The type of the refusal. Always refusal.

            • const RefusalRefusal Refusal = "refusal"
      • Role Assistant

        The role of the output message. Always assistant.

        • const AssistantAssistant Assistant = "assistant"
      • Status ResponseOutputMessageStatus

        The status of the message input. One of in_progress, completed, or incomplete. Populated when input items are returned via API.

        • const ResponseOutputMessageStatusInProgress ResponseOutputMessageStatus = "in_progress"

        • const ResponseOutputMessageStatusCompleted ResponseOutputMessageStatus = "completed"

        • const ResponseOutputMessageStatusIncomplete ResponseOutputMessageStatus = "incomplete"

      • Type Message

        The type of the output message. Always message.

        • const MessageMessage Message = "message"
      • Phase ResponseOutputMessagePhase

        Labels an assistant message as intermediate commentary (commentary) or the final answer (final_answer). For models like gpt-5.3-codex and 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 string

        The unique ID of the file search tool call.

      • Queries []string

        The queries used to search for files.

      • Status ResponseFileSearchToolCallStatus

        The status of the file search tool call. One of in_progress, searching, incomplete or failed,

        • const ResponseFileSearchToolCallStatusInProgress ResponseFileSearchToolCallStatus = "in_progress"

        • const ResponseFileSearchToolCallStatusSearching ResponseFileSearchToolCallStatus = "searching"

        • const ResponseFileSearchToolCallStatusCompleted ResponseFileSearchToolCallStatus = "completed"

        • const ResponseFileSearchToolCallStatusIncomplete ResponseFileSearchToolCallStatus = "incomplete"

        • const ResponseFileSearchToolCallStatusFailed ResponseFileSearchToolCallStatus = "failed"

      • Type FileSearchCall

        The type of the file search tool call. Always file_search_call.

        • const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"
      • Results []ResponseFileSearchToolCallResult

        The 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 string

          The unique ID of the file.

        • Filename string

          The name of the file.

        • Score float64

          The relevance score of the file - a value between 0 and 1.

        • Text string

          The 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 string

        The unique ID of the computer call.

      • CallID string

        An identifier used when responding to the tool call with output.

      • PendingSafetyChecks []ResponseComputerToolCallPendingSafetyCheck

        The pending safety checks for the computer call.

        • ID string

          The ID of the pending safety check.

        • Code string

          The type of the pending safety check.

        • Message string

          Details about the pending safety check.

      • Status ResponseComputerToolCallStatus

        The status of the item. One of in_progress, completed, or incomplete. Populated when items are returned via API.

        • const ResponseComputerToolCallStatusInProgress ResponseComputerToolCallStatus = "in_progress"

        • const ResponseComputerToolCallStatusCompleted ResponseComputerToolCallStatus = "completed"

        • const ResponseComputerToolCallStatusIncomplete ResponseComputerToolCallStatus = "incomplete"

      • Type ResponseComputerToolCallType

        The type of the computer call. Always computer_call.

        • const ResponseComputerToolCallTypeComputerCall ResponseComputerToolCallType = "computer_call"
      • Action ResponseComputerToolCallActionUnion

        A click action.

        • type ResponseComputerToolCallActionClick struct{…}

          A click action.

          • Button string

            Indicates which mouse button was pressed during the click. One of left, right, wheel, back, or forward.

            • const ResponseComputerToolCallActionClickButtonLeft ResponseComputerToolCallActionClickButton = "left"

            • const ResponseComputerToolCallActionClickButtonRight ResponseComputerToolCallActionClickButton = "right"

            • const ResponseComputerToolCallActionClickButtonWheel ResponseComputerToolCallActionClickButton = "wheel"

            • const ResponseComputerToolCallActionClickButtonBack ResponseComputerToolCallActionClickButton = "back"

            • const ResponseComputerToolCallActionClickButtonForward ResponseComputerToolCallActionClickButton = "forward"

          • Type Click

            Specifies the event type. For a click action, this property is always click.

            • const ClickClick Click = "click"
          • X int64

            The x-coordinate where the click occurred.

          • Y int64

            The y-coordinate where the click occurred.

          • Keys []string

            The keys being held while clicking.

        • type ResponseComputerToolCallActionDoubleClick struct{…}

          A double click action.

          • Keys []string

            The keys being held while double-clicking.

          • Type DoubleClick

            Specifies the event type. For a double click action, this property is always set to double_click.

            • const DoubleClickDoubleClick DoubleClick = "double_click"
          • X int64

            The x-coordinate where the double click occurred.

          • Y int64

            The y-coordinate where the double click occurred.

        • type ResponseComputerToolCallActionDrag struct{…}

          A drag action.

          • Path []ResponseComputerToolCallActionDragPath

            An 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 int64

              The x-coordinate.

            • Y int64

              The y-coordinate.

          • Type Drag

            Specifies the event type. For a drag action, this property is always set to drag.

            • const DragDrag Drag = "drag"
          • Keys []string

            The keys being held while dragging the mouse.

        • type ResponseComputerToolCallActionKeypress struct{…}

          A collection of keypresses the model would like to perform.

          • Keys []string

            The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.

          • Type Keypress

            Specifies 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 Move

            Specifies the event type. For a move action, this property is always set to move.

            • const MoveMove Move = "move"
          • X int64

            The x-coordinate to move to.

          • Y int64

            The y-coordinate to move to.

          • Keys []string

            The keys being held while moving the mouse.

        • type ResponseComputerToolCallActionScreenshot struct{…}

          A screenshot action.

          • Type Screenshot

            Specifies 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 int64

            The horizontal scroll distance.

          • ScrollY int64

            The vertical scroll distance.

          • Type Scroll

            Specifies the event type. For a scroll action, this property is always set to scroll.

            • const ScrollScroll Scroll = "scroll"
          • X int64

            The x-coordinate where the scroll occurred.

          • Y int64

            The y-coordinate where the scroll occurred.

          • Keys []string

            The keys being held while scrolling.

        • type ResponseComputerToolCallActionType struct{…}

          An action to type in text.

          • Text string

            The text to type.

          • Type Type

            Specifies 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 Wait

            Specifies the event type. For a wait action, this property is always set to wait.

            • const WaitWait Wait = "wait"
      • Actions ComputerActionList

        Flattened batched actions for computer_use. Each action includes an type discriminator and action-specific fields.

        • type ComputerActionClick struct{…}

          A click action.

          • Button string

            Indicates which mouse button was pressed during the click. One of left, right, wheel, back, or forward.

            • const ComputerActionClickButtonLeft ComputerActionClickButton = "left"

            • const ComputerActionClickButtonRight ComputerActionClickButton = "right"

            • const ComputerActionClickButtonWheel ComputerActionClickButton = "wheel"

            • const ComputerActionClickButtonBack ComputerActionClickButton = "back"

            • const ComputerActionClickButtonForward ComputerActionClickButton = "forward"

          • Type Click

            Specifies the event type. For a click action, this property is always click.

            • const ClickClick Click = "click"
          • X int64

            The x-coordinate where the click occurred.

          • Y int64

            The y-coordinate where the click occurred.

          • Keys []string

            The keys being held while clicking.

        • type ComputerActionDoubleClick struct{…}

          A double click action.

          • Keys []string

            The keys being held while double-clicking.

          • Type DoubleClick

            Specifies the event type. For a double click action, this property is always set to double_click.

            • const DoubleClickDoubleClick DoubleClick = "double_click"
          • X int64

            The x-coordinate where the double click occurred.

          • Y int64

            The y-coordinate where the double click occurred.

        • type ComputerActionDrag struct{…}

          A drag action.

          • Path []ComputerActionDragPath

            An 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 int64

              The x-coordinate.

            • Y int64

              The y-coordinate.

          • Type Drag

            Specifies the event type. For a drag action, this property is always set to drag.

            • const DragDrag Drag = "drag"
          • Keys []string

            The keys being held while dragging the mouse.

        • type ComputerActionKeypress struct{…}

          A collection of keypresses the model would like to perform.

          • Keys []string

            The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.

          • Type Keypress

            Specifies 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 Move

            Specifies the event type. For a move action, this property is always set to move.

            • const MoveMove Move = "move"
          • X int64

            The x-coordinate to move to.

          • Y int64

            The y-coordinate to move to.

          • Keys []string

            The keys being held while moving the mouse.

        • type ComputerActionScreenshot struct{…}

          A screenshot action.

          • Type Screenshot

            Specifies 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 int64

            The horizontal scroll distance.

          • ScrollY int64

            The vertical scroll distance.

          • Type Scroll

            Specifies the event type. For a scroll action, this property is always set to scroll.

            • const ScrollScroll Scroll = "scroll"
          • X int64

            The x-coordinate where the scroll occurred.

          • Y int64

            The y-coordinate where the scroll occurred.

          • Keys []string

            The keys being held while scrolling.

        • type ComputerActionType struct{…}

          An action to type in text.

          • Text string

            The text to type.

          • Type Type

            Specifies 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 Wait

            Specifies the event type. For a wait action, this property is always set to wait.

            • const WaitWait Wait = "wait"
    • type ResponseComputerToolCallOutputItem struct{…}

      • ID string

        The unique ID of the computer call tool output.

      • CallID string

        The ID of the computer tool call that produced the output.

      • Output ResponseComputerToolCallOutputScreenshot

        A computer screenshot image used with the computer use tool.

        • Type ComputerScreenshot

          Specifies the event type. For a computer screenshot, this property is always set to computer_screenshot.

          • const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"
        • FileID string

          The identifier of an uploaded file that contains the screenshot.

        • ImageURL string

          The URL of the screenshot image.

      • Status ResponseComputerToolCallOutputItemStatus

        The status of the message input. One of in_progress, completed, or incomplete. 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 ComputerCallOutput

        The type of the computer tool call output. Always computer_call_output.

        • const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
      • AcknowledgedSafetyChecks []ResponseComputerToolCallOutputItemAcknowledgedSafetyCheck

        The safety checks reported by the API that have been acknowledged by the developer.

        • ID string

          The ID of the pending safety check.

        • Code string

          The type of the pending safety check.

        • Message string

          Details about the pending safety check.

      • CreatedBy string

        The 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 string

        The unique ID of the web search tool call.

      • Action ResponseFunctionWebSearchActionUnion

        An 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 Search

            The action type.

            • const SearchSearch Search = "search"
          • Queries []string

            The search queries.

          • Query string

            The search query.

          • Sources []ResponseFunctionWebSearchActionSearchSource

            The sources used in the search.

            • Type URL

              The type of source. Always url.

              • const URLURL URL = "url"
            • URL string

              The URL of the source.

        • type ResponseFunctionWebSearchActionOpenPage struct{…}

          Action type "open_page" - Opens a specific URL from search results.

          • Type OpenPage

            The action type.

            • const OpenPageOpenPage OpenPage = "open_page"
          • URL string

            The URL opened by the model.

        • type ResponseFunctionWebSearchActionFindInPage struct{…}

          Action type "find_in_page": Searches for a pattern within a loaded page.

          • Pattern string

            The pattern or text to search for within the page.

          • Type FindInPage

            The action type.

            • const FindInPageFindInPage FindInPage = "find_in_page"
          • URL string

            The URL of the page searched for the pattern.

      • Status ResponseFunctionWebSearchStatus

        The 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 WebSearchCall

        The 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 string

        The unique ID of the function tool call.

      • Status string

        The status of the item. One of in_progress, completed, or incomplete. Populated when items are returned via API.

        • const ResponseFunctionToolCallItemStatusInProgress ResponseFunctionToolCallItemStatus = "in_progress"

        • const ResponseFunctionToolCallItemStatusCompleted ResponseFunctionToolCallItemStatus = "completed"

        • const ResponseFunctionToolCallItemStatusIncomplete ResponseFunctionToolCallItemStatus = "incomplete"

      • CreatedBy string

        The identifier of the actor that created the item.

    • type ResponseFunctionToolCallOutputItem struct{…}

      • ID string

        The unique ID of the function call tool output.

      • CallID string

        The unique ID of the function tool call generated by the model.

      • Output ResponseFunctionToolCallOutputItemOutputUnion

        The output from the function call generated by your code. Can be a string or an list of output content.

        • string

        • type ResponseFunctionToolCallOutputItemOutputOutputContentList []ResponseFunctionToolCallOutputItemOutputOutputContentListItemUnion

          Text, 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 ResponseFunctionToolCallOutputItemStatus

        The status of the item. One of in_progress, completed, or incomplete. Populated when items are returned via API.

        • const ResponseFunctionToolCallOutputItemStatusInProgress ResponseFunctionToolCallOutputItemStatus = "in_progress"

        • const ResponseFunctionToolCallOutputItemStatusCompleted ResponseFunctionToolCallOutputItemStatus = "completed"

        • const ResponseFunctionToolCallOutputItemStatusIncomplete ResponseFunctionToolCallOutputItemStatus = "incomplete"

      • Type FunctionCallOutput

        The type of the function tool call output. Always function_call_output.

        • const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
      • CreatedBy string

        The identifier of the actor that created the item.

    • type ResponseToolSearchCall struct{…}

      • ID string

        The unique ID of the tool search call item.

      • Arguments any

        Arguments used for the tool search call.

      • CallID string

        The unique ID of the tool search call generated by the model.

      • Execution ResponseToolSearchCallExecution

        Whether tool search was executed by the server or by the client.

        • const ResponseToolSearchCallExecutionServer ResponseToolSearchCallExecution = "server"

        • const ResponseToolSearchCallExecutionClient ResponseToolSearchCallExecution = "client"

      • Status ResponseToolSearchCallStatus

        The status of the tool search call item that was recorded.

        • const ResponseToolSearchCallStatusInProgress ResponseToolSearchCallStatus = "in_progress"

        • const ResponseToolSearchCallStatusCompleted ResponseToolSearchCallStatus = "completed"

        • const ResponseToolSearchCallStatusIncomplete ResponseToolSearchCallStatus = "incomplete"

      • Type ToolSearchCall

        The type of the item. Always tool_search_call.

        • const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
      • CreatedBy string

        The identifier of the actor that created the item.

    • type ResponseToolSearchOutputItem struct{…}

      • ID string

        The unique ID of the tool search output item.

      • CallID string

        The unique ID of the tool search call generated by the model.

      • Execution ResponseToolSearchOutputItemExecution

        Whether tool search was executed by the server or by the client.

        • const ResponseToolSearchOutputItemExecutionServer ResponseToolSearchOutputItemExecution = "server"

        • const ResponseToolSearchOutputItemExecutionClient ResponseToolSearchOutputItemExecution = "client"

      • Status ResponseToolSearchOutputItemStatus

        The status of the tool search output item that was recorded.

        • const ResponseToolSearchOutputItemStatusInProgress ResponseToolSearchOutputItemStatus = "in_progress"

        • const ResponseToolSearchOutputItemStatusCompleted ResponseToolSearchOutputItemStatus = "completed"

        • const ResponseToolSearchOutputItemStatusIncomplete ResponseToolSearchOutputItemStatus = "incomplete"

      • Tools []ToolUnion

        The 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 string

            The name of the function to call.

          • Parameters map[string, any]

            A JSON schema object describing the parameters of the function.

          • Strict bool

            Whether to enforce strict parameter validation. Default true.

          • Type Function

            The type of the function tool. Always function.

            • const FunctionFunction Function = "function"
          • DeferLoading bool

            Whether this function is deferred and loaded via tool search.

          • Description string

            A 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 FileSearch

            The type of the file search tool. Always file_search.

            • const FileSearchFileSearch FileSearch = "file_search"
          • VectorStoreIDs []string

            The IDs of the vector stores to search.

          • Filters FileSearchToolFiltersUnion

            A 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 string

                The key to compare against the value.

              • Type ComparisonFilterType

                Specifies 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 ComparisonFilterValueUnion

                The 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 and or or.

              • Filters []ComparisonFilter

                Array of filters to combine. Items can be ComparisonFilter or CompoundFilter.

                • type ComparisonFilter struct{…}

                  A filter used to compare a specified attribute key to a given value using a defined comparison operation.

              • Type CompoundFilterType

                Type of operation: and or or.

                • const CompoundFilterTypeAnd CompoundFilterType = "and"

                • const CompoundFilterTypeOr CompoundFilterType = "or"

          • MaxNumResults int64

            The maximum number of results to return. This number should be between 1 and 50 inclusive.

          • RankingOptions FileSearchToolRankingOptions

            Ranking options for search.

            • HybridSearch FileSearchToolRankingOptionsHybridSearch

              Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.

              • EmbeddingWeight float64

                The weight of the embedding in the reciprocal ranking fusion.

              • TextWeight float64

                The weight of the text in the reciprocal ranking fusion.

            • Ranker string

              The ranker to use for the file search.

              • const FileSearchToolRankingOptionsRankerAuto FileSearchToolRankingOptionsRanker = "auto"

              • const FileSearchToolRankingOptionsRankerDefault2024_11_15 FileSearchToolRankingOptionsRanker = "default-2024-11-15"

            • ScoreThreshold float64

              The 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 Computer

            The 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 int64

            The height of the computer display.

          • DisplayWidth int64

            The width of the computer display.

          • Environment ComputerUsePreviewToolEnvironment

            The 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 ComputerUsePreview

            The 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 WebSearchToolType

            The type of the web search tool. One of web_search or web_search_2025_08_26.

            • const WebSearchToolTypeWebSearch WebSearchToolType = "web_search"

            • const WebSearchToolTypeWebSearch2025_08_26 WebSearchToolType = "web_search_2025_08_26"

          • Filters WebSearchToolFilters

            Filters for the search.

            • AllowedDomains []string

              Allowed 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 WebSearchToolSearchContextSize

            High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default.

            • const WebSearchToolSearchContextSizeLow WebSearchToolSearchContextSize = "low"

            • const WebSearchToolSearchContextSizeMedium WebSearchToolSearchContextSize = "medium"

            • const WebSearchToolSearchContextSizeHigh WebSearchToolSearchContextSize = "high"

          • UserLocation WebSearchToolUserLocation

            The approximate location of the user.

            • City string

              Free text input for the city of the user, e.g. San Francisco.

            • Country string

              The two-letter ISO country code of the user, e.g. US.

            • Region string

              Free text input for the region of the user, e.g. California.

            • Timezone string

              The IANA timezone of the user, e.g. America/Los_Angeles.

            • Type string

              The 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 string

            A label for this MCP server, used to identify it in tool calls.

          • Type Mcp

            The type of the MCP tool. Always mcp.

            • const McpMcp Mcp = "mcp"
          • AllowedTools ToolMcpAllowedToolsUnion

            List of allowed tool names or a filter object.

            • type ToolMcpAllowedToolsMcpAllowedTools []string

              A string array of allowed tool names

            • type ToolMcpAllowedToolsMcpToolFilter struct{…}

              A filter object to specify which tools are allowed.

              • ReadOnly bool

                Indicates 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 []string

                List of allowed tool names.

          • Authorization string

            An 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 string

            Identifier for service connectors, like those available in ChatGPT. One of server_url, connector_id, or tunnel_id must be provided. Learn more about service connectors here.

            Currently supported connector_id values 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 bool

            Whether 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 ToolMcpRequireApprovalUnion

            Specify 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 ToolMcpRequireApprovalMcpToolApprovalFilterAlways

                A filter object to specify which tools are allowed.

                • ReadOnly bool

                  Indicates 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 []string

                  List of allowed tool names.

              • Never ToolMcpRequireApprovalMcpToolApprovalFilterNever

                A filter object to specify which tools are allowed.

                • ReadOnly bool

                  Indicates 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 []string

                  List of allowed tool names.

            • type ToolMcpRequireApprovalMcpToolApprovalSetting string

              Specify a single approval policy for all tools. One of always or never. When set to always, all tools will require approval. When set to never, all tools will not require approval.

              • const ToolMcpRequireApprovalMcpToolApprovalSettingAlways ToolMcpRequireApprovalMcpToolApprovalSetting = "always"

              • const ToolMcpRequireApprovalMcpToolApprovalSettingNever ToolMcpRequireApprovalMcpToolApprovalSetting = "never"

          • ServerDescription string

            Optional description of the MCP server, used to provide more context.

          • ServerURL string

            The URL for the MCP server. One of server_url, connector_id, or tunnel_id must be provided.

          • TunnelID string

            The Secure MCP Tunnel ID to use instead of a direct server URL. One of server_url, connector_id, or tunnel_id must be provided.

        • type ToolCodeInterpreter struct{…}

          A tool that runs Python code to help generate a response to a prompt.

          • Container ToolCodeInterpreterContainerUnion

            The 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_limit setting.

            • string

            • type ToolCodeInterpreterContainerCodeInterpreterContainerAuto struct{…}

              Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.

              • Type Auto

                Always auto.

                • const AutoAuto Auto = "auto"
              • FileIDs []string

                An optional list of uploaded files to make available to your code.

              • MemoryLimit string

                The memory limit for the code interpreter container.

                • const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g"

                • const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g"

                • const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g"

                • const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"

              • NetworkPolicy ToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnion

                Network access policy for the container.

                • type ContainerNetworkPolicyDisabled struct{…}

                  • Type Disabled

                    Disable outbound network access. Always disabled.

                    • const DisabledDisabled Disabled = "disabled"
                • type ContainerNetworkPolicyAllowlist struct{…}

                  • AllowedDomains []string

                    A list of allowed domains when type is allowlist.

                  • Type Allowlist

                    Allow outbound network access only to specified domains. Always allowlist.

                    • const AllowlistAllowlist Allowlist = "allowlist"
                  • DomainSecrets []ContainerNetworkPolicyDomainSecret

                    Optional domain-scoped secrets for allowlisted domains.

                    • Domain string

                      The domain associated with the secret.

                    • Name string

                      The name of the secret to inject for the domain.

                    • Value string

                      The secret value to inject for the domain.

          • Type CodeInterpreter

            The 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 ImageGeneration

            The type of the image generation tool. Always image_generation.

            • const ImageGenerationImageGeneration ImageGeneration = "image_generation"
          • Action string

            Whether 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 string

            Allows 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, or auto (default value). When auto is used, the model will automatically determine the best background for the image.

            gpt-image-2 and gpt-image-2-2026-04-21 do not support transparent backgrounds. Requests with background set to transparent will return an error for these models; use opaque or auto instead.

            If transparent, the output format needs to support transparency, so it should be set to either png (default value) or webp.

            • const ToolImageGenerationBackgroundTransparent ToolImageGenerationBackground = "transparent"

            • const ToolImageGenerationBackgroundOpaque ToolImageGenerationBackground = "opaque"

            • const ToolImageGenerationBackgroundAuto ToolImageGenerationBackground = "auto"

          • InputFidelity string

            Control 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-1 and gpt-image-1.5 and later models, unsupported for gpt-image-1-mini. Supports high and low. Defaults to low.

            • const ToolImageGenerationInputFidelityHigh ToolImageGenerationInputFidelity = "high"

            • const ToolImageGenerationInputFidelityLow ToolImageGenerationInputFidelity = "low"

          • InputImageMask ToolImageGenerationInputImageMask

            Optional mask for inpainting. Contains image_url (string, optional) and file_id (string, optional).

            • FileID string

              File ID for the mask image.

            • ImageURL string

              Base64-encoded mask image.

          • Model string

            The 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 string

            Moderation level for the generated image. Default: auto.

            • const ToolImageGenerationModerationAuto ToolImageGenerationModeration = "auto"

            • const ToolImageGenerationModerationLow ToolImageGenerationModeration = "low"

          • OutputCompression int64

            Compression level for the output image. Default: 100.

          • OutputFormat string

            The output format of the generated image. One of png, webp, or jpeg. Default: png.

            • const ToolImageGenerationOutputFormatPNG ToolImageGenerationOutputFormat = "png"

            • const ToolImageGenerationOutputFormatWebP ToolImageGenerationOutputFormat = "webp"

            • const ToolImageGenerationOutputFormatJPEG ToolImageGenerationOutputFormat = "jpeg"

          • PartialImages int64

            Number of partial images to generate in streaming mode, from 0 (default value) to 3.

          • Quality string

            The quality of the generated image. One of low, medium, high, or auto. Default: auto.

            • const ToolImageGenerationQualityLow ToolImageGenerationQuality = "low"

            • const ToolImageGenerationQualityMedium ToolImageGenerationQuality = "medium"

            • const ToolImageGenerationQualityHigh ToolImageGenerationQuality = "high"

            • const ToolImageGenerationQualityAuto ToolImageGenerationQuality = "auto"

          • Size string

            The size of the generated images. For gpt-image-2 and gpt-image-2-2026-04-21, arbitrary resolutions are supported as WIDTHxHEIGHT strings, for example 1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above 2560x1440 are experimental, and the maximum supported resolution is 3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes 1024x1024, 1536x1024, and 1024x1536 are supported by the GPT image models; auto is supported for models that allow automatic sizing. For dall-e-2, use one of 256x256, 512x512, or 1024x1024. For dall-e-3, use one of 1024x1024, 1792x1024, or 1024x1792.

            • 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 LocalShell

            The 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 Shell

            The type of the shell tool. Always shell.

            • const ShellShell Shell = "shell"
          • Environment FunctionShellToolEnvironmentUnion

            • type ContainerAuto struct{…}

              • Type ContainerAuto

                Automatically creates a container for this request

                • const ContainerAutoContainerAuto ContainerAuto = "container_auto"
              • FileIDs []string

                An optional list of uploaded files to make available to your code.

              • MemoryLimit ContainerAutoMemoryLimit

                The memory limit for the container.

                • const ContainerAutoMemoryLimit1g ContainerAutoMemoryLimit = "1g"

                • const ContainerAutoMemoryLimit4g ContainerAutoMemoryLimit = "4g"

                • const ContainerAutoMemoryLimit16g ContainerAutoMemoryLimit = "16g"

                • const ContainerAutoMemoryLimit64g ContainerAutoMemoryLimit = "64g"

              • NetworkPolicy ContainerAutoNetworkPolicyUnion

                Network access policy for the container.

                • type ContainerNetworkPolicyDisabled struct{…}

                • type ContainerNetworkPolicyAllowlist struct{…}

              • Skills []ContainerAutoSkillUnion

                An optional list of skills referenced by id or inline data.

                • type SkillReference struct{…}

                  • SkillID string

                    The ID of the referenced skill.

                  • Type SkillReference

                    References a skill created with the /v1/skills endpoint.

                    • const SkillReferenceSkillReference SkillReference = "skill_reference"
                  • Version string

                    Optional skill version. Use a positive integer or 'latest'. Omit for default.

                • type InlineSkill struct{…}

                  • Description string

                    The description of the skill.

                  • Name string

                    The name of the skill.

                  • Source InlineSkillSource

                    Inline skill payload

                    • Data string

                      Base64-encoded skill zip bundle.

                    • MediaType ApplicationZip

                      The media type of the inline skill payload. Must be application/zip.

                      • const ApplicationZipApplicationZip ApplicationZip = "application/zip"
                    • Type Base64

                      The type of the inline skill source. Must be base64.

                      • const Base64Base64 Base64 = "base64"
                  • Type Inline

                    Defines an inline skill for this request.

                    • const InlineInline Inline = "inline"
            • type LocalEnvironment struct{…}

              • Type Local

                Use a local computer environment.

                • const LocalLocal Local = "local"
              • Skills []LocalSkill

                An optional list of skills.

                • Description string

                  The description of the skill.

                • Name string

                  The name of the skill.

                • Path string

                  The path to the directory containing the skill.

            • type ContainerReference struct{…}

              • ContainerID string

                The ID of the referenced container.

              • Type ContainerReference

                References 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 string

            The name of the custom tool, used to identify it in tool calls.

          • Type Custom

            The type of the custom tool. Always custom.

            • const CustomCustom Custom = "custom"
          • DeferLoading bool

            Whether this tool should be deferred and discovered via tool search.

          • Description string

            Optional description of the custom tool, used to provide more context.

          • Format CustomToolInputFormatUnion

            The input format for the custom tool. Default is unconstrained text.

            • type CustomToolInputFormatText struct{…}

              Unconstrained free-form text.

              • Type Text

                Unconstrained text format. Always text.

                • const TextText Text = "text"
            • type CustomToolInputFormatGrammar struct{…}

              A grammar defined by the user.

              • Definition string

                The grammar definition.

              • Syntax string

                The syntax of the grammar definition. One of lark or regex.

                • const CustomToolInputFormatGrammarSyntaxLark CustomToolInputFormatGrammarSyntax = "lark"

                • const CustomToolInputFormatGrammarSyntaxRegex CustomToolInputFormatGrammarSyntax = "regex"

              • Type Grammar

                Grammar format. Always grammar.

                • const GrammarGrammar Grammar = "grammar"
        • type NamespaceTool struct{…}

          Groups function/custom tools under a shared namespace.

          • Description string

            A description of the namespace shown to the model.

          • Name string

            The namespace name used in tool calls (for example, crm).

          • Tools []NamespaceToolToolUnion

            The function/custom tools available inside this namespace.

            • type NamespaceToolToolFunction struct{…}

              • Name string

              • Type Function

                • const FunctionFunction Function = "function"
              • DeferLoading bool

                Whether 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 Namespace

            The type of the tool. Always namespace.

            • const NamespaceNamespace Namespace = "namespace"
        • type ToolSearchTool struct{…}

          Hosted or BYOT tool search configuration for deferred tools.

          • Type ToolSearch

            The type of the tool. Always tool_search.

            • const ToolSearchToolSearch ToolSearch = "tool_search"
          • Description string

            Description shown to the model for a client-executed tool search tool.

          • Execution ToolSearchToolExecution

            Whether tool search is executed by the server or by the client.

            • const ToolSearchToolExecutionServer ToolSearchToolExecution = "server"

            • const ToolSearchToolExecutionClient ToolSearchToolExecution = "client"

          • Parameters any

            Parameter 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 WebSearchPreviewToolType

            The type of the web search tool. One of web_search_preview or web_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 WebSearchPreviewToolSearchContextSize

            High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default.

            • const WebSearchPreviewToolSearchContextSizeLow WebSearchPreviewToolSearchContextSize = "low"

            • const WebSearchPreviewToolSearchContextSizeMedium WebSearchPreviewToolSearchContextSize = "medium"

            • const WebSearchPreviewToolSearchContextSizeHigh WebSearchPreviewToolSearchContextSize = "high"

          • UserLocation WebSearchPreviewToolUserLocation

            The user's location.

            • Type Approximate

              The type of location approximation. Always approximate.

              • const ApproximateApproximate Approximate = "approximate"
            • City string

              Free text input for the city of the user, e.g. San Francisco.

            • Country string

              The two-letter ISO country code of the user, e.g. US.

            • Region string

              Free text input for the region of the user, e.g. California.

            • Timezone string

              The 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 ApplyPatch

            The type of the tool. Always apply_patch.

            • const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
      • Type ToolSearchOutput

        The type of the item. Always tool_search_output.

        • const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
      • CreatedBy string

        The identifier of the actor that created the item.

    • type ResponseItemAdditionalTools struct{…}

      • ID string

        The unique ID of the additional tools item.

      • Role string

        The 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 []ToolUnion

        The 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 AdditionalTools

        The 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 input to the Responses API for subsequent turns of a conversation if you are manually managing context.

      • ID string

        The unique identifier of the reasoning content.

      • Summary []ResponseReasoningItemSummary

        Reasoning summary content.

        • Text string

          A summary of the reasoning output from the model so far.

        • Type SummaryText

          The type of the object. Always summary_text.

          • const SummaryTextSummaryText SummaryText = "summary_text"
      • Type Reasoning

        The type of the object. Always reasoning.

        • const ReasoningReasoning Reasoning = "reasoning"
      • Content []ResponseReasoningItemContent

        Reasoning text content.

        • Text string

          The reasoning text from the model.

        • Type ReasoningText

          The type of the reasoning text. Always reasoning_text.

          • const ReasoningTextReasoningText ReasoningText = "reasoning_text"
      • EncryptedContent string

        The encrypted content of the reasoning item - populated when a response is generated with reasoning.encrypted_content in the include parameter.

      • Status ResponseReasoningItemStatus

        The status of the item. One of in_progress, completed, or incomplete. 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/compact API.

      • ID string

        The unique ID of the compaction item.

      • EncryptedContent string

        The encrypted content that was produced by compaction.

      • Type Compaction

        The type of the item. Always compaction.

        • const CompactionCompaction Compaction = "compaction"
      • CreatedBy string

        The identifier of the actor that created the item.

    • type ResponseItemImageGenerationCall struct{…}

      An image generation request made by the model.

      • ID string

        The unique ID of the image generation call.

      • Result string

        The generated image encoded in base64.

      • Status string

        The status of the image generation call.

        • const ResponseItemImageGenerationCallStatusInProgress ResponseItemImageGenerationCallStatus = "in_progress"

        • const ResponseItemImageGenerationCallStatusCompleted ResponseItemImageGenerationCallStatus = "completed"

        • const ResponseItemImageGenerationCallStatusGenerating ResponseItemImageGenerationCallStatus = "generating"

        • const ResponseItemImageGenerationCallStatusFailed ResponseItemImageGenerationCallStatus = "failed"

      • Type ImageGenerationCall

        The 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 string

        The unique ID of the code interpreter tool call.

      • Code string

        The code to run, or null if not available.

      • ContainerID string

        The ID of the container used to run the code.

      • Outputs []ResponseCodeInterpreterToolCallOutputUnion

        The 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 string

            The logs output from the code interpreter.

          • Type Logs

            The type of the output. Always logs.

            • const LogsLogs Logs = "logs"
        • type ResponseCodeInterpreterToolCallOutputImage struct{…}

          The image output from the code interpreter.

          • Type Image

            The type of the output. Always image.

            • const ImageImage Image = "image"
          • URL string

            The URL of the image output from the code interpreter.

      • Status ResponseCodeInterpreterToolCallStatus

        The status of the code interpreter tool call. Valid values are in_progress, completed, incomplete, interpreting, and failed.

        • const ResponseCodeInterpreterToolCallStatusInProgress ResponseCodeInterpreterToolCallStatus = "in_progress"

        • const ResponseCodeInterpreterToolCallStatusCompleted ResponseCodeInterpreterToolCallStatus = "completed"

        • const ResponseCodeInterpreterToolCallStatusIncomplete ResponseCodeInterpreterToolCallStatus = "incomplete"

        • const ResponseCodeInterpreterToolCallStatusInterpreting ResponseCodeInterpreterToolCallStatus = "interpreting"

        • const ResponseCodeInterpreterToolCallStatusFailed ResponseCodeInterpreterToolCallStatus = "failed"

      • Type CodeInterpreterCall

        The 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 string

        The unique ID of the local shell call.

      • Action ResponseItemLocalShellCallAction

        Execute a shell command on the server.

        • Command []string

          The command to run.

        • Env map[string, string]

          Environment variables to set for the command.

        • Type Exec

          The type of the local shell action. Always exec.

          • const ExecExec Exec = "exec"
        • TimeoutMs int64

          Optional timeout in milliseconds for the command.

        • User string

          Optional user to run the command as.

        • WorkingDirectory string

          Optional working directory to run the command in.

      • CallID string

        The unique ID of the local shell tool call generated by the model.

      • Status string

        The status of the local shell call.

        • const ResponseItemLocalShellCallStatusInProgress ResponseItemLocalShellCallStatus = "in_progress"

        • const ResponseItemLocalShellCallStatusCompleted ResponseItemLocalShellCallStatus = "completed"

        • const ResponseItemLocalShellCallStatusIncomplete ResponseItemLocalShellCallStatus = "incomplete"

      • Type LocalShellCall

        The 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 string

        The unique ID of the local shell tool call generated by the model.

      • Output string

        A JSON string of the output of the local shell tool call.

      • Type LocalShellCallOutput

        The type of the local shell tool call output. Always local_shell_call_output.

        • const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
      • Status string

        The status of the item. One of in_progress, completed, or incomplete.

        • 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 string

        The unique ID of the shell tool call. Populated when this item is returned via API.

      • Action ResponseFunctionShellToolCallAction

        The shell commands and limits that describe how to run the tool call.

        • Commands []string

        • MaxOutputLength int64

          Optional maximum number of characters to return from each command.

        • TimeoutMs int64

          Optional timeout in milliseconds for the commands.

      • CallID string

        The unique ID of the shell tool call generated by the model.

      • Environment ResponseFunctionShellToolCallEnvironmentUnion

        Represents 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 Local

            The environment type. Always local.

            • const LocalLocal Local = "local"
        • type ResponseContainerReference struct{…}

          Represents a container created with /v1/containers.

          • ContainerID string

          • Type ContainerReference

            The environment type. Always container_reference.

            • const ContainerReferenceContainerReference ContainerReference = "container_reference"
      • Status ResponseFunctionShellToolCallStatus

        The status of the shell call. One of in_progress, completed, or incomplete.

        • const ResponseFunctionShellToolCallStatusInProgress ResponseFunctionShellToolCallStatus = "in_progress"

        • const ResponseFunctionShellToolCallStatusCompleted ResponseFunctionShellToolCallStatus = "completed"

        • const ResponseFunctionShellToolCallStatusIncomplete ResponseFunctionShellToolCallStatus = "incomplete"

      • Type ShellCall

        The type of the item. Always shell_call.

        • const ShellCallShellCall ShellCall = "shell_call"
      • CreatedBy string

        The ID of the entity that created this tool call.

    • type ResponseFunctionShellToolCallOutput struct{…}

      The output of a shell tool call that was emitted.

      • ID string

        The unique ID of the shell call output. Populated when this item is returned via API.

      • CallID string

        The unique ID of the shell tool call generated by the model.

      • MaxOutputLength int64

        The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.

      • Output []ResponseFunctionShellToolCallOutputOutput

        An array of shell call output contents

        • Outcome ResponseFunctionShellToolCallOutputOutputOutcomeUnion

          Represents 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 Timeout

              The outcome type. Always timeout.

              • const TimeoutTimeout Timeout = "timeout"
          • type ResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}

            Indicates that the shell commands finished and returned an exit code.

            • ExitCode int64

              Exit code from the shell process.

            • Type Exit

              The outcome type. Always exit.

              • const ExitExit Exit = "exit"
        • Stderr string

          The standard error output that was captured.

        • Stdout string

          The standard output that was captured.

        • CreatedBy string

          The identifier of the actor that created the item.

      • Status ResponseFunctionShellToolCallOutputStatus

        The status of the shell call output. One of in_progress, completed, or incomplete.

        • const ResponseFunctionShellToolCallOutputStatusInProgress ResponseFunctionShellToolCallOutputStatus = "in_progress"

        • const ResponseFunctionShellToolCallOutputStatusCompleted ResponseFunctionShellToolCallOutputStatus = "completed"

        • const ResponseFunctionShellToolCallOutputStatusIncomplete ResponseFunctionShellToolCallOutputStatus = "incomplete"

      • Type ShellCallOutput

        The type of the shell call output. Always shell_call_output.

        • const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
      • CreatedBy string

        The 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 string

        The unique ID of the apply patch tool call. Populated when this item is returned via API.

      • CallID string

        The unique ID of the apply patch tool call generated by the model.

      • Operation ResponseApplyPatchToolCallOperationUnion

        One 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 string

            Diff to apply.

          • Path string

            Path of the file to create.

          • Type CreateFile

            Create 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 string

            Path of the file to delete.

          • Type DeleteFile

            Delete the specified file.

            • const DeleteFileDeleteFile DeleteFile = "delete_file"
        • type ResponseApplyPatchToolCallOperationUpdateFile struct{…}

          Instruction describing how to update a file via the apply_patch tool.

          • Diff string

            Diff to apply.

          • Path string

            Path of the file to update.

          • Type UpdateFile

            Update an existing file with the provided diff.

            • const UpdateFileUpdateFile UpdateFile = "update_file"
      • Status ResponseApplyPatchToolCallStatus

        The status of the apply patch tool call. One of in_progress or completed.

        • const ResponseApplyPatchToolCallStatusInProgress ResponseApplyPatchToolCallStatus = "in_progress"

        • const ResponseApplyPatchToolCallStatusCompleted ResponseApplyPatchToolCallStatus = "completed"

      • Type ApplyPatchCall

        The type of the item. Always apply_patch_call.

        • const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
      • CreatedBy string

        The ID of the entity that created this tool call.

    • type ResponseApplyPatchToolCallOutput struct{…}

      The output emitted by an apply patch tool call.

      • ID string

        The unique ID of the apply patch tool call output. Populated when this item is returned via API.

      • CallID string

        The unique ID of the apply patch tool call generated by the model.

      • Status ResponseApplyPatchToolCallOutputStatus

        The status of the apply patch tool call output. One of completed or failed.

        • const ResponseApplyPatchToolCallOutputStatusCompleted ResponseApplyPatchToolCallOutputStatus = "completed"

        • const ResponseApplyPatchToolCallOutputStatusFailed ResponseApplyPatchToolCallOutputStatus = "failed"

      • Type ApplyPatchCallOutput

        The type of the item. Always apply_patch_call_output.

        • const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
      • CreatedBy string

        The ID of the entity that created this tool call output.

      • Output string

        Optional textual output returned by the apply patch tool.

    • type ResponseItemMcpListTools struct{…}

      A list of tools available on an MCP server.

      • ID string

        The unique ID of the list.

      • ServerLabel string

        The label of the MCP server.

      • Tools []ResponseItemMcpListToolsTool

        The tools available on the server.

        • InputSchema any

          The JSON schema describing the tool's input.

        • Name string

          The name of the tool.

        • Annotations any

          Additional annotations about the tool.

        • Description string

          The description of the tool.

      • Type McpListTools

        The type of the item. Always mcp_list_tools.

        • const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
      • Error string

        Error message if the server could not list tools.

    • type ResponseItemMcpApprovalRequest struct{…}

      A request for human approval of a tool invocation.

      • ID string

        The unique ID of the approval request.

      • Arguments string

        A JSON string of arguments for the tool.

      • Name string

        The name of the tool to run.

      • ServerLabel string

        The label of the MCP server making the request.

      • Type McpApprovalRequest

        The 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 string

        The unique ID of the approval response

      • ApprovalRequestID string

        The ID of the approval request being answered.

      • Approve bool

        Whether the request was approved.

      • Type McpApprovalResponse

        The type of the item. Always mcp_approval_response.

        • const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
      • Reason string

        Optional reason for the decision.

    • type ResponseItemMcpCall struct{…}

      An invocation of a tool on an MCP server.

      • ID string

        The unique ID of the tool call.

      • Arguments string

        A JSON string of the arguments passed to the tool.

      • Name string

        The name of the tool that was run.

      • ServerLabel string

        The label of the MCP server running the tool.

      • Type McpCall

        The type of the item. Always mcp_call.

        • const McpCallMcpCall McpCall = "mcp_call"
      • ApprovalRequestID string

        Unique identifier for the MCP tool call approval request. Include this value in a subsequent mcp_approval_response input to approve or reject the corresponding tool call.

      • Error string

        The error from the tool call, if any.

      • Output string

        The output from the tool call.

      • Status string

        The status of the tool call. One of in_progress, completed, incomplete, calling, or failed.

        • 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 string

        The unique ID of the custom tool call item.

      • Status string

        The status of the item. One of in_progress, completed, or incomplete. Populated when items are returned via API.

        • const ResponseCustomToolCallItemStatusInProgress ResponseCustomToolCallItemStatus = "in_progress"

        • const ResponseCustomToolCallItemStatusCompleted ResponseCustomToolCallItemStatus = "completed"

        • const ResponseCustomToolCallItemStatusIncomplete ResponseCustomToolCallItemStatus = "incomplete"

      • CreatedBy string

        The 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 string

        The unique ID of the custom tool call output item.

      • Status string

        The status of the item. One of in_progress, completed, or incomplete. Populated when items are returned via API.

        • const ResponseCustomToolCallOutputItemStatusInProgress ResponseCustomToolCallOutputItemStatus = "in_progress"

        • const ResponseCustomToolCallOutputItemStatusCompleted ResponseCustomToolCallOutputItemStatus = "completed"

        • const ResponseCustomToolCallOutputItemStatusIncomplete ResponseCustomToolCallOutputItemStatus = "incomplete"

      • CreatedBy string

        The 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 []ResponseItemUnion

      A list of items used to generate this response.

      • type ResponseInputMessageItem struct{…}

        • ID string

          The unique ID of the message input.

        • Content ResponseInputMessageContentList

          A list of one or many input items to the model, containing different content types.

          • type ResponseInputText struct{…}

            A text input to the model.

            • Text string

              The text input to the model.

            • Type InputText

              The 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 ResponseInputImageDetail

              The detail level of the image to be sent to the model. One of high, low, auto, or original. Defaults to auto.

              • const ResponseInputImageDetailLow ResponseInputImageDetail = "low"

              • const ResponseInputImageDetailHigh ResponseInputImageDetail = "high"

              • const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto"

              • const ResponseInputImageDetailOriginal ResponseInputImageDetail = "original"

            • Type InputImage

              The type of the input item. Always input_image.

              • const InputImageInputImage InputImage = "input_image"
            • FileID string

              The ID of the file to be sent to the model.

            • ImageURL string

              The 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 InputFile

              The type of the input item. Always input_file.

              • const InputFileInputFile InputFile = "input_file"
            • Detail ResponseInputFileDetail

              The detail level of the file to be sent to the model. Use low for the default rendering behavior, or high to render the file at higher quality. Defaults to low.

              • const ResponseInputFileDetailLow ResponseInputFileDetail = "low"

              • const ResponseInputFileDetailHigh ResponseInputFileDetail = "high"

            • FileData string

              The content of the file to be sent to the model.

            • FileID string

              The ID of the file to be sent to the model.

            • FileURL string

              The URL of the file to be sent to the model.

            • Filename string

              The name of the file to be sent to the model.

        • Role ResponseInputMessageItemRole

          The role of the message input. One of user, system, or developer.

          • const ResponseInputMessageItemRoleUser ResponseInputMessageItemRole = "user"

          • const ResponseInputMessageItemRoleSystem ResponseInputMessageItemRole = "system"

          • const ResponseInputMessageItemRoleDeveloper ResponseInputMessageItemRole = "developer"

        • Type Message

          The type of the message input. Always set to message.

          • const MessageMessage Message = "message"
        • Status ResponseInputMessageItemStatus

          The status of item. One of in_progress, completed, or incomplete. 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 string

          The unique ID of the output message.

        • Content []ResponseOutputMessageContentUnion

          The content of the output message.

          • type ResponseOutputText struct{…}

            A text output from the model.

            • Annotations []ResponseOutputTextAnnotationUnion

              The annotations of the text output.

              • type ResponseOutputTextAnnotationFileCitation struct{…}

                A citation to a file.

                • FileID string

                  The ID of the file.

                • Filename string

                  The filename of the file cited.

                • Index int64

                  The index of the file in the list of files.

                • Type FileCitation

                  The 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 int64

                  The index of the last character of the URL citation in the message.

                • StartIndex int64

                  The index of the first character of the URL citation in the message.

                • Title string

                  The title of the web resource.

                • Type URLCitation

                  The type of the URL citation. Always url_citation.

                  • const URLCitationURLCitation URLCitation = "url_citation"
                • URL string

                  The URL of the web resource.

              • type ResponseOutputTextAnnotationContainerFileCitation struct{…}

                A citation for a container file used to generate a model response.

                • ContainerID string

                  The ID of the container file.

                • EndIndex int64

                  The index of the last character of the container file citation in the message.

                • FileID string

                  The ID of the file.

                • Filename string

                  The filename of the container file cited.

                • StartIndex int64

                  The index of the first character of the container file citation in the message.

                • Type ContainerFileCitation

                  The 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 string

                  The ID of the file.

                • Index int64

                  The index of the file in the list of files.

                • Type FilePath

                  The type of the file path. Always file_path.

                  • const FilePathFilePath FilePath = "file_path"
            • Text string

              The text output from the model.

            • Type OutputText

              The 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 string

              The refusal explanation from the model.

            • Type Refusal

              The type of the refusal. Always refusal.

              • const RefusalRefusal Refusal = "refusal"
        • Role Assistant

          The role of the output message. Always assistant.

          • const AssistantAssistant Assistant = "assistant"
        • Status ResponseOutputMessageStatus

          The status of the message input. One of in_progress, completed, or incomplete. Populated when input items are returned via API.

          • const ResponseOutputMessageStatusInProgress ResponseOutputMessageStatus = "in_progress"

          • const ResponseOutputMessageStatusCompleted ResponseOutputMessageStatus = "completed"

          • const ResponseOutputMessageStatusIncomplete ResponseOutputMessageStatus = "incomplete"

        • Type Message

          The type of the output message. Always message.

          • const MessageMessage Message = "message"
        • Phase ResponseOutputMessagePhase

          Labels an assistant message as intermediate commentary (commentary) or the final answer (final_answer). For models like gpt-5.3-codex and 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 string

          The unique ID of the file search tool call.

        • Queries []string

          The queries used to search for files.

        • Status ResponseFileSearchToolCallStatus

          The status of the file search tool call. One of in_progress, searching, incomplete or failed,

          • const ResponseFileSearchToolCallStatusInProgress ResponseFileSearchToolCallStatus = "in_progress"

          • const ResponseFileSearchToolCallStatusSearching ResponseFileSearchToolCallStatus = "searching"

          • const ResponseFileSearchToolCallStatusCompleted ResponseFileSearchToolCallStatus = "completed"

          • const ResponseFileSearchToolCallStatusIncomplete ResponseFileSearchToolCallStatus = "incomplete"

          • const ResponseFileSearchToolCallStatusFailed ResponseFileSearchToolCallStatus = "failed"

        • Type FileSearchCall

          The type of the file search tool call. Always file_search_call.

          • const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"
        • Results []ResponseFileSearchToolCallResult

          The 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 string

            The unique ID of the file.

          • Filename string

            The name of the file.

          • Score float64

            The relevance score of the file - a value between 0 and 1.

          • Text string

            The 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 string

          The unique ID of the computer call.

        • CallID string

          An identifier used when responding to the tool call with output.

        • PendingSafetyChecks []ResponseComputerToolCallPendingSafetyCheck

          The pending safety checks for the computer call.

          • ID string

            The ID of the pending safety check.

          • Code string

            The type of the pending safety check.

          • Message string

            Details about the pending safety check.

        • Status ResponseComputerToolCallStatus

          The status of the item. One of in_progress, completed, or incomplete. Populated when items are returned via API.

          • const ResponseComputerToolCallStatusInProgress ResponseComputerToolCallStatus = "in_progress"

          • const ResponseComputerToolCallStatusCompleted ResponseComputerToolCallStatus = "completed"

          • const ResponseComputerToolCallStatusIncomplete ResponseComputerToolCallStatus = "incomplete"

        • Type ResponseComputerToolCallType

          The type of the computer call. Always computer_call.

          • const ResponseComputerToolCallTypeComputerCall ResponseComputerToolCallType = "computer_call"
        • Action ResponseComputerToolCallActionUnion

          A click action.

          • type ResponseComputerToolCallActionClick struct{…}

            A click action.

            • Button string

              Indicates which mouse button was pressed during the click. One of left, right, wheel, back, or forward.

              • const ResponseComputerToolCallActionClickButtonLeft ResponseComputerToolCallActionClickButton = "left"

              • const ResponseComputerToolCallActionClickButtonRight ResponseComputerToolCallActionClickButton = "right"

              • const ResponseComputerToolCallActionClickButtonWheel ResponseComputerToolCallActionClickButton = "wheel"

              • const ResponseComputerToolCallActionClickButtonBack ResponseComputerToolCallActionClickButton = "back"

              • const ResponseComputerToolCallActionClickButtonForward ResponseComputerToolCallActionClickButton = "forward"

            • Type Click

              Specifies the event type. For a click action, this property is always click.

              • const ClickClick Click = "click"
            • X int64

              The x-coordinate where the click occurred.

            • Y int64

              The y-coordinate where the click occurred.

            • Keys []string

              The keys being held while clicking.

          • type ResponseComputerToolCallActionDoubleClick struct{…}

            A double click action.

            • Keys []string

              The keys being held while double-clicking.

            • Type DoubleClick

              Specifies the event type. For a double click action, this property is always set to double_click.

              • const DoubleClickDoubleClick DoubleClick = "double_click"
            • X int64

              The x-coordinate where the double click occurred.

            • Y int64

              The y-coordinate where the double click occurred.

          • type ResponseComputerToolCallActionDrag struct{…}

            A drag action.

            • Path []ResponseComputerToolCallActionDragPath

              An 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 int64

                The x-coordinate.

              • Y int64

                The y-coordinate.

            • Type Drag

              Specifies the event type. For a drag action, this property is always set to drag.

              • const DragDrag Drag = "drag"
            • Keys []string

              The keys being held while dragging the mouse.

          • type ResponseComputerToolCallActionKeypress struct{…}

            A collection of keypresses the model would like to perform.

            • Keys []string

              The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.

            • Type Keypress

              Specifies 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 Move

              Specifies the event type. For a move action, this property is always set to move.

              • const MoveMove Move = "move"
            • X int64

              The x-coordinate to move to.

            • Y int64

              The y-coordinate to move to.

            • Keys []string

              The keys being held while moving the mouse.

          • type ResponseComputerToolCallActionScreenshot struct{…}

            A screenshot action.

            • Type Screenshot

              Specifies 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 int64

              The horizontal scroll distance.

            • ScrollY int64

              The vertical scroll distance.

            • Type Scroll

              Specifies the event type. For a scroll action, this property is always set to scroll.

              • const ScrollScroll Scroll = "scroll"
            • X int64

              The x-coordinate where the scroll occurred.

            • Y int64

              The y-coordinate where the scroll occurred.

            • Keys []string

              The keys being held while scrolling.

          • type ResponseComputerToolCallActionType struct{…}

            An action to type in text.

            • Text string

              The text to type.

            • Type Type

              Specifies 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 Wait

              Specifies the event type. For a wait action, this property is always set to wait.

              • const WaitWait Wait = "wait"
        • Actions ComputerActionList

          Flattened batched actions for computer_use. Each action includes an type discriminator and action-specific fields.

          • type ComputerActionClick struct{…}

            A click action.

            • Button string

              Indicates which mouse button was pressed during the click. One of left, right, wheel, back, or forward.

              • const ComputerActionClickButtonLeft ComputerActionClickButton = "left"

              • const ComputerActionClickButtonRight ComputerActionClickButton = "right"

              • const ComputerActionClickButtonWheel ComputerActionClickButton = "wheel"

              • const ComputerActionClickButtonBack ComputerActionClickButton = "back"

              • const ComputerActionClickButtonForward ComputerActionClickButton = "forward"

            • Type Click

              Specifies the event type. For a click action, this property is always click.

              • const ClickClick Click = "click"
            • X int64

              The x-coordinate where the click occurred.

            • Y int64

              The y-coordinate where the click occurred.

            • Keys []string

              The keys being held while clicking.

          • type ComputerActionDoubleClick struct{…}

            A double click action.

            • Keys []string

              The keys being held while double-clicking.

            • Type DoubleClick

              Specifies the event type. For a double click action, this property is always set to double_click.

              • const DoubleClickDoubleClick DoubleClick = "double_click"
            • X int64

              The x-coordinate where the double click occurred.

            • Y int64

              The y-coordinate where the double click occurred.

          • type ComputerActionDrag struct{…}

            A drag action.

            • Path []ComputerActionDragPath

              An 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 int64

                The x-coordinate.

              • Y int64

                The y-coordinate.

            • Type Drag

              Specifies the event type. For a drag action, this property is always set to drag.

              • const DragDrag Drag = "drag"
            • Keys []string

              The keys being held while dragging the mouse.

          • type ComputerActionKeypress struct{…}

            A collection of keypresses the model would like to perform.

            • Keys []string

              The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.

            • Type Keypress

              Specifies 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 Move

              Specifies the event type. For a move action, this property is always set to move.

              • const MoveMove Move = "move"
            • X int64

              The x-coordinate to move to.

            • Y int64

              The y-coordinate to move to.

            • Keys []string

              The keys being held while moving the mouse.

          • type ComputerActionScreenshot struct{…}

            A screenshot action.

            • Type Screenshot

              Specifies 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 int64

              The horizontal scroll distance.

            • ScrollY int64

              The vertical scroll distance.

            • Type Scroll

              Specifies the event type. For a scroll action, this property is always set to scroll.

              • const ScrollScroll Scroll = "scroll"
            • X int64

              The x-coordinate where the scroll occurred.

            • Y int64

              The y-coordinate where the scroll occurred.

            • Keys []string

              The keys being held while scrolling.

          • type ComputerActionType struct{…}

            An action to type in text.

            • Text string

              The text to type.

            • Type Type

              Specifies 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 Wait

              Specifies the event type. For a wait action, this property is always set to wait.

              • const WaitWait Wait = "wait"
      • type ResponseComputerToolCallOutputItem struct{…}

        • ID string

          The unique ID of the computer call tool output.

        • CallID string

          The ID of the computer tool call that produced the output.

        • Output ResponseComputerToolCallOutputScreenshot

          A computer screenshot image used with the computer use tool.

          • Type ComputerScreenshot

            Specifies the event type. For a computer screenshot, this property is always set to computer_screenshot.

            • const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"
          • FileID string

            The identifier of an uploaded file that contains the screenshot.

          • ImageURL string

            The URL of the screenshot image.

        • Status ResponseComputerToolCallOutputItemStatus

          The status of the message input. One of in_progress, completed, or incomplete. 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 ComputerCallOutput

          The type of the computer tool call output. Always computer_call_output.

          • const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"
        • AcknowledgedSafetyChecks []ResponseComputerToolCallOutputItemAcknowledgedSafetyCheck

          The safety checks reported by the API that have been acknowledged by the developer.

          • ID string

            The ID of the pending safety check.

          • Code string

            The type of the pending safety check.

          • Message string

            Details about the pending safety check.

        • CreatedBy string

          The 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 string

          The unique ID of the web search tool call.

        • Action ResponseFunctionWebSearchActionUnion

          An 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 Search

              The action type.

              • const SearchSearch Search = "search"
            • Queries []string

              The search queries.

            • Query string

              The search query.

            • Sources []ResponseFunctionWebSearchActionSearchSource

              The sources used in the search.

              • Type URL

                The type of source. Always url.

                • const URLURL URL = "url"
              • URL string

                The URL of the source.

          • type ResponseFunctionWebSearchActionOpenPage struct{…}

            Action type "open_page" - Opens a specific URL from search results.

            • Type OpenPage

              The action type.

              • const OpenPageOpenPage OpenPage = "open_page"
            • URL string

              The URL opened by the model.

          • type ResponseFunctionWebSearchActionFindInPage struct{…}

            Action type "find_in_page": Searches for a pattern within a loaded page.

            • Pattern string

              The pattern or text to search for within the page.

            • Type FindInPage

              The action type.

              • const FindInPageFindInPage FindInPage = "find_in_page"
            • URL string

              The URL of the page searched for the pattern.

        • Status ResponseFunctionWebSearchStatus

          The 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 WebSearchCall

          The 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 string

          The unique ID of the function tool call.

        • Status string

          The status of the item. One of in_progress, completed, or incomplete. Populated when items are returned via API.

          • const ResponseFunctionToolCallItemStatusInProgress ResponseFunctionToolCallItemStatus = "in_progress"

          • const ResponseFunctionToolCallItemStatusCompleted ResponseFunctionToolCallItemStatus = "completed"

          • const ResponseFunctionToolCallItemStatusIncomplete ResponseFunctionToolCallItemStatus = "incomplete"

        • CreatedBy string

          The identifier of the actor that created the item.

      • type ResponseFunctionToolCallOutputItem struct{…}

        • ID string

          The unique ID of the function call tool output.

        • CallID string

          The unique ID of the function tool call generated by the model.

        • Output ResponseFunctionToolCallOutputItemOutputUnion

          The output from the function call generated by your code. Can be a string or an list of output content.

          • string

          • type ResponseFunctionToolCallOutputItemOutputOutputContentList []ResponseFunctionToolCallOutputItemOutputOutputContentListItemUnion

            Text, 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 ResponseFunctionToolCallOutputItemStatus

          The status of the item. One of in_progress, completed, or incomplete. Populated when items are returned via API.

          • const ResponseFunctionToolCallOutputItemStatusInProgress ResponseFunctionToolCallOutputItemStatus = "in_progress"

          • const ResponseFunctionToolCallOutputItemStatusCompleted ResponseFunctionToolCallOutputItemStatus = "completed"

          • const ResponseFunctionToolCallOutputItemStatusIncomplete ResponseFunctionToolCallOutputItemStatus = "incomplete"

        • Type FunctionCallOutput

          The type of the function tool call output. Always function_call_output.

          • const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"
        • CreatedBy string

          The identifier of the actor that created the item.

      • type ResponseToolSearchCall struct{…}

        • ID string

          The unique ID of the tool search call item.

        • Arguments any

          Arguments used for the tool search call.

        • CallID string

          The unique ID of the tool search call generated by the model.

        • Execution ResponseToolSearchCallExecution

          Whether tool search was executed by the server or by the client.

          • const ResponseToolSearchCallExecutionServer ResponseToolSearchCallExecution = "server"

          • const ResponseToolSearchCallExecutionClient ResponseToolSearchCallExecution = "client"

        • Status ResponseToolSearchCallStatus

          The status of the tool search call item that was recorded.

          • const ResponseToolSearchCallStatusInProgress ResponseToolSearchCallStatus = "in_progress"

          • const ResponseToolSearchCallStatusCompleted ResponseToolSearchCallStatus = "completed"

          • const ResponseToolSearchCallStatusIncomplete ResponseToolSearchCallStatus = "incomplete"

        • Type ToolSearchCall

          The type of the item. Always tool_search_call.

          • const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"
        • CreatedBy string

          The identifier of the actor that created the item.

      • type ResponseToolSearchOutputItem struct{…}

        • ID string

          The unique ID of the tool search output item.

        • CallID string

          The unique ID of the tool search call generated by the model.

        • Execution ResponseToolSearchOutputItemExecution

          Whether tool search was executed by the server or by the client.

          • const ResponseToolSearchOutputItemExecutionServer ResponseToolSearchOutputItemExecution = "server"

          • const ResponseToolSearchOutputItemExecutionClient ResponseToolSearchOutputItemExecution = "client"

        • Status ResponseToolSearchOutputItemStatus

          The status of the tool search output item that was recorded.

          • const ResponseToolSearchOutputItemStatusInProgress ResponseToolSearchOutputItemStatus = "in_progress"

          • const ResponseToolSearchOutputItemStatusCompleted ResponseToolSearchOutputItemStatus = "completed"

          • const ResponseToolSearchOutputItemStatusIncomplete ResponseToolSearchOutputItemStatus = "incomplete"

        • Tools []ToolUnion

          The 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 string

              The name of the function to call.

            • Parameters map[string, any]

              A JSON schema object describing the parameters of the function.

            • Strict bool

              Whether to enforce strict parameter validation. Default true.

            • Type Function

              The type of the function tool. Always function.

              • const FunctionFunction Function = "function"
            • DeferLoading bool

              Whether this function is deferred and loaded via tool search.

            • Description string

              A 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 FileSearch

              The type of the file search tool. Always file_search.

              • const FileSearchFileSearch FileSearch = "file_search"
            • VectorStoreIDs []string

              The IDs of the vector stores to search.

            • Filters FileSearchToolFiltersUnion

              A 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 string

                  The key to compare against the value.

                • Type ComparisonFilterType

                  Specifies 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 ComparisonFilterValueUnion

                  The 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 and or or.

                • Filters []ComparisonFilter

                  Array of filters to combine. Items can be ComparisonFilter or CompoundFilter.

                  • type ComparisonFilter struct{…}

                    A filter used to compare a specified attribute key to a given value using a defined comparison operation.

                • Type CompoundFilterType

                  Type of operation: and or or.

                  • const CompoundFilterTypeAnd CompoundFilterType = "and"

                  • const CompoundFilterTypeOr CompoundFilterType = "or"

            • MaxNumResults int64

              The maximum number of results to return. This number should be between 1 and 50 inclusive.

            • RankingOptions FileSearchToolRankingOptions

              Ranking options for search.

              • HybridSearch FileSearchToolRankingOptionsHybridSearch

                Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.

                • EmbeddingWeight float64

                  The weight of the embedding in the reciprocal ranking fusion.

                • TextWeight float64

                  The weight of the text in the reciprocal ranking fusion.

              • Ranker string

                The ranker to use for the file search.

                • const FileSearchToolRankingOptionsRankerAuto FileSearchToolRankingOptionsRanker = "auto"

                • const FileSearchToolRankingOptionsRankerDefault2024_11_15 FileSearchToolRankingOptionsRanker = "default-2024-11-15"

              • ScoreThreshold float64

                The 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 Computer

              The 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 int64

              The height of the computer display.

            • DisplayWidth int64

              The width of the computer display.

            • Environment ComputerUsePreviewToolEnvironment

              The 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 ComputerUsePreview

              The 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 WebSearchToolType

              The type of the web search tool. One of web_search or web_search_2025_08_26.

              • const WebSearchToolTypeWebSearch WebSearchToolType = "web_search"

              • const WebSearchToolTypeWebSearch2025_08_26 WebSearchToolType = "web_search_2025_08_26"

            • Filters WebSearchToolFilters

              Filters for the search.

              • AllowedDomains []string

                Allowed 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 WebSearchToolSearchContextSize

              High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default.

              • const WebSearchToolSearchContextSizeLow WebSearchToolSearchContextSize = "low"

              • const WebSearchToolSearchContextSizeMedium WebSearchToolSearchContextSize = "medium"

              • const WebSearchToolSearchContextSizeHigh WebSearchToolSearchContextSize = "high"

            • UserLocation WebSearchToolUserLocation

              The approximate location of the user.

              • City string

                Free text input for the city of the user, e.g. San Francisco.

              • Country string

                The two-letter ISO country code of the user, e.g. US.

              • Region string

                Free text input for the region of the user, e.g. California.

              • Timezone string

                The IANA timezone of the user, e.g. America/Los_Angeles.

              • Type string

                The 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 string

              A label for this MCP server, used to identify it in tool calls.

            • Type Mcp

              The type of the MCP tool. Always mcp.

              • const McpMcp Mcp = "mcp"
            • AllowedTools ToolMcpAllowedToolsUnion

              List of allowed tool names or a filter object.

              • type ToolMcpAllowedToolsMcpAllowedTools []string

                A string array of allowed tool names

              • type ToolMcpAllowedToolsMcpToolFilter struct{…}

                A filter object to specify which tools are allowed.

                • ReadOnly bool

                  Indicates 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 []string

                  List of allowed tool names.

            • Authorization string

              An 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 string

              Identifier for service connectors, like those available in ChatGPT. One of server_url, connector_id, or tunnel_id must be provided. Learn more about service connectors here.

              Currently supported connector_id values 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 bool

              Whether 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 ToolMcpRequireApprovalUnion

              Specify 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 ToolMcpRequireApprovalMcpToolApprovalFilterAlways

                  A filter object to specify which tools are allowed.

                  • ReadOnly bool

                    Indicates 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 []string

                    List of allowed tool names.

                • Never ToolMcpRequireApprovalMcpToolApprovalFilterNever

                  A filter object to specify which tools are allowed.

                  • ReadOnly bool

                    Indicates 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 []string

                    List of allowed tool names.

              • type ToolMcpRequireApprovalMcpToolApprovalSetting string

                Specify a single approval policy for all tools. One of always or never. When set to always, all tools will require approval. When set to never, all tools will not require approval.

                • const ToolMcpRequireApprovalMcpToolApprovalSettingAlways ToolMcpRequireApprovalMcpToolApprovalSetting = "always"

                • const ToolMcpRequireApprovalMcpToolApprovalSettingNever ToolMcpRequireApprovalMcpToolApprovalSetting = "never"

            • ServerDescription string

              Optional description of the MCP server, used to provide more context.

            • ServerURL string

              The URL for the MCP server. One of server_url, connector_id, or tunnel_id must be provided.

            • TunnelID string

              The Secure MCP Tunnel ID to use instead of a direct server URL. One of server_url, connector_id, or tunnel_id must be provided.

          • type ToolCodeInterpreter struct{…}

            A tool that runs Python code to help generate a response to a prompt.

            • Container ToolCodeInterpreterContainerUnion

              The 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_limit setting.

              • string

              • type ToolCodeInterpreterContainerCodeInterpreterContainerAuto struct{…}

                Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.

                • Type Auto

                  Always auto.

                  • const AutoAuto Auto = "auto"
                • FileIDs []string

                  An optional list of uploaded files to make available to your code.

                • MemoryLimit string

                  The memory limit for the code interpreter container.

                  • const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g"

                  • const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g"

                  • const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g"

                  • const ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g ToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"

                • NetworkPolicy ToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnion

                  Network access policy for the container.

                  • type ContainerNetworkPolicyDisabled struct{…}

                    • Type Disabled

                      Disable outbound network access. Always disabled.

                      • const DisabledDisabled Disabled = "disabled"
                  • type ContainerNetworkPolicyAllowlist struct{…}

                    • AllowedDomains []string

                      A list of allowed domains when type is allowlist.

                    • Type Allowlist

                      Allow outbound network access only to specified domains. Always allowlist.

                      • const AllowlistAllowlist Allowlist = "allowlist"
                    • DomainSecrets []ContainerNetworkPolicyDomainSecret

                      Optional domain-scoped secrets for allowlisted domains.

                      • Domain string

                        The domain associated with the secret.

                      • Name string

                        The name of the secret to inject for the domain.

                      • Value string

                        The secret value to inject for the domain.

            • Type CodeInterpreter

              The 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 ImageGeneration

              The type of the image generation tool. Always image_generation.

              • const ImageGenerationImageGeneration ImageGeneration = "image_generation"
            • Action string

              Whether 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 string

              Allows 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, or auto (default value). When auto is used, the model will automatically determine the best background for the image.

              gpt-image-2 and gpt-image-2-2026-04-21 do not support transparent backgrounds. Requests with background set to transparent will return an error for these models; use opaque or auto instead.

              If transparent, the output format needs to support transparency, so it should be set to either png (default value) or webp.

              • const ToolImageGenerationBackgroundTransparent ToolImageGenerationBackground = "transparent"

              • const ToolImageGenerationBackgroundOpaque ToolImageGenerationBackground = "opaque"

              • const ToolImageGenerationBackgroundAuto ToolImageGenerationBackground = "auto"

            • InputFidelity string

              Control 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-1 and gpt-image-1.5 and later models, unsupported for gpt-image-1-mini. Supports high and low. Defaults to low.

              • const ToolImageGenerationInputFidelityHigh ToolImageGenerationInputFidelity = "high"

              • const ToolImageGenerationInputFidelityLow ToolImageGenerationInputFidelity = "low"

            • InputImageMask ToolImageGenerationInputImageMask

              Optional mask for inpainting. Contains image_url (string, optional) and file_id (string, optional).

              • FileID string

                File ID for the mask image.

              • ImageURL string

                Base64-encoded mask image.

            • Model string

              The 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 string

              Moderation level for the generated image. Default: auto.

              • const ToolImageGenerationModerationAuto ToolImageGenerationModeration = "auto"

              • const ToolImageGenerationModerationLow ToolImageGenerationModeration = "low"

            • OutputCompression int64

              Compression level for the output image. Default: 100.

            • OutputFormat string

              The output format of the generated image. One of png, webp, or jpeg. Default: png.

              • const ToolImageGenerationOutputFormatPNG ToolImageGenerationOutputFormat = "png"

              • const ToolImageGenerationOutputFormatWebP ToolImageGenerationOutputFormat = "webp"

              • const ToolImageGenerationOutputFormatJPEG ToolImageGenerationOutputFormat = "jpeg"

            • PartialImages int64

              Number of partial images to generate in streaming mode, from 0 (default value) to 3.

            • Quality string

              The quality of the generated image. One of low, medium, high, or auto. Default: auto.

              • const ToolImageGenerationQualityLow ToolImageGenerationQuality = "low"

              • const ToolImageGenerationQualityMedium ToolImageGenerationQuality = "medium"

              • const ToolImageGenerationQualityHigh ToolImageGenerationQuality = "high"

              • const ToolImageGenerationQualityAuto ToolImageGenerationQuality = "auto"

            • Size string

              The size of the generated images. For gpt-image-2 and gpt-image-2-2026-04-21, arbitrary resolutions are supported as WIDTHxHEIGHT strings, for example 1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above 2560x1440 are experimental, and the maximum supported resolution is 3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes 1024x1024, 1536x1024, and 1024x1536 are supported by the GPT image models; auto is supported for models that allow automatic sizing. For dall-e-2, use one of 256x256, 512x512, or 1024x1024. For dall-e-3, use one of 1024x1024, 1792x1024, or 1024x1792.

              • 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 LocalShell

              The 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 Shell

              The type of the shell tool. Always shell.

              • const ShellShell Shell = "shell"
            • Environment FunctionShellToolEnvironmentUnion

              • type ContainerAuto struct{…}

                • Type ContainerAuto

                  Automatically creates a container for this request

                  • const ContainerAutoContainerAuto ContainerAuto = "container_auto"
                • FileIDs []string

                  An optional list of uploaded files to make available to your code.

                • MemoryLimit ContainerAutoMemoryLimit

                  The memory limit for the container.

                  • const ContainerAutoMemoryLimit1g ContainerAutoMemoryLimit = "1g"

                  • const ContainerAutoMemoryLimit4g ContainerAutoMemoryLimit = "4g"

                  • const ContainerAutoMemoryLimit16g ContainerAutoMemoryLimit = "16g"

                  • const ContainerAutoMemoryLimit64g ContainerAutoMemoryLimit = "64g"

                • NetworkPolicy ContainerAutoNetworkPolicyUnion

                  Network access policy for the container.

                  • type ContainerNetworkPolicyDisabled struct{…}

                  • type ContainerNetworkPolicyAllowlist struct{…}

                • Skills []ContainerAutoSkillUnion

                  An optional list of skills referenced by id or inline data.

                  • type SkillReference struct{…}

                    • SkillID string

                      The ID of the referenced skill.

                    • Type SkillReference

                      References a skill created with the /v1/skills endpoint.

                      • const SkillReferenceSkillReference SkillReference = "skill_reference"
                    • Version string

                      Optional skill version. Use a positive integer or 'latest'. Omit for default.

                  • type InlineSkill struct{…}

                    • Description string

                      The description of the skill.

                    • Name string

                      The name of the skill.

                    • Source InlineSkillSource

                      Inline skill payload

                      • Data string

                        Base64-encoded skill zip bundle.

                      • MediaType ApplicationZip

                        The media type of the inline skill payload. Must be application/zip.

                        • const ApplicationZipApplicationZip ApplicationZip = "application/zip"
                      • Type Base64

                        The type of the inline skill source. Must be base64.

                        • const Base64Base64 Base64 = "base64"
                    • Type Inline

                      Defines an inline skill for this request.

                      • const InlineInline Inline = "inline"
              • type LocalEnvironment struct{…}

                • Type Local

                  Use a local computer environment.

                  • const LocalLocal Local = "local"
                • Skills []LocalSkill

                  An optional list of skills.

                  • Description string

                    The description of the skill.

                  • Name string

                    The name of the skill.

                  • Path string

                    The path to the directory containing the skill.

              • type ContainerReference struct{…}

                • ContainerID string

                  The ID of the referenced container.

                • Type ContainerReference

                  References 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 string

              The name of the custom tool, used to identify it in tool calls.

            • Type Custom

              The type of the custom tool. Always custom.

              • const CustomCustom Custom = "custom"
            • DeferLoading bool

              Whether this tool should be deferred and discovered via tool search.

            • Description string

              Optional description of the custom tool, used to provide more context.

            • Format CustomToolInputFormatUnion

              The input format for the custom tool. Default is unconstrained text.

              • type CustomToolInputFormatText struct{…}

                Unconstrained free-form text.

                • Type Text

                  Unconstrained text format. Always text.

                  • const TextText Text = "text"
              • type CustomToolInputFormatGrammar struct{…}

                A grammar defined by the user.

                • Definition string

                  The grammar definition.

                • Syntax string

                  The syntax of the grammar definition. One of lark or regex.

                  • const CustomToolInputFormatGrammarSyntaxLark CustomToolInputFormatGrammarSyntax = "lark"

                  • const CustomToolInputFormatGrammarSyntaxRegex CustomToolInputFormatGrammarSyntax = "regex"

                • Type Grammar

                  Grammar format. Always grammar.

                  • const GrammarGrammar Grammar = "grammar"
          • type NamespaceTool struct{…}

            Groups function/custom tools under a shared namespace.

            • Description string

              A description of the namespace shown to the model.

            • Name string

              The namespace name used in tool calls (for example, crm).

            • Tools []NamespaceToolToolUnion

              The function/custom tools available inside this namespace.

              • type NamespaceToolToolFunction struct{…}

                • Name string

                • Type Function

                  • const FunctionFunction Function = "function"
                • DeferLoading bool

                  Whether 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 Namespace

              The type of the tool. Always namespace.

              • const NamespaceNamespace Namespace = "namespace"
          • type ToolSearchTool struct{…}

            Hosted or BYOT tool search configuration for deferred tools.

            • Type ToolSearch

              The type of the tool. Always tool_search.

              • const ToolSearchToolSearch ToolSearch = "tool_search"
            • Description string

              Description shown to the model for a client-executed tool search tool.

            • Execution ToolSearchToolExecution

              Whether tool search is executed by the server or by the client.

              • const ToolSearchToolExecutionServer ToolSearchToolExecution = "server"

              • const ToolSearchToolExecutionClient ToolSearchToolExecution = "client"

            • Parameters any

              Parameter 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 WebSearchPreviewToolType

              The type of the web search tool. One of web_search_preview or web_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 WebSearchPreviewToolSearchContextSize

              High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default.

              • const WebSearchPreviewToolSearchContextSizeLow WebSearchPreviewToolSearchContextSize = "low"

              • const WebSearchPreviewToolSearchContextSizeMedium WebSearchPreviewToolSearchContextSize = "medium"

              • const WebSearchPreviewToolSearchContextSizeHigh WebSearchPreviewToolSearchContextSize = "high"

            • UserLocation WebSearchPreviewToolUserLocation

              The user's location.

              • Type Approximate

                The type of location approximation. Always approximate.

                • const ApproximateApproximate Approximate = "approximate"
              • City string

                Free text input for the city of the user, e.g. San Francisco.

              • Country string

                The two-letter ISO country code of the user, e.g. US.

              • Region string

                Free text input for the region of the user, e.g. California.

              • Timezone string

                The 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 ApplyPatch

              The type of the tool. Always apply_patch.

              • const ApplyPatchApplyPatch ApplyPatch = "apply_patch"
        • Type ToolSearchOutput

          The type of the item. Always tool_search_output.

          • const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"
        • CreatedBy string

          The identifier of the actor that created the item.

      • type ResponseItemAdditionalTools struct{…}

        • ID string

          The unique ID of the additional tools item.

        • Role string

          The 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 []ToolUnion

          The 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 AdditionalTools

          The 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 input to the Responses API for subsequent turns of a conversation if you are manually managing context.

        • ID string

          The unique identifier of the reasoning content.

        • Summary []ResponseReasoningItemSummary

          Reasoning summary content.

          • Text string

            A summary of the reasoning output from the model so far.

          • Type SummaryText

            The type of the object. Always summary_text.

            • const SummaryTextSummaryText SummaryText = "summary_text"
        • Type Reasoning

          The type of the object. Always reasoning.

          • const ReasoningReasoning Reasoning = "reasoning"
        • Content []ResponseReasoningItemContent

          Reasoning text content.

          • Text string

            The reasoning text from the model.

          • Type ReasoningText

            The type of the reasoning text. Always reasoning_text.

            • const ReasoningTextReasoningText ReasoningText = "reasoning_text"
        • EncryptedContent string

          The encrypted content of the reasoning item - populated when a response is generated with reasoning.encrypted_content in the include parameter.

        • Status ResponseReasoningItemStatus

          The status of the item. One of in_progress, completed, or incomplete. 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/compact API.

        • ID string

          The unique ID of the compaction item.

        • EncryptedContent string

          The encrypted content that was produced by compaction.

        • Type Compaction

          The type of the item. Always compaction.

          • const CompactionCompaction Compaction = "compaction"
        • CreatedBy string

          The identifier of the actor that created the item.

      • type ResponseItemImageGenerationCall struct{…}

        An image generation request made by the model.

        • ID string

          The unique ID of the image generation call.

        • Result string

          The generated image encoded in base64.

        • Status string

          The status of the image generation call.

          • const ResponseItemImageGenerationCallStatusInProgress ResponseItemImageGenerationCallStatus = "in_progress"

          • const ResponseItemImageGenerationCallStatusCompleted ResponseItemImageGenerationCallStatus = "completed"

          • const ResponseItemImageGenerationCallStatusGenerating ResponseItemImageGenerationCallStatus = "generating"

          • const ResponseItemImageGenerationCallStatusFailed ResponseItemImageGenerationCallStatus = "failed"

        • Type ImageGenerationCall

          The 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 string

          The unique ID of the code interpreter tool call.

        • Code string

          The code to run, or null if not available.

        • ContainerID string

          The ID of the container used to run the code.

        • Outputs []ResponseCodeInterpreterToolCallOutputUnion

          The 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 string

              The logs output from the code interpreter.

            • Type Logs

              The type of the output. Always logs.

              • const LogsLogs Logs = "logs"
          • type ResponseCodeInterpreterToolCallOutputImage struct{…}

            The image output from the code interpreter.

            • Type Image

              The type of the output. Always image.

              • const ImageImage Image = "image"
            • URL string

              The URL of the image output from the code interpreter.

        • Status ResponseCodeInterpreterToolCallStatus

          The status of the code interpreter tool call. Valid values are in_progress, completed, incomplete, interpreting, and failed.

          • const ResponseCodeInterpreterToolCallStatusInProgress ResponseCodeInterpreterToolCallStatus = "in_progress"

          • const ResponseCodeInterpreterToolCallStatusCompleted ResponseCodeInterpreterToolCallStatus = "completed"

          • const ResponseCodeInterpreterToolCallStatusIncomplete ResponseCodeInterpreterToolCallStatus = "incomplete"

          • const ResponseCodeInterpreterToolCallStatusInterpreting ResponseCodeInterpreterToolCallStatus = "interpreting"

          • const ResponseCodeInterpreterToolCallStatusFailed ResponseCodeInterpreterToolCallStatus = "failed"

        • Type CodeInterpreterCall

          The 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 string

          The unique ID of the local shell call.

        • Action ResponseItemLocalShellCallAction

          Execute a shell command on the server.

          • Command []string

            The command to run.

          • Env map[string, string]

            Environment variables to set for the command.

          • Type Exec

            The type of the local shell action. Always exec.

            • const ExecExec Exec = "exec"
          • TimeoutMs int64

            Optional timeout in milliseconds for the command.

          • User string

            Optional user to run the command as.

          • WorkingDirectory string

            Optional working directory to run the command in.

        • CallID string

          The unique ID of the local shell tool call generated by the model.

        • Status string

          The status of the local shell call.

          • const ResponseItemLocalShellCallStatusInProgress ResponseItemLocalShellCallStatus = "in_progress"

          • const ResponseItemLocalShellCallStatusCompleted ResponseItemLocalShellCallStatus = "completed"

          • const ResponseItemLocalShellCallStatusIncomplete ResponseItemLocalShellCallStatus = "incomplete"

        • Type LocalShellCall

          The 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 string

          The unique ID of the local shell tool call generated by the model.

        • Output string

          A JSON string of the output of the local shell tool call.

        • Type LocalShellCallOutput

          The type of the local shell tool call output. Always local_shell_call_output.

          • const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"
        • Status string

          The status of the item. One of in_progress, completed, or incomplete.

          • 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 string

          The unique ID of the shell tool call. Populated when this item is returned via API.

        • Action ResponseFunctionShellToolCallAction

          The shell commands and limits that describe how to run the tool call.

          • Commands []string

          • MaxOutputLength int64

            Optional maximum number of characters to return from each command.

          • TimeoutMs int64

            Optional timeout in milliseconds for the commands.

        • CallID string

          The unique ID of the shell tool call generated by the model.

        • Environment ResponseFunctionShellToolCallEnvironmentUnion

          Represents 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 Local

              The environment type. Always local.

              • const LocalLocal Local = "local"
          • type ResponseContainerReference struct{…}

            Represents a container created with /v1/containers.

            • ContainerID string

            • Type ContainerReference

              The environment type. Always container_reference.

              • const ContainerReferenceContainerReference ContainerReference = "container_reference"
        • Status ResponseFunctionShellToolCallStatus

          The status of the shell call. One of in_progress, completed, or incomplete.

          • const ResponseFunctionShellToolCallStatusInProgress ResponseFunctionShellToolCallStatus = "in_progress"

          • const ResponseFunctionShellToolCallStatusCompleted ResponseFunctionShellToolCallStatus = "completed"

          • const ResponseFunctionShellToolCallStatusIncomplete ResponseFunctionShellToolCallStatus = "incomplete"

        • Type ShellCall

          The type of the item. Always shell_call.

          • const ShellCallShellCall ShellCall = "shell_call"
        • CreatedBy string

          The ID of the entity that created this tool call.

      • type ResponseFunctionShellToolCallOutput struct{…}

        The output of a shell tool call that was emitted.

        • ID string

          The unique ID of the shell call output. Populated when this item is returned via API.

        • CallID string

          The unique ID of the shell tool call generated by the model.

        • MaxOutputLength int64

          The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.

        • Output []ResponseFunctionShellToolCallOutputOutput

          An array of shell call output contents

          • Outcome ResponseFunctionShellToolCallOutputOutputOutcomeUnion

            Represents 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 Timeout

                The outcome type. Always timeout.

                • const TimeoutTimeout Timeout = "timeout"
            • type ResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}

              Indicates that the shell commands finished and returned an exit code.

              • ExitCode int64

                Exit code from the shell process.

              • Type Exit

                The outcome type. Always exit.

                • const ExitExit Exit = "exit"
          • Stderr string

            The standard error output that was captured.

          • Stdout string

            The standard output that was captured.

          • CreatedBy string

            The identifier of the actor that created the item.

        • Status ResponseFunctionShellToolCallOutputStatus

          The status of the shell call output. One of in_progress, completed, or incomplete.

          • const ResponseFunctionShellToolCallOutputStatusInProgress ResponseFunctionShellToolCallOutputStatus = "in_progress"

          • const ResponseFunctionShellToolCallOutputStatusCompleted ResponseFunctionShellToolCallOutputStatus = "completed"

          • const ResponseFunctionShellToolCallOutputStatusIncomplete ResponseFunctionShellToolCallOutputStatus = "incomplete"

        • Type ShellCallOutput

          The type of the shell call output. Always shell_call_output.

          • const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"
        • CreatedBy string

          The 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 string

          The unique ID of the apply patch tool call. Populated when this item is returned via API.

        • CallID string

          The unique ID of the apply patch tool call generated by the model.

        • Operation ResponseApplyPatchToolCallOperationUnion

          One 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 string

              Diff to apply.

            • Path string

              Path of the file to create.

            • Type CreateFile

              Create 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 string

              Path of the file to delete.

            • Type DeleteFile

              Delete the specified file.

              • const DeleteFileDeleteFile DeleteFile = "delete_file"
          • type ResponseApplyPatchToolCallOperationUpdateFile struct{…}

            Instruction describing how to update a file via the apply_patch tool.

            • Diff string

              Diff to apply.

            • Path string

              Path of the file to update.

            • Type UpdateFile

              Update an existing file with the provided diff.

              • const UpdateFileUpdateFile UpdateFile = "update_file"
        • Status ResponseApplyPatchToolCallStatus

          The status of the apply patch tool call. One of in_progress or completed.

          • const ResponseApplyPatchToolCallStatusInProgress ResponseApplyPatchToolCallStatus = "in_progress"

          • const ResponseApplyPatchToolCallStatusCompleted ResponseApplyPatchToolCallStatus = "completed"

        • Type ApplyPatchCall

          The type of the item. Always apply_patch_call.

          • const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"
        • CreatedBy string

          The ID of the entity that created this tool call.

      • type ResponseApplyPatchToolCallOutput struct{…}

        The output emitted by an apply patch tool call.

        • ID string

          The unique ID of the apply patch tool call output. Populated when this item is returned via API.

        • CallID string

          The unique ID of the apply patch tool call generated by the model.

        • Status ResponseApplyPatchToolCallOutputStatus

          The status of the apply patch tool call output. One of completed or failed.

          • const ResponseApplyPatchToolCallOutputStatusCompleted ResponseApplyPatchToolCallOutputStatus = "completed"

          • const ResponseApplyPatchToolCallOutputStatusFailed ResponseApplyPatchToolCallOutputStatus = "failed"

        • Type ApplyPatchCallOutput

          The type of the item. Always apply_patch_call_output.

          • const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"
        • CreatedBy string

          The ID of the entity that created this tool call output.

        • Output string

          Optional textual output returned by the apply patch tool.

      • type ResponseItemMcpListTools struct{…}

        A list of tools available on an MCP server.

        • ID string

          The unique ID of the list.

        • ServerLabel string

          The label of the MCP server.

        • Tools []ResponseItemMcpListToolsTool

          The tools available on the server.

          • InputSchema any

            The JSON schema describing the tool's input.

          • Name string

            The name of the tool.

          • Annotations any

            Additional annotations about the tool.

          • Description string

            The description of the tool.

        • Type McpListTools

          The type of the item. Always mcp_list_tools.

          • const McpListToolsMcpListTools McpListTools = "mcp_list_tools"
        • Error string

          Error message if the server could not list tools.

      • type ResponseItemMcpApprovalRequest struct{…}

        A request for human approval of a tool invocation.

        • ID string

          The unique ID of the approval request.

        • Arguments string

          A JSON string of arguments for the tool.

        • Name string

          The name of the tool to run.

        • ServerLabel string

          The label of the MCP server making the request.

        • Type McpApprovalRequest

          The 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 string

          The unique ID of the approval response

        • ApprovalRequestID string

          The ID of the approval request being answered.

        • Approve bool

          Whether the request was approved.

        • Type McpApprovalResponse

          The type of the item. Always mcp_approval_response.

          • const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"
        • Reason string

          Optional reason for the decision.

      • type ResponseItemMcpCall struct{…}

        An invocation of a tool on an MCP server.

        • ID string

          The unique ID of the tool call.

        • Arguments string

          A JSON string of the arguments passed to the tool.

        • Name string

          The name of the tool that was run.

        • ServerLabel string

          The label of the MCP server running the tool.

        • Type McpCall

          The type of the item. Always mcp_call.

          • const McpCallMcpCall McpCall = "mcp_call"
        • ApprovalRequestID string

          Unique identifier for the MCP tool call approval request. Include this value in a subsequent mcp_approval_response input to approve or reject the corresponding tool call.

        • Error string

          The error from the tool call, if any.

        • Output string

          The output from the tool call.

        • Status string

          The status of the tool call. One of in_progress, completed, incomplete, calling, or failed.

          • 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 string

          The unique ID of the custom tool call item.

        • Status string

          The status of the item. One of in_progress, completed, or incomplete. Populated when items are returned via API.

          • const ResponseCustomToolCallItemStatusInProgress ResponseCustomToolCallItemStatus = "in_progress"

          • const ResponseCustomToolCallItemStatusCompleted ResponseCustomToolCallItemStatus = "completed"

          • const ResponseCustomToolCallItemStatusIncomplete ResponseCustomToolCallItemStatus = "incomplete"

        • CreatedBy string

          The 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 string

          The unique ID of the custom tool call output item.

        • Status string

          The status of the item. One of in_progress, completed, or incomplete. Populated when items are returned via API.

          • const ResponseCustomToolCallOutputItemStatusInProgress ResponseCustomToolCallOutputItemStatus = "in_progress"

          • const ResponseCustomToolCallOutputItemStatusCompleted ResponseCustomToolCallOutputItemStatus = "completed"

          • const ResponseCustomToolCallOutputItemStatusIncomplete ResponseCustomToolCallOutputItemStatus = "incomplete"

        • CreatedBy string

          The identifier of the actor that created the item.

    • FirstID string

      The ID of the first item in the list.

    • HasMore bool

      Whether there are more items available.

    • LastID string

      The ID of the last item in the list.

    • Object List

      The type of object returned, must be list.

      • const ListList List = "list"